summaryrefslogtreecommitdiff
path: root/project/templates/tags.xhtml
blob: b9e835ae31054b0dcb8b5502dc8b5a0a8c392c88 (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

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



{%- block title -%}Tags{%- 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 -%}