promote "Share" to main navigation
[mygpo.git] / mygpo / web / templates / toplist.html
blob00cb01e66f579350e2b9f74272b320b0d589c85c
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 %}These 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 toplist-pos">
37 {% ifchanged entry.subscriptions %}
38 {{ forloop.counter }}
39 {% endifchanged %}
40 </td>
41 <td class="oldposition">
42 {% if entry.oldplace %}
43 {% if entry.oldplace|subtract:forloop.counter %}
44 {{ entry.oldplace|subtract:forloop.counter|format_diff }}
45 {% endif %}
46 {% else %}
47 <img src="/media/charts-new.png" alt="new">
48 {% endif %}
49 </td>
50 <td>
51 {% if entry.podcast %}
52 {{ entry.podcast|podcast_logo }}
53 {% else %}
54 {{ entry.podcast_group.podcasts|first|podcast_logo }}
55 {% endif %}
56 </td>
57 <td>
58 {% if entry.podcast %}
59 <a href="/podcast/{{ entry.podcast.id }}">{{ entry.podcast|striptags }}</a>
60 {% else %}
61 {{entry.podcast_group.title|striptags}}
63 {% for p in entry.podcast_group.podcasts %}
64 <a href="/podcast/{{ p.id }}">{{ p.group_member_name|striptags }}</a>
65 {% endfor %}
67 {% endif %}
68 </td>
69 <td>{{ entry.subscriptions|vertical_bar:max_subscribers }}</td>
70 </tr>
71 {% endfor %}
72 </table>
74 <h3><a name="languages"></a>{% trans "Languages" %}</h3>
75 {% if languages|length_is:"0" %}
76 <p>Currently showing all languages. Show a specific one:
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 <option value="{{ key }}">{{ name }}</option>
82 {% endfor %}
83 </select>
84 <input type="submit" value="{% trans "Show" %}" />
85 </form>
86 </p>
87 {% else %}
88 <p>Remove a language
89 <ul>
90 {% for lang in languages %}
91 <li>
92 <a href="/toplist/?lang={{ languages|join:","|cut:lang }}">{{ all_languages|lookup:lang }}</a>
93 </li>
94 {% endfor %}
95 </ul>
96 <form action="/toplist/?lang={{ languages|join:"," }}" method="post">
97 {% csrf_token %}
98 <select name="lang">
99 {% for key, name in all_languages.iteritems %}
100 {% if not key in languages %}
101 <option value="{{ key }}">{{ name }}</option>
102 {% endif %}
103 {% endfor %}
104 </select>
105 <input type="submit" value="{% trans "Add" %}" />
106 </form>
107 {% blocktrans %}or show <a href="/toplist?lang=">all languages</a>.{% endblocktrans %}
108 </p>
109 {% endif %}
111 <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>
112 {% endblock %}