list.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {% extends "sora/layout.html" %}
  2. {% load i18n %}
  3. {% load url from future %}
  4. {% import "sora/macros.html" as macros with context %}
  5. {% block title %}{{ macros.page_title(title=forum.name,page=pagination['page']) }}{% endblock %}
  6. {% block breadcrumb %}{{ super() }} <span class="divider">/</span></li>
  7. {% for parent in parents %}
  8. <li class="first"><a href="{{ parent.type|url(forum=forum.pk, slug=forum.slug) }}">{{ parent.name }}</a> <span class="divider">/</span></li>
  9. {% endfor %}
  10. <li class="active">{{ forum.name }}
  11. {%- endblock %}
  12. {% block content %}
  13. <div class="page-header">
  14. <ul class="breadcrumb">
  15. {{ self.breadcrumb() }}</li>
  16. </ul>
  17. <h1>{{ forum.name }}{% if forum.description %} <small>{{ forum.description }}</small>{% endif %}</h1>
  18. </div>
  19. {% if forum.subforums %}
  20. <div class="forums-list subforums-list">
  21. <h3>{% trans %}Subforums{% endtrans %}:</h3>
  22. <div class="category{% if forum.style %} {{ forum.style }}{% endif %}">
  23. {{ macros.draw_forums(forum, 12) }}
  24. </div>
  25. </div>
  26. {% endif %}
  27. {% if message %}{{ macros.draw_message(message) }}{% endif %}
  28. <div class="list-nav">
  29. {{ pager() }}
  30. {% if user.is_authenticated() and acl.threads.can_start_threads(forum) %}
  31. <ul class="nav nav-pills pull-right">
  32. <li class="primary"><a href="{% url 'thread_new' forum=forum.pk, slug=forum.slug %}"><i class="icon-plus"></i> {% trans %}New Thread{% endtrans %}</a></li>
  33. </ul>
  34. {% endif %}
  35. </div>
  36. <table class="table table-striped threads-list">
  37. <thead>
  38. <tr>
  39. <th style="width: 1%;">&nbsp;</th>
  40. <th>{% trans %}Thread{% endtrans %}</th>
  41. <th>{% trans %}Author{% endtrans %}</th>
  42. <th>{% trans %}Replies{% endtrans %}</th>
  43. <th>{% trans %}Last Poster{% endtrans %}</th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. {% for thread in threads %}
  48. <tr>
  49. <td><span class="thread-icon{% if not thread.is_read %} {% if thread.closed %}thread-closed{% else %}thread-new{% endif %}{% endif %}"><i class="icon-{% if thread.closed %}remove{% else %}comment{% endif %} icon-white"></i></span></td>
  50. <td>
  51. <a href="{% url 'thread' thread=thread.pk, slug=thread.slug %}">{% if not thread.is_read %}<strong>{{ thread.name }}</strong>{% else %}{{ thread.name }}{% endif %}</a>[LABELS][JUMP] [ICONS]
  52. </td>
  53. <td class="span2">{% if thread.start_poster_id %}<a href="{% url 'user' user=thread.start_poster_id, username=thread.start_poster_slug %}" class="tooltip-top" title="{{ thread.start|reltimesince }}">{{ thread.start_poster_name }}</a>{% else %}<em class="tooltip-top muted" title="{{ thread.start|reltimesince }}">{{ thread.start_poster_name }}</em>{% endif %}</td>
  54. <td class="span1">{{ thread.replies|intcomma }}</td>
  55. <td class="span2">{% if thread.last_poster_id %}<a href="{% url 'user' user=thread.last_poster_id, username=thread.last_poster_slug %}" class="tooltip-top" title="{{ thread.last|reltimesince }}">{{ thread.last_poster_name }}</a>{% else %}<em class="tooltip-top muted" title="{{ thread.last|reltimesince }}">{{ thread.last_poster_name }}</em>{% endif %}</td>
  56. </tr>
  57. {% endfor %}
  58. </tbody>
  59. </table>
  60. <div class="form-actions table-footer">
  61. [MOD ACTIONS]
  62. </div>
  63. <div class="list-nav last">
  64. {{ pager() }}
  65. {% if user.is_authenticated() and acl.threads.can_start_threads(forum) %}
  66. <ul class="nav nav-pills pull-right">
  67. <li class="primary"><a href="{% url 'thread_new' forum=forum.pk, slug=forum.slug %}"><i class="icon-plus"></i> {% trans %}New Thread{% endtrans %}</a></li>
  68. </ul>
  69. {% endif %}
  70. </div>
  71. {% endblock %}
  72. {% macro pager() %}
  73. <ul class="pager pull-left">
  74. {%- if pagination['prev'] > 1 %}<li><a href="{% url 'forum' slug=forum.slug, forum=forum.id %}" class="tooltip-top" title="{% trans %}First Page{% endtrans %}"><i class="icon-chevron-left"></i> {% trans %}First{% endtrans %}</a></li>{% endif -%}
  75. {%- if pagination['prev'] > 0 %}<li><a href="{%- if pagination['prev'] > 1 %}{% url 'forum' slug=forum.slug, forum=forum.id, page=pagination['prev'] %}{% else %}{% url 'forum' slug=forum.slug, forum=forum.id %}{% endif %}" class="tooltip-top" title="{% trans %}Newest Threads{% endtrans %}"><i class="icon-chevron-left"></i></a></li>{% endif -%}
  76. {%- if pagination['next'] > 0 %}<li><a href="{% url 'forum' slug=forum.slug, forum=forum.id, page=pagination['next'] %}" class="tooltip-top" title="{% trans %}Older Threads{% endtrans %}"><i class="icon-chevron-right"></i></a></li>{% endif -%}
  77. <li class="count">
  78. {%- trans current_page=pagination['page'], pages=pagination['total'] -%}
  79. Page {{ current_page }} of {{ pages }}
  80. {%- endtrans -%}
  81. </li>
  82. </ul>
  83. {% endmacro %}