Page management cleanup

This commit is contained in:
Shaun Walker
2019-08-21 10:37:02 -04:00
parent 42c6efbfdb
commit ad2d865d7c
6 changed files with 266 additions and 124 deletions

View File

@ -7,7 +7,7 @@
@if (authorized)
{
<NavLink class="@buttonClass" href="@url">@text</NavLink>
<NavLink class="@classname" href="@url" style="@style">@text</NavLink>
}
@code {
@ -21,12 +21,16 @@
public string Parameters { get; set; } // optional
[Parameter]
public string ButtonClass { get; set; } // optional
public string Class { get; set; } // optional
[Parameter]
public string Style { get; set; } // optional
string text = "";
string url = "";
string parameters = "";
string buttonClass = "btn btn-primary";
string classname = "btn btn-primary";
string style = "";
bool authorized = false;
protected override void OnInitialized()
@ -42,9 +46,14 @@
parameters = Parameters;
}
if (!string.IsNullOrEmpty(ButtonClass))
if (!string.IsNullOrEmpty(Class))
{
buttonClass = "btn " + ButtonClass;
classname = Class;
}
if (!string.IsNullOrEmpty(Style))
{
style = Style;
}
url = EditUrl(Action, parameters);

View File

@ -0,0 +1,55 @@
@using Oqtane.Modules
@inherits ModuleBase
@((MarkupString)@text)
@code {
[Parameter]
public string CreatedBy { get; set; }
[Parameter]
public DateTime CreatedOn { get; set; }
[Parameter]
public string ModifiedBy { get; set; }
[Parameter]
public DateTime ModifiedOn { get; set; }
[Parameter]
public string Style { get; set; }
string text = "";
string style = "";
protected override void OnInitialized()
{
if (!String.IsNullOrEmpty(CreatedBy) || CreatedOn != null)
{
text += "<p style=\"" + Style + "\">Created ";
if (!String.IsNullOrEmpty(CreatedBy))
{
text += " by <b>" + CreatedBy + "</b>";
}
if (CreatedOn != null)
{
text += " on <b>" + CreatedOn.ToString("MMM dd yyyy HH:mm:ss") + "</b>";
}
text += "</p>";
}
if (!String.IsNullOrEmpty(ModifiedBy) || ModifiedOn != null)
{
text += "<p style=\"" + Style + "\">Last modified ";
if (!String.IsNullOrEmpty(ModifiedBy))
{
text += " by <b>" + ModifiedBy + "</b>";
}
if (ModifiedOn != null)
{
text += " on <b>" + ModifiedOn.ToString("MMM dd yyyy HH:mm:ss") + "</b>";
}
text += "</p>";
}
}
}