1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- {% extends "cranefly/layout.html" %}
- {% import "cranefly/macros.html" as macros with context %}
- {% block title %}{{ macros.page_title(title=category.name) }}{% endblock %}
- {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
- {% for parent in parents %}
- <li><a href="{{ parent.type|url(forum=parent.pk, slug=parent.slug) }}">{{ parent.name }}</a> <span class="divider"><i class="icon-chevron-right"></i></span></li>
- {% endfor %}
- <li class="active">{{ category.name }}
- {%- endblock %}
- {% block container %}
- <div class="page-header header-primary">
- <div class="container">
- {{ messages_list(messages) }}
- <ul class="breadcrumb" {{ macros.itemprop_bread() }}>
- {{ self.breadcrumb() }}</li>
- </ul>
- <h1>{{ category.name }}</h1>
- </div>
- </div>
- <div class="container container-primary">
- {% if category.description %}
- <div class="markdown lead page-description">
- {{ category.description_preparsed|markdown_final|safe }}
- </div>
- {% endif %}
- {% if category.subforums %}
- <div class="category-forums-list{% if category.style %} category-forums-{{ category.style }}{% endif %}">
- <table class="table">
- <tbody>
- {% for forum in category.subforums %}
- <tr>
- <td class="forum-icon"><span class="forum-icon-wrap{% if forum.type == 'redirect' %} forum-icon-redirect{% elif not forum.is_read %} forum-icon-new{% endif %}"><i class="icon-{% if forum.type == 'redirect' %}circle-arrow-right{% else %}comment{% endif %} icon-white"></i></span></td>
- <td class="forum-main">
- <h3{% if not forum.is_read %} class="forum-title-new"{% endif %}><a href="{{ forum.type|url(slug=forum.slug, forum=forum.id) }}">{{ forum.name }}</a></h3>
- {% if forum.show_details %}
- <div class="forum-details">
- {% if forum.type == 'redirect' %}
- {{ redirect_stats(forum) }}
- {% else %}
- {{ forum_stats(forum) }}
- {% endif %}
- </div>
- {% endif %}
- {% if forum.description %}<p class="forum-description">{{ forum.description }}</p>{% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% else %}
- <p class="lead">{% trans %}Looks like there are no forums to display in this category.{% endtrans %}</p>
- {% endif %}
- </div>
- {% endblock %}
- {% macro forum_stats(forum) -%}
- {% if forum.last_thread_id and not forum.attr('hidethread') -%}
- {% trans count=forum.posts, posts=fancy_number(forum.posts, forum.posts_delta), thread=forum_thread(forum) -%}
- {{ posts }} post - last in {{ thread }}
- {%- pluralize -%}
- {{ posts }} posts - last in {{ thread }}
- {%- endtrans %}
- {%- else -%}
- {% trans count=forum.posts, posts=fancy_number(forum.posts, forum.posts_delta) -%}
- {{ posts }} post
- {%- pluralize -%}
- {{ posts }} posts
- {%- endtrans %}
- {%- endif %}
- {%- endmacro %}
- {% macro forum_thread(forum) -%}
- <a href="{% url 'thread_new' thread=forum.last_thread_id, slug=forum.last_thread_slug %}">{{ forum.last_thread_name }}</a>
- {%- endmacro %}
- {% macro redirect_stats(forum) -%}
- {% trans count=forum.redirects, redirects=fancy_number(forum.redirects, forum.redirects_delta) -%}
- {{ redirects }} click
- {%- pluralize -%}
- {{ redirects }} clicks
- {%- endtrans %}
- {%- endmacro %}
- {% macro fancy_number(number, delta) -%}
- <strong{% if delta < number %} class="stat-increment"{% endif %}>{{ number|intcomma }}</strong>
- {%- endmacro %}
|