123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- {% extends "cranefly/layout.html" %}
- {% import "cranefly/macros.html" as macros with context %}
- {% block title %}{% if settings.board_index_title %}{{ settings.board_index_title }}{% else %}{{ settings.board_name }}{% endif %}{% endblock %}
-
- {% block meta %}{% if settings.board_index_meta %}
- <meta name="description" content="{{ settings.board_index_meta }}">
- {%- endif %}{%- endblock %}
-
- {% block content %}
- <div class="row">
- <div class="span8">
- <div class="index-forums-list">
- {% for category in forums_list %}{% if category.subforums %}
- <div class="index-category{% if category.style %} index-category-{{ category.style }}{% endif %}">
- <table class="table">
- <caption>{{ category.name }}{% if category.description %} <small>{{ category.description }}</small>{% endif %}</caption>
- <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>
- {% endif %}{% endfor %}
- </div>
- </div>
- <div class="span4 index-sidebar">
- {% if ranks_online %}
- <div class="index-ranks-list">
- {% for rank in ranks_online %}{% if rank.online %}
- <div class="inder-rank{% if rank.style %} index-rank-{{ rank.style }}{% endif %}">
- <h3>{% trans rank_name=_(rank.name) %}{{ rank_name }} Online{% endtrans %}</h3>
- <ul class="unstyled">
- {% for online in rank.online %}
- <li>
- <img src="{{ online.get_avatar(24) }}" alt="" class="avatar-small">
- <a href="{% url 'user' username=online.username_slug, user=online.pk %}">{{ online.username }}</a>
- {% if rank.title or online.title %}<span class="label">{% if online.title %}{{ online.title }}{% else %}{{ _(rank.title) }}{% endif %}</span>{% endif %}
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endif %}{% endfor %}
- </div>
- {% endif %}
- {% if popular_threads %}
- <div class="index-popular-threads">
- <h3>{% trans %}Popular Threads{% endtrans %}</h3>
- <ul class="unstyled">
- {% for thread in popular_threads %}
- <li>
- <a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}" class="index-popular-thread">{{ thread.name }}</a>
- <div class="muted"><a href="{% url 'forum' forum=thread.forum_id, slug=thread.forum_slug %}">{{ thread.forum_name }}</a> - {{ thread.last|reltimesince }}</div>
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endif %}
- <div class="index-stats">
- <ul class="unstyled">
- <li>
- <span class="tooltip-top" title="{% trans %}Posts{% endtrans %}"><i class="icon-comment"></i> {{ monitor.posts|int|intcomma }}</span>
- </li>
- <li>
- <span class="tooltip-top" title="{% trans %}Threads{% endtrans %}"><i class="icon-th-list"></i> {{ monitor.threads|int|intcomma }}</span>
- </li>
- <li>
- <span class="tooltip-top" title="{% trans %}Members{% endtrans %}"><i class="icon-user"></i> {{ monitor.users|int|intcomma }}</span>
- </li>
- <li>
- <span class="tooltip-top" title="{% trans %}Online{% endtrans %}"><i class="icon-map-marker"></i> {{ users_online|int|intcomma }}</span>
- </li>
- </ul>
- </div>
- {% if user.is_authenticated() %}
- <form action="{% url 'read_all' %}" method="post" class="index-forums-read-all">
- <input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}">
- <button type="submit" class="btn btn-link"><i class="icon-ok"></i> {% trans %}Mark forums read{% endtrans %}</button>
- </form>
- {% endif %}
- </div>
- </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 %}
|