1bf846e78b
Allow regular (non-admin) users access to the Manage Forums page so they can create and manage their own forums. Things that were already working: * The admin forum page was already anticipating regular LoginRequired credential * Users only see their owned forums, while admins can see and manage ALL forums Improvements made to the Forum Admin page: * Change the title color from admin-red to user-blue. * Add ability to search (filter) and sort the forums. Other changes: * Turn the Forum tab bar into a reusable component.
33 lines
919 B
HTML
33 lines
919 B
HTML
<!--
|
|
Reusable Forums tab bar.
|
|
|
|
Usage: [[ForumTabs .]]
|
|
|
|
Variables that your template should set:
|
|
|
|
- CurrentForumTab (string): one of categories, newest, search.
|
|
-->
|
|
{{define "ForumTabs"}}
|
|
<div class="block p-4 mb-0">
|
|
<div class="tabs is-boxed">
|
|
<ul>
|
|
<li {{if or (eq .CurrentForumTab "categories") (not .CurrentForumTab) }}class="is-active"{{end}}>
|
|
<a href="/forum">
|
|
Categories
|
|
</a>
|
|
</li>
|
|
<li {{if eq .CurrentForumTab "newest" }}class="is-active"{{end}}>
|
|
<a href="/forum/newest">
|
|
Newest
|
|
</a>
|
|
</li>
|
|
<li {{if eq .CurrentForumTab "search" }}class="is-active"{{end}}>
|
|
<a href="/forum/search">
|
|
<i class="fa fa-search mr-2"></i> Search
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
{{end}}
|