archives.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. <?php
  53. if(isset($_SERVER['HTTPS'])) {
  54. if ($_SERVER['HTTPS'] == "on") {
  55. $examen = "https://{$_SERVER['HTTP_HOST']}/examen";
  56. }
  57. else {
  58. $examen = "examen";
  59. }
  60. }
  61. echo "<div class='col-sm'><div class='d-flex justify-content-center'><a href='{$examen}'>Examen</a></div></div>";
  62. include_once('../php-personal/index.php');
  63. $isCookied = isset($_COOKIE['identify'], $_COOKIE['hash']);
  64. $isIdentify = false;
  65. if ($isCookied) {
  66. //index properties
  67. $post = new Post($db);
  68. $post->identify = $_COOKIE['identify'];
  69. $post->hash = $_COOKIE['hash'];
  70. $isIdentify = $post->identify();
  71. if (!$isIdentify) {
  72. echo '<div class="col-sm"><div class="d-flex justify-content-center"><a href="php-personal/frontend/users">Identificarse</a></div></div>';
  73. return;
  74. }
  75. }
  76. if (!$isCookied) {
  77. echo '<div class="col-sm"><div class="d-flex justify-content-center"><a href="php-personal/frontend/users">Identificarse</a></div></div>';
  78. return;
  79. }
  80. ?>
  81. <div class="col-md-9 mx-auto text-justify">
  82. <!-- dinamic page content -->
  83. <div class="contenedor-arbol ml-3">
  84. <p>{{ ngettext('%(num)d artículo', '%(num)d artículos', dates|length) }}</p>
  85. <ul>
  86. {% for article in dates %}
  87. {% set current_year = article.date|strftime('%Y') %}
  88. {% set current_month = article.date|strftime('%m') %}
  89. {% if loop.previtem %}
  90. {% set previous_year = loop.previtem.date|strftime('%Y') %}
  91. {% set previous_month = loop.previtem.date|strftime('%m') %}
  92. {% endif %}
  93. {% if current_year != previous_year %}
  94. {% if loop.previtem %}
  95. </ul>
  96. </li> <!-- Cierra el mes -->
  97. </ul>
  98. </li> <!-- Cierra el año -->
  99. {% endif %}
  100. <li><a href="{{ SITEURL }}/archives/{{ current_year }}/">{{ current_year }}</a>
  101. <ul>
  102. <li><a href="{{ SITEURL }}/archives/{{ current_year }}/{{ current_month }}/">{{ article.date|strftime('%B') }}</a>
  103. <ul>
  104. {% elif current_month != previous_month %}
  105. {% if loop.previtem %}
  106. </ul>
  107. </li>
  108. {% endif %}
  109. <li><a href="{{ SITEURL }}/archives/{{ current_year }}/{{ current_month }}/">{{ article.date|strftime('%B') }}</a>
  110. <ul>
  111. {% endif %}
  112. <li><a href="{{ SITEURL }}/{{ article.url }}" title="{{ article.locale_date}}">{{ article.title }}</a></li>
  113. {% if loop.last %}
  114. </ul>
  115. </li> <!-- Cierra el mes -->
  116. </ul>
  117. </li> <!-- Cierra el año -->
  118. {% endif %}
  119. {% endfor %}
  120. </ul>
  121. </div>
  122. <!-- End dinamic page content -->
  123. </div>
  124. </div>
  125. <!-- End Main -->
  126. {% endblock %}