Django-magic to prevent cross-site request forgery for POST requests
[mygpo.git] / mygpo / web / templates / toplist.html
blob077c437bcb45e53bcf3e76384adb7c8e29b86867
1 {% extends "base.html" %}
3 {% load i18n %}
4 {% load podcasts %}
5 {% load charts %}
6 {% load math %}
7 {% load utils %}
9 {% load menu %}
10 {% block mainmenu %}{{ "/toplist/"|main_menu }}{% endblock %}
11 {% block sectionmenu %}{{ "/toplist/"|section_menu }}{% endblock %}
13 {% block title %}{% trans "Toplist" %}{% endblock %}
15 {% block content %}
16 <h1>{% trans "Toplist" %}</h1>
18 <p>
19 {% if languages|length_is:"0" %}
20 {% blocktrans with entries|length as count %}These are the {{ count }} most subscribed podcasts of all languages. You can chose to show only selected languages <a href="#languages">below</a>.{% endblocktrans %}
21 {% else %}
22 {% blocktrans with entries|length as count and all_languages|lookup_list:languages|join:", " as lang %}The are the {{ count }} most subscribed podcasts for the languages {{ lang }}. You can select the included languages <a href="#languages">below</a>.{% endblocktrans %}
23 {% endif %}
24 </p>
26 <table class="list">
27 <tr>
28 <th></th>
29 <th></th>
30 <th></th>
31 <th>{% trans "Podcast" %}</th>
32 <th>{% trans "Subscribers" %}</th>
33 </tr>
34 {% for entry in entries %}
35 <tr>
36 <td class="numeric">{{ forloop.counter }}</td>
37 <td class="oldposition">
38 {% if languages|length_is:"0" %}
39 {% if entry.oldplace %}
40 {% if entry.oldplace|subtract:forloop.counter %}
41 {{ entry.oldplace|subtract:forloop.counter|format_diff }}
42 {% endif %}
43 {% else %}
44 <img src="/media/charts-new.png" alt="new">
45 {% endif %}
46 {% endif %}
47 </td>
48 <td>{{ entry.podcast|podcast_logo }}</td>
49 <td><a href="/podcast/{{ entry.podcast.id }}">{{ entry.podcast|striptags }}</a></td>
50 <td>{{ entry.subscriptions|vertical_bar:max_subscribers }}</td>
51 </tr>
52 {% endfor %}
53 </table>
55 <h3><a name="languages"></a>{% trans "Languages" %}</h3>
56 {% if languages|length_is:"0" %}
57 <p>Currently showing all languages. Show a specific one:
58 <form action="/toplist/?lang={{ languages|join:"," }}" method="post">
59 {% csrf_token %}
60 <select name="lang">
61 {% for key, name in all_languages.iteritems %}
62 <option value="{{ key }}">{{ name }}</option>
63 {% endfor %}
64 </select>
65 <input type="submit" value="{% trans "Show" %}" />
66 </form>
67 </p>
68 {% else %}
69 <p>Remove a language
70 <ul>
71 {% for lang in languages %}
72 <li>
73 <a href="/toplist/?lang={{ languages|join:","|cut:lang }}">{{ all_languages|lookup:lang }}</a>
74 </li>
75 {% endfor %}
76 </ul>
77 <form action="/toplist/?lang={{ languages|join:"," }}" method="post">
78 {% csrf_token %}
79 <select name="lang">
80 {% for key, name in all_languages.iteritems %}
81 {% if not key in languages %}
82 <option value="{{ key }}">{{ name }}</option>
83 {% endif %}
84 {% endfor %}
85 </select>
86 <input type="submit" value="{% trans "Add" %}" />
87 </form>
88 {% blocktrans %}or show <a href="/toplist?lang=">all languages</a>.{% endblocktrans %}
89 </p>
90 {% endif %}
92 <div class="info"><strong>Get the toplist from your Client</strong>! Access <a href="/toplist/30.opml">http://{{ url }}/toplist/30.opml</a> for the Top-30.</div>
93 {% endblock %}