use new style {% url "view" %} template syntax
[mygpo.git] / mygpo / web / templates / subscribe.html
blob8fee9d0286ad85010684dc362d8eb802fd4ada0d
1 {% extends "base.html" %}
2 {% load url from future %}
3 {% load i18n %}
4 {% load podcasts %}
5 {% load utils %}
6 {% load devices %}
8 {% load menu %}
9 {% block mainmenu %}{{ "/podcast/"|main_menu }}{% endblock %}
10 {% block sectionmenu %}
11 {% if podcast.title %}
12 {{ "/podcast/"|section_menu:podcast.title }}
13 {% else %}
14 {{ "/podcast/"|section_menu:"Unnamed Podcast" }}
15 {% endif %}
16 {% endblock %}
18 {% block title %}{% blocktrans with podcast.title|default:"Unnamed Podcast"|striptags as podcasttitle %}Subscribe to {{ podcasttitle }}{% endblocktrans %}{% endblock %}
20 {% block header %}
21 {% if podcast.logo_url %}
22 <div id="podcastlogo"><a href="{% podcast_link_target podcast %}">{{ podcast|podcast_logo_big }}</a></div>
23 {% endif %}
24 <h1>
25 {% if podcast.title %}
26 {% blocktrans with podcast.title|striptags as podcasttitle %}Subscribe to {{podcasttitle }}{% endblocktrans %}
27 {% else %}
28 {% trans "Subscribe to this podcast" %}
29 {% endif %}
30 </h1>
31 <a href="{{ podcast.url }}" class="URL">{{ podcast.url }}</a>
33 {% if podcast.description %}
34 <p class="description">{{ podcast.description|striptags }}</p>
35 {% endif %}
36 {% endblock %}
39 {% block content %}
41 <h2>{% trans "Subscribe on devices" %}</h2>
42 {% if targets|length %}
43 <form action="{% podcast_link_target podcast "subscribe" %}" method="post" class="form-horizontal">
44 {% csrf_token %}
46 <div class="control-group">
47 <div class="controls">
48 {% for target in targets %}
49 <label class="checkbox">
50 <input type="checkbox" value="{{ target|target_uid }}" name="{{ target|target_uid }}" checked="checked">
51 {% if target|is_list %}
52 {% for t in target %}
53 <a href="{% url "device" t.uid %}">{{ t|device_icon }}{{ t.name|striptags }}</a>
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 %}