diff options
author | 2019-04-19 12:11:49 +0100 | |
---|---|---|
committer | 2019-04-19 12:11:49 +0100 | |
commit | ed7ba6aa8ebe02d8e16fc784ece95d6092c4701b (patch) | |
tree | 0b3ff2a1ad55c373b290c14ef5d5ab1e5fad0476 /pydis_site/templates/wiki/dir.html | |
parent | Big pagination changes because the wiki is stupid (diff) |
Wiki pagination is special-cased, so we basically have one option for it
Diffstat (limited to 'pydis_site/templates/wiki/dir.html')
-rw-r--r-- | pydis_site/templates/wiki/dir.html | 132 |
1 files changed, 64 insertions, 68 deletions
diff --git a/pydis_site/templates/wiki/dir.html b/pydis_site/templates/wiki/dir.html index 283fe598..d8560089 100644 --- a/pydis_site/templates/wiki/dir.html +++ b/pydis_site/templates/wiki/dir.html @@ -5,80 +5,76 @@ {% block wiki_pagetitle %}{% trans "Listing articles in" %} {{ article.current_revision.title }}{% endblock %} {% block wiki_contents_tab %} + {% url 'wiki:dir' urlpath.path as self_url %} -{% url 'wiki:dir' urlpath.path as self_url %} - -<form class="form-search directory-toolbar"> -<div class="well well-small"> - <div class="btn-group pull-left"> - {% if urlpath.parent %} - <a href="{% url 'wiki:dir' path=urlpath.parent.path %}" class="btn btn-default"> - <span class="fa fa-arrow-up"></span> - {% trans "Up one level" %} - </a> - {% endif %} - <a href="{% url 'wiki:create' path=urlpath.path %}" class="btn btn-default"> - <span class="fa fa-plus"></span> - {% trans "Add article" %} - </a> - </div> - <div class="pull-right"> - {{ filter_form.query }} - </div> - {% if filter_query %} - <div class="pull-right filter-clear"> - <a href="{{ self_url }}">({% trans "clear" %})</a> + <form class="form-search directory-toolbar"> + <div class="well well-small"> + <div class="btn-group pull-left"> + {% if urlpath.parent %} + <a href="{% url 'wiki:dir' path=urlpath.parent.path %}" class="btn btn-default"> + <span class="fa fa-arrow-up"></span> + {% trans "Up one level" %} + </a> + {% endif %} + <a href="{% url 'wiki:create' path=urlpath.path %}" class="btn btn-default"> + <span class="fa fa-plus"></span> + {% trans "Add article" %} + </a> + </div> + <div class="pull-right"> + {{ filter_form.query }} </div> - {% endif %} + {% if filter_query %} + <div class="pull-right filter-clear"> + <a href="{{ self_url }}">({% trans "clear" %})</a> + </div> + {% endif %} - <div class="clearfix"></div> -</div> -</form> + <div class="clearfix"></div> + </div> + </form> -<p> - {% with paginator.object_list.count as cnt %} - {% blocktrans with urlpath.path as path and cnt|pluralize:_("article,articles") as articles_plur and cnt|pluralize:_("is,are") as articles_plur_verb trimmed %} - Browsing <strong><a href="{{ self_url }}">/{{ path }}</a></strong>. There {{ articles_plur_verb }} <strong>{{ cnt }} {{ articles_plur }}</strong> in this level. - {% endblocktrans %} - {% endwith %} -</p> + <p> + {% with paginator.object_list.count as cnt %} + {% blocktrans with urlpath.path as path and cnt|pluralize:_("article,articles") as articles_plur and cnt|pluralize:_("is,are") as articles_plur_verb trimmed %} + Browsing <strong><a href="{{ self_url }}">/{{ path }}</a></strong>. There {{ articles_plur_verb }} <strong>{{ cnt }} {{ articles_plur }}</strong> in this level. + {% endblocktrans %} + {% endwith %} + </p> -<table class="table table-striped"> - <tr> - <th>{% trans "Title" %}</th> - <th>{% trans "Slug" %}</th> - <th>{% trans "Last modified" %}</th> - </tr> - {% for urlpath in directory %} + <table class="table table-striped"> <tr> - <td> - <a href="{% url 'wiki:get' path=urlpath.path %}"> {{ urlpath.article.current_revision.title }} </a> - <a href="{% url 'wiki:dir' path=urlpath.path %}" class="list-children"> › </a> - {% if urlpath.article.current_revision.deleted %} - <span class="fa fa-trash"></span> - {% endif %} - {% if urlpath.article.current_revision.locked %} - <span class="fa fa-lock"></span> - {% endif %} - </td> - <td> - {{ urlpath.slug }} - </td> - <td> - {{ urlpath.article.current_revision.created|naturaltime }} - </td> + <th>{% trans "Title" %}</th> + <th>{% trans "Slug" %}</th> + <th>{% trans "Last modified" %}</th> </tr> - {% empty%} - <tr> - <td colspan="100"> - <em>{% trans "There are no articles in this level" %}</em> - </td> - </tr> - {% endfor %} -</table> - -{% if is_paginated %} - {% include "base/paginator.html" with page=page_obj %} -{% endif %} + {% for urlpath in directory %} + <tr> + <td> + <a href="{% url 'wiki:get' path=urlpath.path %}"> {{ urlpath.article.current_revision.title }} </a> + <a href="{% url 'wiki:dir' path=urlpath.path %}" class="list-children"> › </a> + {% if urlpath.article.current_revision.deleted %} + <span class="fa fa-trash"></span> + {% endif %} + {% if urlpath.article.current_revision.locked %} + <span class="fa fa-lock"></span> + {% endif %} + </td> + <td> + {{ urlpath.slug }} + </td> + <td> + {{ urlpath.article.current_revision.created|naturaltime }} + </td> + </tr> + {% empty%} + <tr> + <td colspan="100"> + <em>{% trans "There are no articles in this level" %}</em> + </td> + </tr> + {% endfor %} + </table> + {% include "wiki/includes/pagination.html" %} {% endblock %} |