Handy contextual links on the admin change log page

main
Noah Petherbridge 2024-04-04 22:48:46 -07:00
parent ddd33aad91
commit 268a177412
3 changed files with 62 additions and 1 deletions

View File

@ -180,9 +180,61 @@
</td>
<td>
<a href="{{$Root.Request.URL.Path}}?{{QueryPlus "table_name" .TableName}}">{{.TableName}}</a>
<!-- Handy visitation links -->
{{if eq .TableName "blocks"}}
<a href="/admin/user-action?intent=insights&user_id={{.AboutUserID}}" target="_blank" class="has-text-success mx-1"
title="User insights">
<i class="fa fa-info-circle"></i>
</a>
{{end}}
</td>
<td>
<a href="{{$Root.Request.URL.Path}}?{{QueryPlus "table_name" .TableName "table_id" .TableID}}">{{.TableID}}</a>
<!-- Handy visitation links -->
{{if eq .TableName "photos"}}
<a href="/photo/view?id={{.TableID}}" target="_blank" class="has-text-success mx-1"
title="Visit this photo">
<i class="fa fa-image"></i>
</a>
{{else if eq .TableName "comments"}}
<a href="/go/comment?id={{.TableID}}" target="_blank" class="has-text-success mx-1"
title="Visit this comment">
<i class="fa fa-comments"></i>
</a>
{{else if eq .TableName "blocks"}}
<a href="/admin/changelog?table_name=blocks&about_user_id={{.TableID}}" target="_blank" class="has-text-success mx-1"
title="View this user's blocks instead">
<i class="fa fa-search"></i>
</a>
<a href="/admin/user-action?intent=insights&user_id={{.TableID}}" target="_blank" class="has-text-success mx-1"
title="User insights (ID: {{.TableID}})">
<i class="fa fa-info-circle"></i>
</a>
{{else if eq .TableName "friends"}}
<a href="/admin/changelog?table_name=friends&about_user_id={{.TableID}}" target="_blank" class="has-text-success mx-1"
title="View this user's friends instead">
<i class="fa fa-search"></i>
</a>
<a href="/admin/user-action?intent=insights&user_id={{.TableID}}" target="_blank" class="has-text-success mx-1"
title="User insights (ID: {{.TableID}})">
<i class="fa fa-info-circle"></i>
</a>
{{else if and (eq .TableName "certification_photos") .AboutUserID}}
{{$User := $Root.UserMap.Get .AboutUserID}}
<a href="/admin/photo/certification?username={{$User.Username}}" target="_blank" class="has-text-success mx-1"
title="Visit this comment">
<i class="fa fa-certificate"></i>
</a>
{{else if eq .TableName "users"}}
<a href="/admin/user-action?intent=insights&user_id={{.TableID}}" target="_blank" class="has-text-success mx-1"
title="User insights (ID: {{.TableID}})">
<i class="fa fa-info-circle"></i>
</a>
{{end}}
</td>
<td>
<div class="content">

View File

@ -1,4 +1,4 @@
{{define "title"}}Compose a Message{{end}}
{{define "title"}}Admin Action: {{.User.Username}}{{end}}
{{define "content"}}
<div class="container">
<section class="hero is-info is-bold">

View File

@ -350,6 +350,15 @@
</div>
{{end}}
</div>
{{if $Root.CurrentUser.IsAdmin}}
<div>
<span class="tag is-primary is-light">
<span class="icon"><i class="fa fa-database"></i></span>
<span>ID: {{.ID}}</span>
</span>
</div>
{{end}}
</div>
</div>
</div>