annotate themes/default/static_blog.html @ 712:bf562fb9c273

server_side: use Jinja2 template engine for static blog
author souliane <souliane@mailoo.org>
date Mon, 13 Jul 2015 18:11:38 +0200
parents
children 916075bd0356
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
712
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
1 {#
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
2 Libervia: a Salut à Toi frontend
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
3 Copyright (C) 2011, 2012, 2013, 2014, 2015 Jérôme Poisson <goffi@goffi.org>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
4 Copyright (C) 2013, 2014, 2015 Adrien Cossa <souliane@mailoo.org>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
5
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
6
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
7 This program is free software: you can redistribute it and/or modify
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
8 it under the terms of the GNU Affero General Public License as published by
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
10 (at your option) any later version.
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
11
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
12 This program is distributed in the hope that it will be useful,
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
15 GNU Affero General Public License for more details.
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
16
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
17 You should have received a copy of the GNU Affero General Public License
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
19 #}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
20
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
21 {% macro message(entry) -%}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
22
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
23 <div class="mblog_entry {{ entry.style }}">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
24 {% if entry.type == "comment" %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
25 <div class="mblog_header">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
26 <div class="mblog_metadata">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
27 <div class="mblog_author">{{entry.author}}</div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
28 <div class="mblog_timestamp">{{entry.date}}</div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
29 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
30 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
31 {% else %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
32 <a href="{{entry.url}}" class="item_link">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
33 <div class="mblog_header mblog_header_main">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
34 <div class="mblog_metadata">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
35 <div class="mblog_author">{{entry.author}}</div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
36 <div class="mblog_timestamp">{{entry.date}}</div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
37 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
38 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
39 </a>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
40 {% endif %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
41 <span class="mblog_content">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
42 {% if entry.message_title %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
43 <h1><a href="{{entry.url}}" class="item_link">{{entry.title}}</a></h1>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
44 {% endif %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
45 {{entry.content}}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
46 </span>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
47 {% if entry.type == "main_item" %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
48 <a href="{{entry.url}}" class="item_link">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
49 <div class="mblog_footer mblog_footer_main">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
50 <div class="mblog_metadata">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
51 <div class="mblog_comments">{{ entry.comments_text }}</div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
52 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
53 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
54 </a>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
55 {% endif %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
56 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
57 {% if entry.all_comments_link %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
58 {{ link(entry.all_comments_link) }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
59 {% endif %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
60
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
61 {% for comment in entry.comments %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
62 {{ message(comment) }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
63 {% endfor %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
64
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
65 {%- endmacro %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
66
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
67 {% macro link(entry) -%}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
68 <a href="{{entry.url}}" class="{{entry.style}}">{{entry.text}}</a>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
69 {%- endmacro %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
70
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
71 {% macro image(entry) -%}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
72 <img src="{{entry.url}}" alt="{{entry.alt}}"/>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
73 {%- endmacro %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
74
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
75 <html>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
76 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
77 <meta name="keywords" content="{{keywords}}">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
78 <meta name="description" content="{{description}}">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
79 <link rel="alternate" type="application/atom+xml" href="{{base_url}}/atom.xml"/>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
80 <link rel='stylesheet' type="text/css" href='{{styles}}/blog.css'>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
81 <link rel="icon" type="image/png" href="{{favicon}}">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
82
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
83 <head profile="http://www.w3.org/2005/10/profile">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
84 <title>{{title}}</title>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
85 </head>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
86
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
87 <body>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
88 <div class="mblog_title"><a href="{{base_url}}">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
89 {{ image(banner_img) }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
90 {{ title }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
91 </a></div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
92
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
93 <div class="header">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
94 <div class="header_content">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
95 {{ link(navlinks.later_message) }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
96 {{ link(navlinks.later_messages) }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
97 {{ link(navlinks.older_message) }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
98 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
99 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
100
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
101 {% for entry in messages %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
102 {{ message(entry) }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
103 {% endfor %}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
104
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
105 <div class="footer">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
106 <div class="footer_content">
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
107 {{ link(navlinks.older_messages) }}
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
108 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
109 </div>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
110 </body>
bf562fb9c273 server_side: use Jinja2 template engine for static blog
souliane <souliane@mailoo.org>
parents:
diff changeset
111 </html>