mirror of
https://github.com/Eggbertx/gochan.git
synced 2025-09-11 11:46:24 -07:00
Show correct role on staff dashboard
This commit is contained in:
parent
24cf95f400
commit
28a53add0a
2 changed files with 12 additions and 1 deletions
|
@ -134,11 +134,22 @@ func dashboardCallback(writer http.ResponseWriter, request *http.Request, wantsJ
|
|||
return nil, err
|
||||
}
|
||||
rank := GetStaffRank(request)
|
||||
rankString := ""
|
||||
switch rank {
|
||||
case AdminPerms:
|
||||
rankString = "administrator"
|
||||
case ModPerms:
|
||||
rankString = "moderator"
|
||||
case JanitorPerms:
|
||||
rankString = "janitor"
|
||||
}
|
||||
|
||||
availableActions := getAvailableActions(rank, true)
|
||||
if err = serverutil.MinifyTemplate(gctemplates.ManageDashboard,
|
||||
map[string]interface{}{
|
||||
"actions": availableActions,
|
||||
"rank": rank,
|
||||
"rankString": rankString,
|
||||
"announcements": announcements,
|
||||
"boards": gcsql.AllBoards,
|
||||
"webroot": config.GetSystemCriticalConfig().WebRoot,
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<i>No boards</i>
|
||||
{{end}}
|
||||
</fieldset><br />
|
||||
<fieldset><legend>Staff actions (role: administrator)</legend>
|
||||
<fieldset><legend>Staff actions (role: {{$.rankString}})</legend>
|
||||
<ul>
|
||||
{{range $a, $action := $.actions}}
|
||||
{{if ne $action.Title "Dashboard"}}<li><a href="{{$.webroot}}manage?action={{$action.ID}}">{{$action.Title}}</a> </li>{{end}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue