-
Notifications
You must be signed in to change notification settings - Fork 117
/
MainLayout.razor
233 lines (225 loc) · 10.1 KB
/
MainLayout.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
@inherits LayoutComponentBase
@inject NavigationManager NavigationManager
@inject IJSRuntime JS
@inject ILayoutManager layoutManager
@inject NavBarLeftInjectableMenu navBarLeftInjectableMenu
<NavBar>
<NavBarLeft>
@if (!navBarLeftInjectableMenu.OverrideParentContent)
{
<NavBarMenuItem Link="/">Home</NavBarMenuItem>
<NavBarMenuItem OnClick="HandleContent">Content</NavBarMenuItem><!-- defaults to # -->
}
@navBarLeftInjectableMenu.content <!-- Injectable for custom menu content per page -->
</NavBarLeft>
<NavBarSearch></NavBarSearch>
<Player></Player>
<NavBarRight>
<NavBarDropDown>
<NavBarBadge Color="Color.Danger" Icon="far fa-comments">4</NavBarBadge>
<NavBarDropDownMenu>
<NavBarDropDownMenuItem>
<UserMessage DateTime="dt.AddMinutes(-2)" ProfilePicture="_content/Blazor.AdminLte.Site.Shared/dist/img/user7-128x128.jpg" Icon="fas fa-star">
<UserName>Patricia Maundrell</UserName>
<Message>Follow up</Message>
</UserMessage>
</NavBarDropDownMenuItem>
<DropdownDivider />
<NavBarDropDownMenuItem>
<UserMessage DateTime="dt.AddHours(-4)" ProfilePicture="_content/Blazor.AdminLte.Site.Shared/dist/img/user1-128x128.jpg" Icon="fas fa-star" IconColor="Color.Warning">
<UserName>Brad Diesel</UserName>
<Message>Call me whenever you can...</Message>
</UserMessage>
</NavBarDropDownMenuItem>
<DropdownDivider />
<NavBarDropDownMenuItem>
<UserMessage DateTime="dt.AddDays(-8)" ProfilePicture="_content/Blazor.AdminLte.Site.Shared/dist/img/user8-128x128.jpg" Icon="fas fa-star" IconColor="Color.Danger">
<UserName>John Pierce</UserName>
<Message>I got your message bro</Message>
</UserMessage>
</NavBarDropDownMenuItem>
<DropdownDivider />
<NavBarDropDownMenuItem>
<UserMessage DateTime="dt.AddDays(-31)" ProfilePicture="_content/Blazor.AdminLte.Site.Shared/dist/img/user3-128x128.jpg" Icon="fas fa-star">
<UserName>Nora Silvester</UserName>
<Message>The subject goes here</Message>
</UserMessage>
</NavBarDropDownMenuItem>
<DropdownDivider />
<DropdownFooter OnClick="SeeAllMessages">See All Messages</DropdownFooter>
</NavBarDropDownMenu>
</NavBarDropDown>
<NavBarDropDown>
<NavBarBadge Color="Color.Warning" Icon="far fa-bell">15</NavBarBadge>
<NavBarDropDownMenu>
<DropdownHeader>15 Notifications</DropdownHeader>
<DropdownDivider></DropdownDivider>
<NotificationMessage DateTime="dt.AddMinutes(-3)" Icon="fas fa-envelope mr-2">
<Message>4 new messages</Message>
</NotificationMessage>
<DropdownDivider></DropdownDivider>
<NotificationMessage DateTime="dt.AddHours(-12)" Icon="fas fa-users mr-2">
<Message>8 friend requests</Message>
</NotificationMessage>
<DropdownDivider></DropdownDivider>
<NotificationMessage DateTime="dt.AddDays(-2)" Icon="fas fa-file mr-2">
<Message>3 new reports</Message>
</NotificationMessage>
<DropdownDivider></DropdownDivider>
<DropdownFooter OnClick="SeeAllNotifications">See All Notifications</DropdownFooter>
</NavBarDropDownMenu>
</NavBarDropDown>
<NavBarSideBarControl></NavBarSideBarControl>
</NavBarRight>
</NavBar>
<SideBarContainer>
<BrandLogo Link="https://adminlte.io/" Logo="_content/Blazor.AdminLte.Site.Shared/dist/img/AdminLTELogo.png">AdminLTE 3</BrandLogo>
<SideBar>
<!-- Sidebar user panel (optional) -->
<SideBarUserPanel ImageEffect="ImageEffect.Circle" Link="starter-pages/user-page" Elevation="Elevation.Three" UserImage="_content/Blazor.AdminLte.Site.Shared/dist/img/user2-160x160.jpg">Alexander Pierce</SideBarUserPanel>
@*<SideBarSearch></SideBarSearch>*@
<SideBarMenu>
<SideBarMenuItem Link="widgets" Icon="fas fa-th">
Widgets
</SideBarMenuItem>
<SideBarTreeView Icon="fas fa-copy">
<Title>Layout Options</Title>
<Items>
<SideBarMenuItem Icon="far fa-circle" Link="layout/grid-system">
Grid System
</SideBarMenuItem>
</Items>
</SideBarTreeView>
<SideBarTreeView Icon="fas fa-tachometer-alt">
<Title>Starter Pages</Title>
<Items>
<SideBarMenuItem Icon="far fa-circle" Link="starter-pages/active-page">
Active Page
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle">
Inactive Page
</SideBarMenuItem>
</Items>
</SideBarTreeView>
<SideBarTreeView Icon="fas fa-tachometer-alt">
<Title>Content Injections</Title>
<Items>
<SideBarMenuItem Icon="far fa-circle" Link="injections/navbar-left">
NavBar Left
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle" Link="injections/navbar-left-override">
NavBar Left Override
</SideBarMenuItem>
</Items>
</SideBarTreeView>
<SideBarTreeView Icon="fas fa-tree">
<Title>UI Elements</Title>
<Items>
<SideBarMenuItem Icon="far fa-circle" Link="ui/general">
General
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle" Link="ui/buttons">
Buttons
</SideBarMenuItem>
<SideBarMenuItem Link="ui/navbar" Icon="far fa-circle">
Navbar & Tabs
</SideBarMenuItem>
</Items>
</SideBarTreeView>
<SideBarTreeView Icon="fas fa-edit">
<Title>Forms</Title>
<Items>
<SideBarMenuItem Icon="far fa-circle" Link="forms/general">
General Elements
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle" Link="forms/advanced">
Advanced Elements
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle" Link="forms/file-management">
File Management
</SideBarMenuItem>
</Items>
</SideBarTreeView>
<SideBarTreeView Icon="fas fa-table">
<Title>Tables</Title>
<Items>
<SideBarMenuItem Icon="far fa-circle" Link="simple-tables">
Simple Tables
</SideBarMenuItem>
</Items>
</SideBarTreeView>
<SideBarTreeView Icon="far fa-user">
<Title>User</Title>
<Items>
<SideBarMenuItem Icon="far fa-circle" Link="login">
Login
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle" Link="register">
Register
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle" Link="forgot-password">
Forgot Password
</SideBarMenuItem>
</Items>
</SideBarTreeView>
<SideBarTreeView Icon="far fa-plus-square">
<Title>Extras</Title>
<Items>
<SideBarMenuItem Icon="far fa-circle" Link="lockscreen">
Lockscreen
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle" Link="404">
Error 404
</SideBarMenuItem>
<SideBarMenuItem Icon="far fa-circle" Link="500">
Error 500
</SideBarMenuItem>
</Items>
</SideBarTreeView>
<SideBarMenuItem Link="simple-link" Icon="fas fa-th">
Simple Link
<span class="right badge badge-danger">New</span>
</SideBarMenuItem>
</SideBarMenu>
</SideBar>
</SideBarContainer>
<ContentWrapper>
@Body
</ContentWrapper>
<ControlSideBar>Hello World!</ControlSideBar>
<MainFooter>
<Default>
<strong>Copyright © 2014-2022 <a href="https://adminlte.io">AdminLTE.io</a>.</strong> All rights reserved.
</Default>
<Right>
Blazorized by Sjef van Leeuwen
</Right>
</MainFooter>
@code {
protected override void OnParametersSet()
{
// content = null; for refreshing custom menu injectables per page.
// no override; reset default to show parent menu content items.
navBarLeftInjectableMenu.SetContent(null, false);
}
private DateTime dt = DateTime.Now;
private void SeeAllMessages(Tuple<IDropdownFooter, MouseEventArgs> args)
{
NavigationManager.NavigateTo("messages/see-all-messages");
}
private void HandleContent(Tuple<INavBarMenuItem, MouseEventArgs> args)
{
NavigationManager.NavigateTo("messages/see-all-messages");
}
private void SeeAllNotifications(Tuple<IDropdownFooter, MouseEventArgs> args)
{
NavigationManager.NavigateTo("messages/see-all-notifications");
}
protected override void OnAfterRender(bool isFirstRender)
{
layoutManager.IsFooterFixed = true;
layoutManager.IsNavBarFixed = true;
layoutManager.IsSideBarFixed = true;
base.OnAfterRender(isFirstRender);
}
}