categories.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {% extends "base.html" %}
  2. {% block title %}
  3. All Categories · {{ super() }}
  4. {% endblock title %}
  5. {% block head_description %}
  6. All categories of the {{ SITENAME|striptags }} blog.
  7. {% endblock head_description %}
  8. {% block content %}
  9. <div class="row-fluid">
  10. <header class="page_header span10 offset2">
  11. <h1><a href="/categories.html">All Categories</a></h1>
  12. </header>
  13. </div>
  14. <div class="row-fluid">
  15. <div class="span8 offset2">
  16. <div class="accordion" id="accordion2">
  17. {% for category, articles in categories %}
  18. <div class="accordion-group">
  19. <div class="accordion-heading">
  20. <a class="accordion-toggle list-of-categories" data-toggle="collapse" data-parent="#accordion2" href="#{{ category|replace(' ', '-')|e }}-ref">
  21. {% set num = articles|count %}
  22. {{ category }}<span>{{ num }}</span>
  23. </a>
  24. </div>
  25. <div id="{{ category|replace(' ', '-')|e }}-ref" class="accordion-body collapse">
  26. <div class="accordion-inner">
  27. <ul class="list-articles-category">
  28. {% for article in articles %}
  29. <li><span><time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time></span> <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }} {%if article.subtitle %} <small> {{ article.subtitle }} </small> {% endif %} </a></li>
  30. {% endfor %}
  31. </ul>
  32. </div>
  33. </div>
  34. </div>
  35. {% endfor %}
  36. </div>
  37. </div>
  38. </div>
  39. {% endblock content %}
  40. {% block script %}
  41. {{ super() }}
  42. <script language="javascript" type="text/javascript">
  43. function uncollapse() {
  44. $(window.location.hash).collapse({
  45. toggle: true
  46. })
  47. }
  48. </script>
  49. <script type="text/javascript" language="JavaScript">
  50. uncollapse();
  51. </script>
  52. {% endblock script %}