categories.html 1.7 KB

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