use new style {% url "view" %} template syntax
[mygpo.git] / mygpo / web / templates / device.html
blobce4710bca2c23643c610d2b2e45a498ddbd82ad4
1 {% extends "base.html" %}
2 {% load url from future %}
3 {% load i18n %}
4 {% load humanize %}
5 {% load devices %}
6 {% load podcasts %}
8 {% load menu %}
9 {% block mainmenu %}{{ "/device/"|main_menu }}{% endblock %}
10 {% block sectionmenu %}{{ "/device/"|section_menu:device.name }}{% endblock %}
12 {% block title %}{% blocktrans with device.name|striptags as devicename %}Device {{ devicename }}{% endblocktrans %}{% endblock %}
14 {% block header %}
15 <h1>{{ device.name|striptags }}</h1>
16 {% endblock %}
18 {% block content %}
19 {% if device.deleted %}<div class="info">{% trans "This device was deleted." %}</div>{% endif %}
20 <h2>{% trans "Subscriptions" %}</h2>
21 <table class="list">
22 {% if subscriptions %}
24 {% for podcast in subscriptions %}
25 <tr>
26 <td class="logo">{{ podcast|podcast_logo }}</td>
27 <td>{% podcast_group_link podcast %}</td>
28 <td>
29 <form class="form-inline" method="post" action="{% podcast_link_target podcast "unsubscribe" device.uid %}?return_to=/device/{{ device.uid }}" >
30 <button class="btn btn-danger btn-small" 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" href="{% url "device-opml" device.uid %}">
50 <i class="icon-download"></i>
51 {% trans "Download OPML" %}
52 </a>
54 <a class="btn" 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" href="{% url "device-history" device.uid %}">
62 <i class="icon-calendar"></i>
63 {% trans "History" %}
64 </a>
66 {% if not device.deleted %}
68 <a class="btn" href="{% url "device-edit" device.uid %}">
69 <i class="icon-edit"></i>
70 {% trans "Configure" %}
71 </a>
72 {% endif %}
74 </div>
76 {% endblock %}
79 {% block sidebar %}
81 <div class="well">
83 {% if not device.deleted %}
85 <h4>{% trans "Synchronize" %}</h4>
86 <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>
88 {% if synced_with|length_is:"0" %}
90 <p>{% blocktrans with device.name|striptags as devicename %}{{ devicename }} is currently not synchronized with other devices.{% endblocktrans %}</p>
92 {% else %}
94 <p>{% blocktrans with device.name|striptags as devicename and synced_with|device_list as synclist %}{{ devicename }} is currently synchronized with {{ synclist }}.{% endblocktrans %}</p>
95 <a href="{% url "device-unsync" device.uid %}">{% blocktrans with device.name|striptags as devicename %}Stop synchronisation for {{ devicename }} {% endblocktrans %}</a>
97 {% endif %}
99 {% if has_sync_targets %}
100 <form action="{% url "device-sync" device.uid %}" method="POST">
101 {% csrf_token %}
102 {{ sync_form.as_p }}
103 <button class="btn" type="submit">{% trans "Synchronize" %}</button>
104 </form>
105 {% endif %}
107 {% endif %}
109 </div>
111 {% endblock %}