Skip to content

Commit

Permalink
Merge pull request #4269 from sbwalker/dev
Browse files Browse the repository at this point in the history
refactor #4268 to support static render mode
  • Loading branch information
sbwalker authored May 19, 2024
2 parents 947bb85 + 9325c72 commit 6d99852
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions Oqtane.Client/Modules/Controls/ModuleMessage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
{
<div class="@_classname alert-dismissible fade show mb-3" role="alert">
@((MarkupString)Message)
@if (PageState != null)
@if (Type == MessageType.Error && PageState != null && UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
<NavLink class="ms-2" href="@NavigateUrl("admin/log")">View Details</NavLink>
}
@if (ModuleState.RenderMode == RenderModes.Static)
{
<a href="@NavigationManager.Uri" class="btn-close" data-dismiss="alert" aria-label="close"></a>
}
else
{
@if (Type == MessageType.Error && UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
{
<NavLink class="ms-2" href="@NavigateUrl("admin/log")">View Details</NavLink>
}
<button type="button" class="btn-close" data-dismiss="alert" aria-label="close" @onclick="CloseMessage"></button>
}
</div>
Expand All @@ -20,7 +24,6 @@
@code {
private string _message = string.Empty;
private string _classname = string.Empty;
private string _formname = "ModuleMessageForm";

[Parameter]
public string Message { get; set; }
Expand All @@ -31,14 +34,6 @@
[Parameter]
public RenderModeBoundary Parent { get; set; }

protected override void OnInitialized()
{
if (ModuleState != null)
{
_formname += ModuleState.PageModuleId.ToString();
}
}

protected override void OnParametersSet()
{
_message = Message;
Expand Down

0 comments on commit 6d99852

Please sign in to comment.