mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-20 02:28:31 +01:00
44 lines
1.4 KiB
Plaintext
44 lines
1.4 KiB
Plaintext
@{
|
|
StatusMessageModel parsedModel = null;
|
|
TempData.TryGetValue(WellKnownTempData.SuccessMessage, out var successMessage);
|
|
TempData.TryGetValue(WellKnownTempData.ErrorMessage, out var errorMessage);
|
|
var model = TempData.GetStatusMessageModel();
|
|
if (successMessage != null || errorMessage != null)
|
|
{
|
|
parsedModel = new StatusMessageModel();
|
|
parsedModel.Message = (string)successMessage ?? (string)errorMessage;
|
|
if (successMessage != null)
|
|
{
|
|
parsedModel.Severity = StatusMessageModel.StatusSeverity.Success;
|
|
}
|
|
else
|
|
{
|
|
parsedModel.Severity = StatusMessageModel.StatusSeverity.Error;
|
|
}
|
|
}
|
|
else if (model != null)
|
|
{
|
|
parsedModel = model as StatusMessageModel;
|
|
}
|
|
}
|
|
|
|
@if (parsedModel != null)
|
|
{
|
|
<div class="alert alert-@parsedModel.SeverityCSS @(parsedModel.AllowDismiss? "alert-dismissible":"" )" role="alert">
|
|
@if (parsedModel.AllowDismiss)
|
|
{
|
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
}
|
|
@if (!string.IsNullOrEmpty(parsedModel.Message))
|
|
{
|
|
@parsedModel.Message
|
|
}
|
|
@if (!string.IsNullOrEmpty(parsedModel.Html))
|
|
{
|
|
@Safe.Raw(parsedModel.Html)
|
|
}
|
|
</div>
|
|
}
|