Add secondary navbar for orphaned pages.
Originally motivated by fixing #263 (add a mod list), the root cause of which was that we had a number of orphaned pages, one being the admins list. In the upstream, we moved links to a number of infrequently-accessed pages to a secondary nav in the sidebar. This commit implements a similar approach to provide links to the admin list and modlog. To make the nav less visually unbalanced, Random Post/User were also moved out of the header. To provide mobile support, this secondary nav is presented in the hamburger menu. This also provides a place to link /rules, which otherwise has no link on mobile (that I can readily find). Finally, the original intent of providing a mod list motivates some style changes to admins.html to get rid of visible truescore, make names appear consistently with names elsewhere, and ensure links to leaderboard aren't accidentally leaked.
This commit is contained in:
parent
e407c29ec7
commit
e0e4c79048
6 changed files with 48 additions and 19 deletions
File diff suppressed because one or more lines are too long
|
@ -6,25 +6,21 @@
|
|||
|
||||
<script src="{{ 'js/sort_table.js' | asset }}"></script>
|
||||
|
||||
<pre class="d-none d-md-inline-block"></pre>
|
||||
<h5 style="font-weight:bold;">Admins</h5>
|
||||
<pre></pre>
|
||||
<h5 class="font-weight-bold mt-3 mb-3">Admins</h5>
|
||||
<div class="overflow-x-auto">
|
||||
<table id="sortable_table" class="table table-striped mb-5">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Name</th>
|
||||
<th role="button" onclick="sort_table(2)" style="text-align:right;">Truescore</th>
|
||||
<th role="button" onclick="sort_table(3)" style="text-align:right;">Mod actions</th>
|
||||
<th role="button" onclick="sort_table(2)" class="text-right">Mod Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for user in admins %}
|
||||
<tr>
|
||||
<td>{{loop.index}}</td>
|
||||
<td><a style="color:#{{user.namecolor}}" href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}}"{% endif %}>{{user.username}}</span></a>{% if user.admin_level == 1 and v and v.admin_level > 1 %}<i class="fas fa-broom align-middle ml-2 color-white" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Meme Admin"></i>{% endif %}</td>
|
||||
<td style="text-align:right;">{{user.truecoins}}</td>
|
||||
<td style="text-align:right;"><a href="/log?admin={{user.username}}">{{user.modaction_num}}</a></td>
|
||||
<td><a href="/@{{user.username}}"><img loading="lazy" src="{{user.profile_url}}" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}}"{% endif %}>{{user.username}}</span></a>{% if user.admin_level == 1 and v and v.admin_level > 1 %}<i class="fas fa-broom align-middle ml-2 color-white" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Meme Admin"></i>{% endif %}</td>
|
||||
<td class="text-right"><a href="/log?admin={{user.username}}">{{user.modaction_num}}</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
|
|
@ -63,8 +63,6 @@
|
|||
{% if v and v.admin_level >= 2 %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/admin" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Admin Tools"><i class="fas fa-crown align-middle text-gray-500 black"></i></a>
|
||||
{% endif %}
|
||||
<a class="mobile-nav-icon d-md-none" href="/random_user" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random User"><i class="fas fa-user-circle align-middle text-gray-500 black"></i></a>
|
||||
<a class="mobile-nav-icon d-md-none" href="/random_post" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random Post"><i class="fas fa-random align-middle text-gray-500 black"></i></a>
|
||||
|
||||
{% if v %}
|
||||
<a class="mobile-nav-icon d-md-none" href="{% if sub %}/h/{{sub.name}}{% endif %}/submit" data-bs-toggle="tooltip" data-bs-placement="bottom" title="New Post"><i class="fas fa-edit align-middle text-gray-500 black"></i></a>
|
||||
|
@ -102,14 +100,6 @@
|
|||
</li>
|
||||
{% endif %}
|
||||
|
||||
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
||||
<a class="nav-link" href="/random_user/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random User"><i class="fas fa-user-circle"></i></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
||||
<a class="nav-link" href="/random_post/" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random Post"><i class="fas fa-random"></i></a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
||||
<a class="nav-link" href="/comments" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Comments"><i class="fas fa-comment-dots"></i></a>
|
||||
</li>
|
||||
|
@ -198,6 +188,8 @@
|
|||
|
||||
<a class="nav-item nav-link" href="/contact"><i class="fas fa-file-signature fa-fw mr-3"></i>Contact Us</a>
|
||||
|
||||
{% include "nav_secondary.html" %}
|
||||
|
||||
<li class="nav-item border-top border-bottom mt-2 pt-2">
|
||||
<a class="nav-link" role="button" href="/logout"><i class="fas fa-sign-out fa-fw mr-3 text-danger"></i>Log Out</a>
|
||||
</li>
|
||||
|
|
7
files/templates/nav_secondary.html
Normal file
7
files/templates/nav_secondary.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
<nav id="navigation-secondary" class="text-center text-md">
|
||||
<a class="navigation-secondary-link d-md-none" href="/rules" data-bs-toggle="tooltip" data-bs-placement="top" title="Rules"><i class="fas fa-scale-balanced"></i><span class="d-md-none">Rules</span></a>
|
||||
<a class="navigation-secondary-link" href="/admins" data-bs-toggle="tooltip" data-bs-placement="top" title="Admins"><i class="fas fa-crown"></i><span class="d-md-none">Admins</span></a>
|
||||
<a class="navigation-secondary-link" href="/log" data-bs-toggle="tooltip" data-bs-placement="top" title="Moderation Log"><i class="fas fa-scroll-old"></i><span class="d-md-none">Moderation Log</span></a>
|
||||
<a class="navigation-secondary-link" href="/random_post" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i><span class="d-md-none">Random Post</span></a>
|
||||
<a class="navigation-secondary-link" href="/random_user" data-bs-toggle="tooltip" data-bs-placement="top" title="Random User"><i class="fas fa-user-circle"></i><span class="d-md-none">Random User</span></a>
|
||||
</nav>
|
|
@ -108,9 +108,11 @@
|
|||
<div class="col px-0">
|
||||
<div class="d-flex flex-row-reverse justify-content-center">
|
||||
<ul class="nav settings-nav">
|
||||
{% if v and v.admin_level >= 2 -%}
|
||||
<li class="nav-item">
|
||||
<a style="padding: 0.75rem 1rem"class="nav-link{% if request.path.endswith('/leaderboard') %} active{% endif %}" href="/leaderboard"><i class="fas fa-trophy text-lg mr-0"></i></a>
|
||||
</li>
|
||||
{%- endif %}
|
||||
<li class="nav-item">
|
||||
<a style="padding: 0.75rem 1rem"class="nav-link{% if request.path.endswith('/admins') %} active{% endif %}" href="/admins"><i class="fas fa-crown text-lg mr-0"></i></a>
|
||||
</li>
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<div class="col sidebar text-left d-none d-lg-block pt-3 pb-5 bg-white" style="max-width:300px">
|
||||
<div class="col sidebar text-left d-none d-lg-block pt-4 pb-5 bg-white" style="max-width:300px">
|
||||
|
||||
<div class="d-none d-lg-block">
|
||||
{% include "nav_secondary.html" %}
|
||||
</div>
|
||||
|
||||
{% if sub %}
|
||||
{% set image=sub.sidebar_url %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue