category.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {% extends "cranefly/layout.html" %}
  2. {% load i18n %}
  3. {% load url from future %}
  4. {% import "cranefly/macros.html" as macros with context %}
  5. {% block title %}{{ macros.page_title(title=category.name) }}{% endblock %}
  6. {% block breadcrumb %}{{ super() }} <span class="divider"><i class="icon-chevron-right"></i></span></li>
  7. {% for parent in parents %}
  8. <li><a href="{{ parent.type|url(forum=parent.pk, slug=parent.slug) }}">{{ parent.name }}</a> <span class="divider"><i class="icon-chevron-right"></i></span></li>
  9. {% endfor %}
  10. <li class="active">{{ category.name }}
  11. {%- endblock %}
  12. {% block container %}
  13. <div class="page-header header-primary">
  14. <div class="container">
  15. {% if messages %}
  16. <div class="messages-list">
  17. {{ messages_list(messages) }}
  18. </div>
  19. {% endif %}
  20. <ul class="breadcrumb">
  21. {{ self.breadcrumb() }}</li>
  22. </ul>
  23. <h1>{{ category.name }}</h1>
  24. </div>
  25. </div>
  26. <div class="container container-primary">
  27. {% if category.description %}
  28. <div class="markdown lead page-description">
  29. {{ category.description_preparsed|markdown_final|safe }}
  30. </div>
  31. {% endif %}
  32. {% if category.subforums %}
  33. <div class="category-forums-list{% if category.style %} category-forums-{{ category.style }}{% endif %}">
  34. <table class="table">
  35. <tbody>
  36. {% for forum in category.subforums %}
  37. <tr>
  38. <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>
  39. <td class="forum-main">
  40. <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>
  41. {% if forum.show_details %}
  42. <div class="forum-details">
  43. {% if forum.type == 'redirect' %}
  44. <span class="label{% if forum.redirects_delta < forum.redirects %} label-success{% endif %}">{{ forum.redirects|intcomma }}</span> {% trans %}Clicks{% endtrans %}
  45. {% else %}
  46. <span class="label{% if forum.posts_delta < forum.posts %} label-success{% endif %}">{{ forum.posts|intcomma }}</span> {% trans %}Posts{% endtrans %}
  47. {% endif %}
  48. </div>
  49. {% endif %}
  50. {% if forum.description %}<p class="forum-description">{{ forum.description }}</p>{% endif %}
  51. </td>
  52. </tr>
  53. {% endfor %}
  54. </tbody>
  55. </table>
  56. </div>
  57. {% else %}
  58. <p class="lead">{% trans %}Looks like there are no forums to display in this category.{% endtrans %}</p>
  59. {% endif %}
  60. </div>
  61. {% endblock %}
  62. {% block content %}
  63. <div class="page-header">
  64. <ul class="breadcrumb">
  65. {{ self.breadcrumb() }}</li>
  66. </ul>
  67. <h1>{{ category.name }}{% if category.description %}<br><small>{{ category.description }}</small>{% endif %}</h1>
  68. </div>
  69. {% if category.subforums %}
  70. <div class="forums-list">
  71. <div class="category{% if category.style %} {{ category.style }}{% endif %}">
  72. {{ macros.draw_forums(category, 12) }}
  73. </div>
  74. </div>
  75. {% else %}
  76. <p class="lead">{% trans %}Looks like there are no forums to display in this category.{% endtrans %}</p>
  77. {% endif %}
  78. {% endblock %}