[Tests] track coverage of templates
[mygpo.git] / mygpo / web / templates / devicelist.html
blobb55158434b78906029ef9db48da0fa657bc93e78
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load humanize %}
4 {% load devices %}
6 {% load menu %}
7 {% block mainmenu %}{{ "/devices/"|main_menu }}{% endblock %}
8 {% block sectionmenu %}{{ "/devices/"|section_menu }}{% endblock %}
10 {% block title %}{% trans "Managed Devices" %}{% endblock %}
12 {% block header %}
13 <h1>{% trans "Managed Devices" %}</h1>
14 {% endblock %}
16 {% block content %}
18 <form class="form-inline" action="{% url "device-create" %}" method="POST">
19 {% csrf_token %}
21 <table class="list">
22 <tr>
23 <th>{% trans "Name" %}</th>
24 <th>{% trans "Type" %}</th>
25 <th>{% trans "Device ID" %}</th>
26 <th class="buttons">{% trans "Configure" %}</th>
27 </tr>
28 {% for group in device_groups %}
29 <tr>
30 {% if group.is_synced %}
31 <th class="group" colspan="4">{% trans "Synchronized" %}</th>
32 {% else %}
33 <th class="group" colspan="4">{% trans "Not Synchronized" %}</th>
34 {% endif %}
35 </tr>
37 {% for device in group.devices %}
38 <tr>
39 <td><a href="{% url "device" device.uid %}">{{ device|device_icon }}{{ device.name|striptags }}</a></td>
40 <td>{{ device|device_type }}</td>
41 <td>{{ device.uid|striptags }}</td>
42 <td>
43 <a class="btn btn-default btn-sm" href="{% url "device-edit" device.uid %}">
44 <i class="icon-edit"></i>
45 {% trans "Configure" %}
46 </a>
47 </td>
48 </tr>
49 {% endfor %}
50 {% empty %}
51 <tr>
52 <td colspan="4">
53 {% blocktrans %}You don't have any devices yet. Go to the <a href="http://wiki.gpodder.org/wiki/Web_Services/Clients">clients</a> page to learn how to set up your client applications.{% endblocktrans %}
54 </td>
55 </tr>
56 {% endfor %}
57 <tr class="nohighlight">
58 <td>{{ device_form.name }}</td>
59 <td>{{ device_form.type }}</td>
60 <td>{{ device_form.uid }}</td>
61 <td>
62 <button class="btn btn-success btn-sm" type="submit">
63 <i class="icon-plus"></i>
64 {% trans "Create" %}
65 </button>
66 </td>
67 </tr>
68 </table>
70 </form>
73 {% if deleted_devices %}
74 <h2>{% trans "Deleted Devices" %}</h2>
75 <table class="list">
76 {% for d in deleted_devices %}
77 <tr>
78 <td><a href="{% url "device" d.uid %}">{{ d|device_icon }}{{ d.name|striptags }}</a></td>
79 <td>{{ d|device_type }}</td>
80 <td>{{ d.uid|striptags }}</td>
81 <td>
82 <form method="post" action="{% url "device-undelete" d.uid %}">
83 {% csrf_token %}
84 <button class="btn btn-default btn-sm" type="submit">
85 <i class="icon-repeat"></i> {% trans "Reactivate" %}
86 </button>
87 </form>
88 </td>
89 <td>
90 <form method="post" action="{% url "device-delete-permanently" d.uid %}">
91 {% csrf_token %}
92 <button class="btn btn-danger btn-sm" type="submit">
93 <i class="icon-trash"></i> {% trans "Delete Permanently" %}
94 </button>
95 </form>
96 </td>
98 </tr>
99 {% endfor %}
100 </table>
101 {% endif %}
103 {% endblock %}