summaryrefslogtreecommitdiff
path: root/project/templates/tags.xhtml
blob: f92c82275d7294d2385fff48838fc6662a86545b (plain)
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
29
30
31
32
33
34
35
36
37
38

{%- extends "base_plain.xhtml" -%}



{%- block title -%}Tags{%- endblock -%}



{%- block footer -%}{{ plain_footer ("tags.xhtml") }}{%- endblock -%}



{%- block style %}
    <link href="/css/tags.css" rel="stylesheet" />
{% endblock -%}



{%- block content %}
<h4>Tags</h4>

<ul>
    {%- for tag in tags -%}
        {%- set total = { 'value': 0 } -%}
        {%- for item in articles -%}
            {%- if tag in item.taglist -%}
                {%- if total.update({'value': total.value + 1}) -%}{%- endif -%}
            {%- endif -%}
            {%- if item == articles | last %}
    <li><a href="/tags/{{ tag }}.xhtml">{{ tag }} ({{ total.value }})</a></li>
            {%- endif -%}
        {%- endfor -%}
    {%- endfor %}
</ul>
{% endblock -%}