Device Selection as List when subscribing to Podcast (bug 784)
[mygpo.git] / mygpo / web / templates / subscribe.html
blobfd20815372b7d6624bcd6e109d3bc8f4349c0afc
1 {% extends "base.html" %}
2 {% load i18n %}
3 {% load podcasts %}
4 {% load utils %}
5 {% load devices %}
7 {% load menu %}
8 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
9 {% block sectionmenu %}
10 {% if podcast.title %}
11 {{ "/podcast/"|section_menu:podcast.title }}
12 {% else %}
13 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
14 {% endif %}
15 {% endblock %}
17 {% block title %}{% blocktrans with podcast.title|default:"Unnamed Podcast"|striptags as podcasttitle %}Subscribe to {{ podcasttitle }}{% endblocktrans %}{% endblock %}
19 {% block header %}
20 {% if podcast.logo_url %}
21 <div id="podcastlogo"><a href="{% podcast_link_target podcast %}">{{ podcast|podcast_logo_big }}</a></div>
22 {% endif %}
23 <h1>
24 {% if podcast.title %}
25 {% blocktrans with podcast.title|striptags as podcasttitle %}Subscribe to {{podcasttitle }}{% endblocktrans %}
26 {% else %}
27 {% trans "Subscribe to this podcast" %}
28 {% endif %}
29 </h1>
30 <a href="{{ podcast.url }}" class="URL">{{ podcast.url }}</a>
32 {% if podcast.description %}
33 <p class="description">{{ podcast.description|striptags }}</p>
34 {% endif %}
35 {% endblock %}
38 {% block content %}
40 <h2>{% trans "Subscribe on devices" %}</h2>
41 {% if targets|length %}
42 <form action="{% podcast_link_target podcast "subscribe" %}" method="post" class="form-horizontal">
43 {% csrf_token %}
45 <div class="control-group">
46 <div class="controls">
47 {% for target in targets %}
48 <label class="checkbox">
49 <input type="checkbox" value="{{ target|target_uid }}" name="{{ target|target_uid }}" checked="checked">
50 {% if target|is_list %}
51 {% for t in target %}
52 <a href="{% url device t.uid %}">{{ t|device_icon }}{{ t.name|striptags }}</a>
53 {{ t|device_link }} {{ t.name }}
54 {% endfor %}
55 {% else %}
56 <a href="{% url device target.uid %}">{{ target|device_icon }}{{ target.name|striptags }}</a>
57 {% endif %}
58 </label>
59 {% endfor %}
60 </div>
61 </div>
63 <div class="control-group">
64 <div class="controls">
65 <input type="submit" value="Subscribe" />
66 </div>
67 </div>
68 </form>
69 {% else %}
70 <p>{% trans "You can't subscribe to this podcast, because you don't have any devices (on which you don't have subscribed to the podcast already." %}</p>
71 <a class="btn btn-success" href="{% url device-edit-new %}">
72 <i class="icon-plus"></i> {% trans "Create Device" %}
73 </a>
75 {% endif %}
77 {% if not podcast.title %}
78 <div class="info"><strong>{% trans "Why Unnamed Podcast?" %}</strong> {% trans "Because we display names after we have fetched the information form the feed -- and this may take some time. Until this is completed, the podcast will simply be called this way." %}</div>
79 {% endif %}
81 {% endblock %}