Revision 333637343261 () - Diff

Link to this snippet: https://friendpaste.com/48ZT54oyb5HzY3f0Z6p47C
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% for child in attributes['node'].children:
% if child.tagname == 'author':
<img class="subst" src="http://cnd.faitmain.org/media/pen.png" />
<a href="/auteurs/${strip_accents(child.astext()).lower().replace(' ', '_')}.html">${child.astext()}</a>
% elif child.tagname == 'date':
nope
% else:
<%
name = child.children[0].astext()
value = child.children[1].astext()
%>
% if name == 'category':
<img class="subst" src="http://cnd.faitmain.org/media/info.png" />
<%
cats = ['<a href="/%s.html">%s</a>' % (cat, cat.capitalize())
for cat in value.split(',')]
%>
${' | '.join(cats)}
% elif name == 'level':
<img class="subst" src="http://cnd.faitmain.org/media/flash.png" />
<strong>Niveau</strong>: ${value.capitalize()}
% elif name == 'translator':
<img class="subst" src="http://cnd.faitmain.org/media/translation.png" />
author_id = strip_accents(value).lower().replace(' ', '_')
<strong>Traduction</strong>: <a href="/auteurs/${author_id}.html">${value}</a>
% endif
% endif
% endfor