show "Sync" box also on device-edit page
[mygpo.git] / mygpo / web / templates / device-edit.html
blob46b4375d5bf408a3ed0b86461bbb5145c72bcff2
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 %}{{ "/subscriptions/"|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>
17 <a href="{% url "device" device.uid %}">{% trans "Back to" %} {{ device|device_icon }} {{device|striptags}}</a>
18 {% endblock %}
21 {% block content %}
23 {% if device.deleted %}<div class="info">{% trans "This device was deleted." %}</div>{% endif %}
25 {% if not device.deleted %}
27 <div class="well">
28 <h2>{% trans "Edit" %}</h2>
29 <form class="form-horizontal" action="{% url "device-update" device.uid %}" method="POST">
31 {{ device_form.non_field_errors }}
32 {% csrf_token %}
34 <fieldset>
36 <div class="control-group">
37 <label class="control-label">Name</label>
38 <div class="controls">
39 {{ device_form.name }}
40 </div>
41 </div>
43 <div class="control-group">
44 <label class="control-label">Type</label>
45 <div class="controls">
46 {{ device_form.type }}
47 </div>
48 </div>
50 <div class="control-group">
51 <label class="control-label">Device-ID
52 </label>
53 <div class="controls">
54 {{ device_form.uid }}
55 <p class="help-block">use the same in your client</p>
56 </div>
57 </div>
59 <div class="control-group">
60 <div class="controls">
61 <button class="btn" type="submit">{% trans "Save" %}</button>
62 </div>
63 </div>
64 </fieldset>
65 </form>
66 </div>
68 <div class="well">
69 <h2>{% trans "Replace Subscriptions" %}</h2>
70 <form class="form-inline" method="post" action="{% url "device-upload-opml" device.uid %}" enctype="multipart/form-data">
71 <p>{% trans "Replace your current subscriptions by uploading an OPML file." %}</p>
72 {% csrf_token %}
74 <input type="file" class="input-xlarge" name="opml" id="opml" />
76 <button class="btn" type="submit">{% trans "Upload" %}</button>
77 </form>
78 </div>
80 <div class="well">
81 <h2>{% trans "Delete" %}</h2>
82 <form action="{% url "device-delete" device.uid %}" method="POST">
83 {% csrf_token %}
84 <button class="btn btn-danger" type="submit">
85 <i class="icon-trash"></i> {% trans "Delete Device" %}
86 </button>
87 </form>
88 </div>
89 {% endif %}
91 {% endblock %}
94 {% block sidebar %}
96 {% if not device.deleted %}
98 <div class="well">
100 <h4>{% trans "Synchronize" %}</h4>
101 <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>
103 {% if synced_with|length_is:"0" %}
105 <p>{% blocktrans with device.name|striptags as devicename %}{{ devicename }} is currently not synchronized with other devices.{% endblocktrans %}</p>
107 {% else %}
109 <p>{% blocktrans with device.name|striptags as devicename and synced_with|device_list as synclist %}{{ devicename }} is currently synchronized with {{ synclist }}.{% endblocktrans %}</p>
110 <a href="{% url "device-unsync" device.uid %}">{% blocktrans with device.name|striptags as devicename %}Stop synchronisation for {{ devicename }} {% endblocktrans %}</a>
112 {% endif %}
114 {% if has_sync_targets %}
115 <form action="{% url "device-sync" device.uid %}" method="POST">
116 {% csrf_token %}
117 {{ sync_form.as_p }}
118 <button class="btn" type="submit">{% trans "Synchronize" %}</button>
119 </form>
120 {% endif %}
122 </div>
123 {% endif %}
125 {% endblock %}