Simpler mod dashboard (by lisp).

This commit is contained in:
Michael Walker 2016-09-12 13:11:36 +01:00
parent f599d63a98
commit b58fab9814
1 changed files with 82 additions and 158 deletions

View File

@ -1,173 +1,97 @@
<fieldset> <ul>
<legend>{% trans 'Boards' %}</legend> {% for board in boards %}
<li>
<a href="?/{{ config.board_path|sprintf(board.uri) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(board.uri) }}</a>
-
{{ board.title|e }}
{% if board.subtitle %}
<small>&mdash;
{% if config.allow_subtitle_html %}
{{ board.subtitle }}
{% else %}
{{ board.subtitle|e }}
{% endif %}
</small>
{% endif %}
{% if mod|hasPermission(config.mod.manageboards) %}
<a href="?/edit/{{ board.uri }}"><small>[{% trans 'edit' %}]</small></a>
{% endif %}
</li>
{% endfor %}
<ul> {% if mod|hasPermission(config.mod.newboard) %}
{% for board in boards %} <li style="margin-top:15px"><a href="?/new-board"><strong>{% trans 'Create new board' %}</strong></a></li>
<li> {% endif %}
<a href="?/{{ config.board_path|sprintf(board.uri) }}{{ config.file_index }}">{{ config.board_abbreviation|sprintf(board.uri) }}</a>
-
{{ board.title|e }}
{% if board.subtitle %}
<small>&mdash;
{% if config.allow_subtitle_html %}
{{ board.subtitle }}
{% else %}
{{ board.subtitle|e }}
{% endif %}
</small>
{% endif %}
{% if mod|hasPermission(config.mod.manageboards) %}
<a href="?/edit/{{ board.uri }}"><small>[{% trans 'edit' %}]</small></a>
{% endif %}
</li>
{% endfor %}
{% if mod|hasPermission(config.mod.newboard) %} {% if mod|hasPermission(config.mod.reports) %}
<li style="margin-top:15px"><a href="?/new-board"><strong>{% trans 'Create new board' %}</strong></a></li> <li>
{% endif %} {% if reports > 0 %}<strong>{% endif %}
</ul> <a href="?/reports">{% trans 'Report queue' %} ({{ reports }})</a>
</fieldset> {% if reports > 0 %}</strong>{% endif %}
</li>
<fieldset> {% endif %}
<legend>{% trans 'Messages' %}</legend> {% if mod|hasPermission(config.mod.view_banlist) %}
<ul> <li><a href="?/bans">{% trans 'Ban list' %}</a></li>
{% if mod|hasPermission(config.mod.noticeboard) %} {% endif %}
{% if noticeboard|count > 0 %} {% if config.ban_appeals and mod|hasPermission(config.mod.view_ban_appeals) %}
<li> <li><a href="?/ban-appeals">{% trans 'Ban appeals' %}</a></li>
{% trans 'Noticeboard' %}: {% endif %}
<ul> {% if mod|hasPermission(config.mod.manageusers) %}
{% for post in noticeboard %} <li><a href="?/users">{% trans 'Manage users' %}</a></li>
<li> {% elseif mod|hasPermission(config.mod.change_password) %}
<a href="?/noticeboard#{{ post.id }}"> <li><a href="?/users/{{ mod.id }}">{% trans 'Change password' %}</a></li>
{% if post.subject %} {% endif %}
{{ post.subject|e }} {% if mod|hasPermission(config.mod.themes) %}
{% else %} <li><a href="?/themes">{% trans 'Manage themes' %}</a></li>
<em>{% trans 'no subject' %}</em> {% endif %}
{% endif %} {% if mod|hasPermission(config.mod.modlog) %}
</a> <li><a href="?/log">{% trans 'Moderation log' %}</a></li>
<small class="unimportant"> {% endif %}
&mdash; by {% if mod|hasPermission(config.mod.recent) %}
{% if post.username %} <li><a href="?/recent/25">{% trans 'Recent posts' %}</a></li>
{{ post.username|e }} {% endif %}
{% else %} {% if mod|hasPermission(config.mod.rebuild) %}
<em>deleted?</em> <li><a href="?/rebuild">{% trans 'Rebuild' %}</a></li>
{% endif %} {% endif %}
at {% if mod|hasPermission(config.mod.edit_config) %}
{{ post.time|date(config.post_date) }} <li><a href="?/config">{% trans 'Configuration' %}</a></li>
</small> {% endif %}
</li>
{% endfor %}
</ul>
</li>
{% endif %}
<li><a href="?/noticeboard">{% trans 'View all noticeboard entries' %}</a></li>
{% endif %}
<li><a href="?/news">{% trans 'News' %}</a></li>
<li>
<a href="?/inbox">
{% trans 'PM inbox' %}
{% if unread_pms > 0 %}<strong>{%endif %}({{ unread_pms }} unread){% if unread_pms > 0 %}</strong>{%endif %}
</a>
</li>
</ul>
</fieldset>
<fieldset>
<legend>{% trans 'Administration' %}</legend>
<ul>
{% if mod|hasPermission(config.mod.reports) %}
<li>
{% if reports > 0 %}<strong>{% endif %}
<a href="?/reports">{% trans 'Report queue' %} ({{ reports }})</a>
{% if reports > 0 %}</strong>{% endif %}
</li>
{% endif %}
{% if mod|hasPermission(config.mod.view_banlist) %}
<li><a href="?/bans">{% trans 'Ban list' %}</a></li>
{% endif %}
{% if config.ban_appeals and mod|hasPermission(config.mod.view_ban_appeals) %}
<li><a href="?/ban-appeals">{% trans 'Ban appeals' %}</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.manageusers) %}
<li><a href="?/users">{% trans 'Manage users' %}</a></li>
{% elseif mod|hasPermission(config.mod.change_password) %}
<li><a href="?/users/{{ mod.id }}">{% trans 'Change password' %}</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.themes) %}
<li><a href="?/themes">{% trans 'Manage themes' %}</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.modlog) %}
<li><a href="?/log">{% trans 'Moderation log' %}</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.recent) %}
<li><a href="?/recent/25">{% trans 'Recent posts' %}</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.rebuild) %}
<li><a href="?/rebuild">{% trans 'Rebuild' %}</a></li>
{% endif %}
{% if mod|hasPermission(config.mod.edit_config) %}
<li><a href="?/config">{% trans 'Configuration' %}</a></li>
{% endif %}
</ul>
</fieldset>
{% if mod|hasPermission(config.mod.search) %} {% if mod|hasPermission(config.mod.search) %}
<fieldset>
<legend>{% trans 'Search' %}</legend>
<ul> <li>
<li> {% include 'mod/search_form.html' %}
{% include 'mod/search_form.html' %} </li>
</li>
</ul>
</fieldset>
{% endif %} {% endif %}
{% if config.mod.dashboard_links|count %} {% if config.mod.dashboard_links|count %}
<fieldset>
<legend>{% trans 'Other' %}</legend>
<ul> {% for label,link in config.mod.dashboard_links %}
{% for label,link in config.mod.dashboard_links %} <li><a href="{{ link }}">{{ label }}</a></li>
<li><a href="{{ link }}">{{ label }}</a></li> {% endfor %}
{% endfor %}
</ul>
</fieldset>
{% endif %} {% endif %}
{% if config.debug %} {% if config.debug %}
<fieldset>
<legend>{% trans 'Debug' %}</legend> <li><a href="?/debug/antispam">{% trans 'Anti-spam' %}</a></li>
<ul> <li><a href="?/debug/recent">{% trans 'Recent posts' %}</a></li>
<li><a href="?/debug/antispam">{% trans 'Anti-spam' %}</a></li> {% if mod|hasPermission(config.mod.debug_sql) %}
<li><a href="?/debug/recent">{% trans 'Recent posts' %}</a></li> <li><a href="?/debug/sql">{% trans 'SQL' %}</a></li>
{% if mod|hasPermission(config.mod.debug_sql) %} {% endif %}
<li><a href="?/debug/sql">{% trans 'SQL' %}</a></li>
{% endif %}
</ul>
</fieldset>
{% endif %} {% endif %}
{% if newer_release %} {% if newer_release %}
<fieldset>
<legend>Update</legend> <li>
<ul> A newer version of vichan
<li> (<strong>v{{ newer_release.massive }}.{{ newer_release.major }}.{{ newer_release.minor }}</strong>) is available!
A newer version of vichan See <a href="https://engine.vichan.net">https://engine.vichan.net/</a> for upgrade instructions.
(<strong>v{{ newer_release.massive }}.{{ newer_release.major }}.{{ newer_release.minor }}</strong>) is available! </li>
See <a href="https://engine.vichan.net">https://engine.vichan.net/</a> for upgrade instructions.
</li>
</ul>
</fieldset>
{% endif %} {% endif %}
<fieldset> <li><a href="?/logout/{{ logout_token }}">{% trans 'Logout' %}</a></li>
<legend>{% trans 'User account' %}</legend> </ul>
<ul>
<li><a href="?/logout/{{ logout_token }}">{% trans 'Logout' %}</a></li>
</ul>
</fieldset>