[Web] add missing csrf-token
[mygpo.git] / mygpo / web / templates / device.html
blob55da46951def303c419537b20b62afd715bf0c93
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load humanize %}
4 {% load devices %}
5 {% load podcasts %}
7 {% load menu %}
8 {% block mainmenu %}{{ "/device/"|main_menu }}{% endblock %}
9 {% block sectionmenu %}{{ "/device/"|section_menu:device.name }}{% endblock %}
11 {% block title %}{% blocktrans with device.name|striptags as devicename %}Device {{ devicename }}{% endblocktrans %}{% endblock %}
13 {% block header %}
14 <h1>{{ device.name|striptags }}</h1>
15 {% endblock %}
17 {% block content %}
18 {% if device.deleted %}<div class="alert alert-info">{% trans "This device was deleted." %}</div>{% endif %}
19 <h2>{% trans "Subscriptions" %}</h2>
20 <table class="list">
21 {% if subscriptions %}
23 {% for podcast in subscriptions %}
24 <tr>
25 <td class="logo">{{ podcast|podcast_logo }}</td>
26 <td>{% podcast_group_link podcast %}</td>
27 <td>
28 <form class="form-inline" method="post" action="{% podcast_link_target podcast "unsubscribe" device.uid %}?return_to=/device/{{ device.uid }}" >
29 {% csrf_token %}
30 <button class="btn btn-danger btn-sm" type="submit">
31 <i class="icon-remove"></i> {% trans "Unsubscribe" %}
32 </button>
33 </form>
34 </td>
35 </tr>
36 {% endfor %}
37 {% else %}
38 <tr>
39 <td colspan="2">
40 {% trans "You don't have any podcasts subscribed on this device." %}
41 </td>
42 </tr>
43 {% endif %}
44 </table>
46 <div class="btn-group">
48 {% if subscriptions %}
49 <a class="btn btn-default" href="{% url "device-opml" device.uid %}">
50 <i class="icon-download"></i>
51 {% trans "Download OPML" %}
52 </a>
54 <a class="btn btn-default" href="{% url "device-symbian-opml" device.uid %}">
55 <i class="icon-download"></i>
56 {% trans "OPML for Nokia Podcasting on Symbian " %}
57 </a>
59 {% endif %}
61 <a class="btn btn-default" href="{% url "device-history" device.uid %}">
62 <i class="icon-calendar"></i>
63 {% trans "History" %}
64 </a>
66 {% if device.sync_group %}
67 <a href="{% url "trigger-sync" device.uid %}" class="btn btn-default">
68 <i class="icon-refresh"></i>
69 {% trans "Trigger Sync" %}
70 </a>
71 {% endif %}
73 {% if not device.deleted %}
75 <a class="btn btn-default" href="{% url "device-edit" device.uid %}">
76 <i class="icon-edit"></i>
77 {% trans "Configure" %}
78 </a>
79 {% endif %}
81 </div>
83 {% endblock %}
86 {% block sidebar %}
88 {% if not device.deleted %}
90 <div class="well">
92 <h4>{% trans "Synchronize" %}</h4>
93 <p>{% blocktrans %}If you synchronize devices, they will always have the same subscriptions. A podcast that is subscribed on one device, will automatically be added to all synchronized devices.{% endblocktrans %}</p>
95 {% if synced_with|length_is:"0" %}
97 <p>{% blocktrans with device.name|striptags as devicename %}{{ devicename }} is currently not synchronized with other devices.{% endblocktrans %}</p>
99 {% else %}
101 <p>{% blocktrans with device.name|striptags as devicename and synced_with|device_list as synclist %}{{ devicename }} is currently synchronized with {{ synclist }}.{% endblocktrans %}</p>
102 <a href="{% url "device-unsync" device.uid %}">{% blocktrans with device.name|striptags as devicename %}Stop synchronisation for {{ devicename }} {% endblocktrans %}</a>
104 {% endif %}
106 {% if has_sync_targets %}
107 <form action="{% url "device-sync" device.uid %}" method="POST">
108 {% csrf_token %}
109 {{ sync_form.as_p }}
110 <button class="btn btn-default" type="submit">{% trans "Synchronize" %}</button>
111 </form>
112 {% endif %}
114 </div>
115 {% endif %}
117 {% endblock %}