refactor #4268 to support static render mode
This commit is contained in:
		| @ -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> | ||||
| @ -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; } | ||||
| @ -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; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 sbwalker
					sbwalker