ActionLink Improvements

Adjustment to ActionLink component to support custom button classes.  Adjustment of all button styles inside of the project to swap to either btn-danger for delete operations or btn-secondary for cancel operations for consistency.
This commit is contained in:
Mitchel Sellers
2019-05-17 23:55:55 -05:00
parent 1e5df43e84
commit f8a048e5ac
10 changed files with 22 additions and 11 deletions

View File

@ -7,7 +7,7 @@
@if (authorized)
{
<NavLink class="btn btn-primary" href="@url">@text</NavLink>
<NavLink class="@buttonClass" href="@url">@text</NavLink>
}
@functions {
@ -20,9 +20,13 @@
[Parameter]
private string Parameters { get; set; } // optional
[Parameter]
private string ButtonClass { get; set; } // optional
string text = "";
string url = "";
string parameters = "";
string buttonClass = "btn btn-primary";
bool authorized = false;
protected override void OnInit()
@ -32,10 +36,17 @@
{
text = Text;
}
if (!String.IsNullOrEmpty(Parameters))
{
parameters = Parameters;
}
if (!string.IsNullOrEmpty(ButtonClass))
{
buttonClass = "btn " + ButtonClass;
}
url = EditUrl(Action, parameters);
string typename = ModuleState.ModuleType.Replace(Utilities.GetTypeNameClass(ModuleState.ModuleType) + ",", Action + ",");