forum.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. {% extends "misago/threads/base.html" %}
  2. {% load i18n misago_stringutils %}
  3. {% block title %}{{ forum }}{% if page.number > 1 %} ({% blocktrans with page=page.number %}Page {{ page }}{% endblocktrans %}){% endif %} | {{ block.super }}{% endblock title %}
  4. {% block meta-description %}{{ forum.description|striplinebreaks }}{% endblock meta-description %}
  5. {% block content %}
  6. <div{% if forum.css %} class="page-{{ forum.css_class }}"{% endif %}>
  7. <div class="page-header">
  8. <div class="container">
  9. {% if path %}
  10. <ol class="breadcrumb">
  11. {% for crumb in path|slice:":-1" %}
  12. <li>
  13. <a href="{{ crumb.get_absolute_url }}">{{ crumb }}</a>{% if not forloop.last %}<span class="fa fa-chevron-right"></span>{% endif %}
  14. </li>
  15. {% endfor %}
  16. </ol>
  17. {% endif %}
  18. <h1>{{ forum }}</h1>
  19. </div>
  20. </div>
  21. {{ block.super }}
  22. </div>
  23. {% endblock content %}
  24. {% block threads-list %}
  25. {% if forum.description %}
  26. <div class="lead">
  27. {{ forum.description|escape|urlize|linebreaks }}
  28. </div>
  29. {% endif %}
  30. {% if forum.subforums %}
  31. {% include "misago/forums/subforums.html" with category=forum %}
  32. {% endif %}
  33. {{ block.super }}
  34. {% endblock threads-list %}
  35. {% block threads-panel %}
  36. <div class="table-actions">
  37. {% include "misago/threads/paginator.html" %}
  38. {% if user.is_authenticated %}
  39. {% include "misago/threads/sort.html" %}
  40. {% include "misago/threads/show.html" %}
  41. {% endif %}
  42. {% if threads_actions %}
  43. {% include "misago/threads/actions.html" %}
  44. {% endif %}
  45. {% include "misago/threads/start_btn.html" %}
  46. </div>
  47. {{ block.super }}
  48. <div class="table-actions">
  49. {% include "misago/threads/paginator.html" %}
  50. {% include "misago/threads/start_btn.html" %}
  51. {% if not forum.is_read and user.is_authenticated %}
  52. <form action="{% url 'misago:read_forum' forum_id=forum.id %}" method="POST" class="pull-right">
  53. {% csrf_token %}
  54. <button type="submit" class="btn btn-default">
  55. <span class="fa fa-circle-o fa-fw"></span>
  56. {% trans "Mark threads as read" %}
  57. </button>
  58. </form>
  59. {% endif %}
  60. </div>
  61. {% endblock threads-panel %}
  62. {% block no-threads %}
  63. {% if filtering.is_active %}
  64. {% trans "No threads matching criteria exist, or you don't have permission to see them." %}
  65. <a href="{{ forum.get_absolute_url }}" class="btn btn-primary">
  66. {% trans "See all threads" %}
  67. </a>
  68. {% else %}
  69. {% trans "No threads were posted in this forum, or you don't have permission to see them." %}
  70. {% endif %}
  71. {% endblock no-threads %}
  72. {% block javascripts %}
  73. {{ block.super }}
  74. {% include "misago/forums/js.html" %}
  75. {% if threads_actions %}
  76. {% include "misago/threads/actions_js.html" %}
  77. {% endif %}
  78. {% if forum.acl.can_start_threads %}
  79. <script lang="JavaScript">
  80. $(function() {
  81. $('.btn-reply').click(function() {
  82. var $btn = $(this);
  83. Misago.Posting.load({
  84. api_url: "{% url 'misago:start_thread' forum_id=forum.id %}"
  85. });
  86. });
  87. });
  88. </script>
  89. {% endif %}
  90. {% endblock javascripts %}