Added admin approval queue to user dropdown for admins

This commit is contained in:
Asaf Gartner 2024-07-07 13:23:40 +03:00
parent 27deef56af
commit 4be6e89298
3 changed files with 14 additions and 11 deletions

View File

@ -65,6 +65,9 @@
<div class="submenu right-0" id="profile-submenu"> <div class="submenu right-0" id="profile-submenu">
<a href="{{ .Header.UserProfileUrl }}">Profile</a> <a href="{{ .Header.UserProfileUrl }}">Profile</a>
<a href="{{ .Header.UserSettingsUrl }}">Settings</a> <a href="{{ .Header.UserSettingsUrl }}">Settings</a>
{{ if .User.IsStaff }}
<a href="{{ .Header.AdminApprovalQueueUrl }}">User approvals</a>
{{ end }}
<a href="{{ .Header.LogoutUrl }}">Log Out</a> <a href="{{ .Header.LogoutUrl }}">Log Out</a>
</div> </div>
</div> </div>

View File

@ -40,12 +40,12 @@ func (bd *BaseData) AddImmediateNotice(class, content string) {
} }
type Header struct { type Header struct {
AdminUrl string AdminApprovalQueueUrl string
UserProfileUrl string UserProfileUrl string
UserSettingsUrl string UserSettingsUrl string
LogoutUrl string LogoutUrl string
ForgotPasswordUrl string ForgotPasswordUrl string
RegisterUrl string RegisterUrl string
HMNHomepageUrl string HMNHomepageUrl string
ProjectIndexUrl string ProjectIndexUrl string

View File

@ -81,11 +81,11 @@ func getBaseData(c *RequestContext, title string, breadcrumbs []templates.Breadc
IsProjectPage: !project.IsHMN(), IsProjectPage: !project.IsHMN(),
Header: templates.Header{ Header: templates.Header{
AdminUrl: hmnurl.BuildAdminApprovalQueue(), // TODO(asaf): Replace with general-purpose admin page AdminApprovalQueueUrl: hmnurl.BuildAdminApprovalQueue(), // TODO(asaf): Replace with general-purpose admin page
UserSettingsUrl: hmnurl.BuildUserSettings(""), UserSettingsUrl: hmnurl.BuildUserSettings(""),
LogoutUrl: hmnurl.BuildLogoutAction(c.FullUrl()), LogoutUrl: hmnurl.BuildLogoutAction(c.FullUrl()),
ForgotPasswordUrl: hmnurl.BuildRequestPasswordReset(), ForgotPasswordUrl: hmnurl.BuildRequestPasswordReset(),
RegisterUrl: hmnurl.BuildRegister(""), RegisterUrl: hmnurl.BuildRegister(""),
HMNHomepageUrl: hmnurl.BuildHomepage(), HMNHomepageUrl: hmnurl.BuildHomepage(),
ProjectIndexUrl: hmnurl.BuildProjectIndex(), ProjectIndexUrl: hmnurl.BuildProjectIndex(),