Parcourir la source

More template refactoring

jherve il y a 1 an
Parent
commit
a52c3763ec
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      templates/site_main_article_detail.html

+ 5 - 1
templates/site_main_article_detail.html

@@ -7,8 +7,12 @@
     <link href="{{ url_for('static', path='/style.css') }}" rel="stylesheet">
 </head>
 <body>
+    {% macro url_to_article_page(a) -%}
+        {{ url_for('site_main_article_snapshot', id=a['site_id'], timestamp=a['timestamp_virtual']) }}
+    {%- endmacro %}
+
     {% macro article(a) -%}
-        <a href="{{ url_for('site_main_article_snapshot', id=a['site_id'], timestamp=a['timestamp_virtual']) }}">
+        <a href="{{ url_to_article_page(a) }}">
             {{ ui.logo(a["site_name"]) }} {{ a["title"] }}
         </a>
     {%- endmacro %}