article.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {% extends "base.html" %}
  2. {% block title %}
  3. hell {{ 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 %d') }}
  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 }}/{{ article.category.url }}">{{ article.category }}</a>
  41. </p>
  42. </div>
  43. </div>
  44. <div class="row-fluid">
  45. <div class="span12">
  46. {% if article.tags %}
  47. <p>Tags:
  48. <ul>
  49. {% for tag in article.tags %}
  50. <li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}
  51. {% for aTag, tagged_articles in tags if aTag == tag %}
  52. {{ tagged_articles|count }}
  53. {% endfor %}</a></li>
  54. {% endfor %}
  55. </ul>
  56. </p>
  57. {% endif %}
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <script type="text/javascript" language="JavaScript">
  63. moveTOC();
  64. </script>
  65. {% endblock content %}