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">
<a href="{{ .Header.UserProfileUrl }}">Profile</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>
</div>
</div>

View File

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

View File

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