Skip to content

Commit d16aa89

Browse files
Fixed #63 - Create an Alert system to show alerts on UI
1 parent e5b9b50 commit d16aa89

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/AbpCompanyName.AbpProjectName.Web/Views/Shared/_Layout.cshtml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
@using System.Globalization
2-
@using System.Threading
3-
@using System.Threading.Tasks
42
@using Abp.Timing
53
@using AbpCompanyName.AbpProjectName.Web.Views.Shared.Components.LanguageSelection
64
@using AbpCompanyName.AbpProjectName.Web.Views.Shared.Components.TopMenu
75
@using Abp.Web.Security.AntiForgery
86
@inject IAbpAntiForgeryManager AbpAntiForgeryManager
7+
@using Abp.Web.Mvc.Alerts
8+
@inject IAlertManager AlertManager
99
@{
1010
AbpAntiForgeryManager.SetCookie(Context);
1111
}
@@ -80,6 +80,26 @@
8080
</div>
8181

8282
<div class="container body-content">
83+
@if (AlertManager.Alerts.Any())
84+
{
85+
<div id="AbpPageAlerts">
86+
@foreach (var alertMessage in AlertManager.Alerts)
87+
{
88+
<div class="alert [email protected]().ToLower() @(alertMessage.Dismissible ? "alert-dismisable" : "")" role="alert">
89+
<h4 class="alert-heading">
90+
@alertMessage.Title
91+
@if (alertMessage.Dismissible)
92+
{
93+
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
94+
}
95+
</h4>
96+
97+
<p>@alertMessage.Text</p>
98+
</div>
99+
}
100+
</div>
101+
}
102+
83103
@RenderBody()
84104
</div>
85105

0 commit comments

Comments
 (0)