123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- {% 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 id="forum-{{ forum.id }}" class="forum-main">
- <h3 class="forum-title{% if not forum.is_read %} forum-title-new{% endif %}"><a href="{{ forum.type|url(slug=forum.slug, forum=forum.id) }}">{{ forum.name }}</a></h3>
- {% if forum.show_details and forum.type != 'redirect' %}
- <div class="forum-details">
- {% if acl.forums.can_browse(forum) and (acl.threads.can_read_threads(forum) == 2 or (acl.threads.can_read_threads(forum) == 1 and forum.last_poster_id == user.pk)) %}
- {% if forum.last_thread_id -%}
- {% trans %}Latest{% endtrans %}: <a href="{% url 'thread_new' thread=forum.last_thread_id, slug=forum.last_thread_slug %}" class="tooltip-top" title="{{ forum.last_thread_name }}">{{ forum.last_thread_name|short_string(28) }}</a>
- {%- else -%}
- <em>{% trans %}This forum is empty{% endtrans %}</em>
- {%- endif %}
- {%- else -%}
- <em>{% trans %}This forum is protected{% endtrans %}</em>
- {%- endif %}
- </div>
- {% endif %}
- <div class="hide forum-meta">
- {% if forum.description %}<p class="forum-description">{{ forum.description }}</p>{% endif %}
- <div class="forum-stats">
- {% if forum.type != 'redirect' %}
- <span>{% trans %}Posts{% endtrans %}: <strong>{{ forum.posts|intcomma }}</strong></span>
- {% trans %}Threads{% endtrans %}: <strong>{{ forum.threads|intcomma }}</strong>
- {% else %}
- {% trans %}Clicks{% endtrans %}: <strong>{{ forum.redirects|intcomma }}</strong>
- {% endif %}
- </div>
- </div>
- </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|short_string(38) }}</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 %}
- {% block javascripts -%}{{ super() }}
- <script type="text/javascript">
- $(function () {
- function populateForumTooltip(target) {
- return $('#forum-' + target + ' .forum-meta').html();
- };
- {% for category in forums_list %}{% for forum in category.subforums %}
- $('#forum-{{ forum.id }} .forum-title').tooltip({
- template: '<div class="tooltip forum-meta-tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
- placement: 'right',
- html: true,
- title: populateForumTooltip({{ forum.id }})
- });
- {% endfor %}{% endfor %}
- });
- </script>
- {%- endblock %}
|