aboutsummaryrefslogtreecommitdiff
path: root/src/web/templates/categories.html
blob: 4985e0ca1900147505010aa2100a7b75a63a1165 (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
{% extends "layout.html" %}
{% block content %}
<div class="container">
    <h1>{{ _("You have %(categories)d categories &middot; Add a %(start_link)scategory%(end_link)s", categories=categories|count, start_link=("<a href='%s'>" % url_for("category.form"))|safe, end_link="</a>"|safe) }}</h1>
    {% if categories|count == 0 %}
        <h1>{{_("No category")}}</h1>
    {% else %}
    <div class="table-responsive">
        <table class="table table-striped">
            <thead>
                <tr>
                    <th>#</th>
                    <th>{{ _('Name') }}</th>
                    <th>{{ _('Feeds') }}</th>
                    <th>{{ _('Articles') }}</th>
                    <th>{{ _('Actions') }}</th>
                </tr>
            </thead>
            <tbody>
            {% for category in categories %}
                <tr>
                    <td>{{ loop.index }}</td>
                    <td>{{ category.name }}</td>
                    <td>{{ feeds_count.get(category.id, 0) }}</td>
                    <td>( {{ unread_article_count.get(category.id, 0) }} ) {{ article_count.get(category.id, 0) }}</td>
                    <td>
                        <a href="{{ url_for("category.form", category_id=category.id) }}"><i class="glyphicon glyphicon-edit" title='{{ _("Edit this category") }}'></i></a>
                        <a href="{{ url_for("category.delete", category_id=category.id) }}"><i class="glyphicon glyphicon-remove" title='{{ _("Delete this category") }}' onclick="return confirm('{{ _('You are going to delete this category.') }}');"></i></a>
                    </td>
            </tr>
            {% endfor %}
            </tbody>
        </table>
    </div>
    {% endif %}
{% endblock %}
bgstack15