123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- {% load humanize i18n misago_capture %}
- <ul class="list-group">
- {% for forum in forums %}
- <li class="list-group-item">
- {% if forum.role == 'redirect' %}
- <span class="forum-icon fa fa-link fa-fw tooltip-top" title="{% trans "Redirect forum" %}"></span>
- {% else %}
- <span class="forum-icon fa fa-comment{% if forum.is_read %}-o{% else %} new{% endif %} fa-fw tooltip-top" title="{% if forum.is_read %}{% trans "Forum has no new posts." %}{% else %}{% trans "Forum has new posts." %}{% endif %}"></span>
- {% endif %}
- <a href="{{ forum.get_absolute_url }}" class="item-title forum-name">{{ forum }}</a>
- <div class="sr-only forum-description">
- {% if forum.description %}
- {{ forum.description|linebreaks }}
- {% endif %}
- <ul class="list-unstyled">
- {% if forum.role == 'redirect' %}
- <li>
- {% trans "Clicks:" %} <strong>{{ forum.redirects|intcomma }}</strong>
- </li>
- {% elif forum.acl.can_browse %}
- <li>
- {% trans "Posts:" %} <strong>{{ forum.posts|intcomma }}</strong>
- </li>
- <li>
- {% trans "Threads:" %} <strong>{{ forum.threads|intcomma }}</strong>
- </li>
- {% else %}
- <li>
- {% trans "You don't have permission to browse this forum." %}
- </li>
- {% endif %}
- </ul>
- </div>
- <footer>
- {% if forum.role == 'redirect' %}
- <a href="{{ forum.get_absolute_url }}" class="item-title">{{ forum.redirect_host }}</a>
- <div class="text-muted">
- {% capture as clicks %}<strong>{{ forum.redirects|intcomma }}</strong>{% endcapture %}
- {% blocktrans trimmed with clicks=clicks|safe count counter=forum.redirects %}
- {{ clicks }} click
- {% plural %}
- {{ clicks }} clicks
- {% endblocktrans %}
- </div>
- {% elif forum.acl.can_browse %}
- {% if not forum.acl.can_see_all_threads %}
- <em class="text-muted">{% trans "Forum is private" %}</em>
- {% elif forum.last_thread_title %}
- <a href="{% url 'misago:thread_new' thread_slug=forum.last_thread_slug thread_id=forum.last_thread_id %}" class="item-title">{{ forum.last_thread_title }}</a>
- <div class="text-muted">
- {% capture trimmed as last_poster %}
- {% if forum.last_poster_id %}
- <a href="{% url USER_PROFILE_URL user_id=forum.last_poster_id user_slug=forum.last_poster_slug %}" class="item-title">{{ forum.last_poster_name }}</a>
- {% else %}
- <strong class="item-title">{{ forum.last_poster_name }}</strong>
- {% endif %}
- {% endcapture %}
- {% capture trimmed as last_post %}
- <abbr class="tooltip-top dynamic time-ago" title="{{ forum.last_post_on }}" data-timestamp="{{ forum.last_post_on|date:"c" }}">
- {{ forum.last_post_on|date }}
- </abbr>
- {% endcapture %}
- {% blocktrans trimmed with last_poster=last_poster|safe last_post=last_post|safe %}
- {{ last_poster }}, {{ last_post }}
- {% endblocktrans %}
- </div>
- {% else %}
- <em class="text-muted">{% trans "Forum is empty" %}</em>
- {% endif %}
- {% else %}
- <em class="text-muted">{% trans "Can't be browsed" %}</em>
- {% endif %}
- </footer>
- {% if forum.subforums %}
- <div class="dropdown pull-right">
- <button class="btn btn-default btn-sm dropdown-toggle tooltip-top" title="{% trans "Subforums list" %}" type="button" id="dropdownMenu1" data-toggle="dropdown">
- <span class="fa fa-reorder fa-lg"></span>
- </button>
- <ul class="dropdown-menu scrollable" role="menu" aria-labelledby="dropdownMenu1">
- {% for subforum in forum.subforums %}
- <li role="presentation">
- <a role="menuitem" tabindex="-1" href="{{ subforum.get_absolute_url }}">
- {% if subforum.role == 'redirect' %}
- <span class="forum-icon fa fa-link fa-fw"></span>
- {% else %}
- <span class="forum-icon fa fa-comment{% if subforum.is_read %}-o{% else %} new{% endif %} fa-fw "></span>
- {% endif %}
- {{ subforum }}
- </a>
- </li>
- {% endfor %}
- </ul>
- </div>
- {% endif %}
- </li>
- {% endfor %}
- </ul>
|