article.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. {% extends "base.html" %}
  2. {% block title %}
  3. {{ article.title }} - {{ super() }}
  4. {% endblock title %}
  5. {% block content %}
  6. <script language="javascript" type="text/javascript">
  7. function moveTOC() {
  8. var table_of_contents = document.getElementById('contents');
  9. var toc_sidebar = document.getElementById('toc_sidebar');
  10. if (table_of_contents && toc_sidebar)
  11. toc_sidebar.appendChild(table_of_contents);
  12. }
  13. </script>
  14. <div class="row-fluid">
  15. <header class="page_header span7 offset3">
  16. <h1> {{ article.title }} <small> {%if article.subtext %} {{ article.subtext }} {% endif %} </small></h1>
  17. </header>
  18. </div>
  19. <div class="row-fluid">
  20. <div class="span3" id="toc_sidebar">
  21. </div>
  22. <div class="span7">
  23. {{ article.content }}
  24. </div>
  25. <div class="span2">
  26. <div class="row-fluid">
  27. <div class="span12">
  28. <p>
  29. {% set day = article.date.strftime('%d')|int %}
  30. {% set suffix = ['st', 'nd', 'rd', 'th'] %}
  31. {{ article.date.strftime('%b') }} {{ day }}
  32. {%- if 4 <= day <= 20 or 24 <= day <= 30 -%} {{ suffix[3] }}
  33. {%- elif day % 10 - 1 == 0 -%} {{ suffix[0] }}
  34. {%- elif day % 10 - 1 == 1 -%} {{ suffix[1] }}
  35. {%- elif day % 10 - 1 == 2 -%} {{ suffix[2] }}
  36. {%- endif -%}
  37. {{ article.date.strftime(', %Y') }}
  38. </p>
  39. <p>
  40. Published by <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a> in <a href="{{ SITEURL }}/categories.html#collapse{{ category|replace(' ', '_')|e }}" "{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
  41. </p>
  42. {% if article.modified %}
  43. <p>Updated on {{ article.modified }}
  44. </p>
  45. {% endif %}
  46. </div>
  47. </div>
  48. <div class="row-fluid">
  49. <div class="span12">
  50. {% if article.tags %}
  51. <p>Tags:
  52. <ul>
  53. {% for tag in article.tags %}
  54. <li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}
  55. {% for aTag, tagged_articles in tags if aTag == tag %}
  56. {{ tagged_articles|count }}
  57. {% endfor %}</a></li>
  58. {% endfor %}
  59. </ul>
  60. </p>
  61. {% endif %}
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <script type="text/javascript" language="JavaScript">
  67. moveTOC();
  68. </script>
  69. {% endblock content %}