Add notifications menu to index page when logged in

This commit is contained in:
Noah 2022-08-25 20:07:44 -07:00
parent d8e4310a18
commit 3f21270c87
2 changed files with 53 additions and 2 deletions

View File

@ -198,6 +198,7 @@
<!-- Mobile: notifications badge next to hamburger menu -->
{{if .LoggedIn}}
<div class="mobile nonshy-mobile-notification">
{{if .CurrentUser.Certified}}
<a class="tag is-grey py-4"
href="/forum">
<span class="icon"><i class="fa fa-comments"></i></span>
@ -207,6 +208,7 @@
href="/photo/gallery">
<span class="icon"><i class="fa fa-image"></i></span>
</a>
{{end}}
<a class="tag {{if gt .NavFriendRequests 0}}is-warning{{else}}is-grey{{end}} py-4"
href="/friends{{if gt .NavFriendRequests 0}}?view=requests{{end}}">

View File

@ -100,8 +100,57 @@
<p class="card-header-title has-text-light">Welcome back, {{.CurrentUser.Username}}!</p>
</header>
<div class="card-content">
Content to come here soon.
<div class="card-content p-2">
<ul class="menu-list">
<li>
<a href="/messages"{{if .NavUnreadMessages}} class="has-text-warning-dark"{{end}}>
<span class="icon"><i class="fa fa-envelope"></i></span>
{{if .NavUnreadMessages}}
<span>{{.NavUnreadMessages}} New Message{{Pluralize64 .NavUnreadMessages}}!</span>
{{else}}
<span>Messages</span>
{{end}}
</a>
</li>
<li>
<a href="/friends{{if .NavFriendRequests}}?view=requests{{end}}"{{if .NavFriendRequests}} class="has-text-warning-dark"{{end}}>
<span class="icon"><i class="fa fa-user-group"></i></span>
{{if .NavFriendRequests}}
<span>{{.NavFriendRequests}} Friend Request{{Pluralize64 .NavFriendRequests}}!</span>
{{else}}
<span>Friends</span>
{{end}}
</a>
</li>
<li>
<a href="/me{{if .NavUnreadNotifications}}?view=requests{{end}}"{{if .NavUnreadNotifications}} class="has-text-warning-dark"{{end}}>
<span class="icon"><i class="fa {{if .NavUnreadNotifications}}fa-bell{{else}}fa-home-user{{end}}"></i></span>
{{if .NavUnreadNotifications}}
<span>{{.NavUnreadNotifications}} New Notification{{Pluralize64 .NavUnreadNotifications}}!</span>
{{else}}
<span>Dashboard</span>
{{end}}
</a>
</li>
<li>
<a href="/u/{{.CurrentUser.Username}}">
<span class="icon"><i class="fa fa-user"></i></span>
My Profile
</a>
</li>
<li>
<a href="/photo/u/{{.CurrentUser.Username}}">
<span class="icon"><i class="fa fa-image"></i></span>
My Photos
</a>
</li>
<li>
<a href="/photo/upload">
<span class="icon"><i class="fa fa-upload"></i></span>
Upload Photos
</a>
</li>
</ul>
</div>
</div>
{{else}}