archives.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {% extends "base.html" %}
  2. {% block head %}
  3. {% block title %}
  4. <title>{{ _('Archivos de %(sitename)s', sitename=SITENAME) }}</title>
  5. {% endblock %}
  6. {{ super() }}
  7. {% block seo %}
  8. <meta name="description" content="{{ _('Lista de artículos publicados en %(sitename)s', sitename=SITENAME) }}"/>
  9. <meta name="keywords" content="{{ _('archivos,artículos,historia,lista de artículos') }}"/>
  10. <style>
  11. .content ul, .content ul ul, .content ul ul ul {
  12. list-style:none !important;
  13. }
  14. .content ul {
  15. margin-left: 0px !important;
  16. }
  17. .contenedor-arbol, .contenedor-arbol ul, .contenedor-arbol li {
  18. position: relative;
  19. margin: 0;
  20. padding-left: 2%;
  21. line-height: normal;
  22. }
  23. .contenedor-arbol ul {
  24. list-style: none;
  25. }
  26. .contenedor-arbol li::before, .contenedor-arbol li::after {
  27. content: "";
  28. position: absolute;
  29. left: -12px;
  30. }
  31. .contenedor-arbol li::before {
  32. border-top: 2px solid #000;
  33. top: 9px;
  34. width: 12px;
  35. height: 0;
  36. }
  37. .contenedor-arbol li::after {
  38. border-left: 2px solid black;
  39. height: 100%;
  40. width: 0px;
  41. top: 2px;
  42. }
  43. .contenedor-arbol ul > li:last-child::after {
  44. height: 8px;
  45. }
  46. </style>
  47. {% endblock %}
  48. {% endblock %}
  49. {% block content %}
  50. <!-- Main -->
  51. <div class="row mt-6 mt-10">
  52. <div class="col-md-9 mx-auto text-justify">
  53. <!-- dinamic page content -->
  54. <div class="contenedor-arbol ml-3">
  55. <p>{{ ngettext('%(num)d artículo', '%(num)d artículos', dates|length) }}</p>
  56. <ul>
  57. {% for article in dates %}
  58. {% set current_year = article.date|strftime('%Y') %}
  59. {% set current_month = article.date|strftime('%m') %}
  60. {% if loop.previtem %}
  61. {% set previous_year = loop.previtem.date|strftime('%Y') %}
  62. {% set previous_month = loop.previtem.date|strftime('%m') %}
  63. {% endif %}
  64. {% if current_year != previous_year %}
  65. {% if loop.previtem %}
  66. </ul>
  67. </li> <!-- Cierra el mes -->
  68. </ul>
  69. </li> <!-- Cierra el año -->
  70. {% endif %}
  71. <li><a href="{{ SITEURL }}/archives/{{ current_year }}/">{{ current_year }}</a>
  72. <ul>
  73. <li><a href="{{ SITEURL }}/archives/{{ current_year }}/{{ current_month }}/">{{ article.date|strftime('%B') }}</a>
  74. <ul>
  75. {% elif current_month != previous_month %}
  76. {% if loop.previtem %}
  77. </ul>
  78. </li>
  79. {% endif %}
  80. <li><a href="{{ SITEURL }}/archives/{{ current_year }}/{{ current_month }}/">{{ article.date|strftime('%B') }}</a>
  81. <ul>
  82. {% endif %}
  83. <li><a href="{{ SITEURL }}/{{ article.url }}" title="{{ article.locale_date}}">{{ article.title }}</a></li>
  84. {% if loop.last %}
  85. </ul>
  86. </li> <!-- Cierra el mes -->
  87. </ul>
  88. </li> <!-- Cierra el año -->
  89. {% endif %}
  90. {% endfor %}
  91. </ul>
  92. </div>
  93. <!-- End dinamic page content -->
  94. </div>
  95. </div>
  96. <!-- End Main -->
  97. {% endblock %}