refactor / optimize device updates
[mygpo.git] / mygpo / directory / templates / directory.html
blobfd16c39d06d324c1c35057d690418b31de952fd7
1 {% extends "base.html" %}
3 {% load i18n %}
4 {% load podcasts %}
5 {% load charts %}
6 {% load math %}
7 {% load utils %}
8 {% load cache %}
10 {% load menu %}
11 {% block mainmenu %}{{ "/directory/"|main_menu }}{% endblock %}
12 {% block sectionmenu %}{{ "/directory/"|section_menu }}{% endblock %}
14 {% block title %}{% trans "Podcast Directory" %}{% endblock %}
16 {% block header %}
17 <h1>{% trans "Podcast Directory" %}</h1>
18 {% endblock %}
21 {% block content %}
22 {% cache 60 topics %}
23 {% for c in topics.categories %}
25 {% if forloop.counter0|divisibleby:"2" %}
26 <div class="row-fluid">
27 {% endif %}
29 <div class="span6">
30 {% if c.cls == "PodcastList" %}
31 {% url "user" c.username as user-lists-url %}
32 <h2>{% blocktrans with c.title as listtitle and c.username as username %}{{ listtitle }} <span class="by-user">by <a href="{{ user-lists-url }}">{{ username }}</a></span>{% endblocktrans %}</h2>
33 {% else %}
34 <h2>{{ c.label }}</h2>
35 {% endif %}
37 <table class="list">
38 {% for podcast in c.get_podcasts %}
39 <tr>
40 <td class="logo">{{ podcast|podcast_logo }}</td>
41 <td>{% podcast_group_link podcast %}</td>
42 </tr>
43 {% endfor %}
44 <tr>
45 <td></td>
46 <td>
47 {% if c.cls == "PodcastList" %}
48 <a href="{% url "list-show" c.username c.slug %}">{% trans "more..." %}</a>
49 {% else %}
50 <a href="{% url "directory" c.label %}">{% trans "more..." %}</a>
51 {% endif %}
52 <td></td>
53 </tr>
54 </table>
55 </div>
57 {% if forloop.counter|divisibleby:"2" %}
58 </div>
59 {% endif %}
61 {% endfor %}
62 {% endcache %}
64 <hr style="clear: both;"/>
66 {% cache 60 tagcloud %}
67 <div id="tagcloud">
68 {% for tag in topics.tagcloud %}
69 <span style="font-size: {% smartwidthratio tag.get_weight topics.min_weight topics.max_weight 4 1 %}em">
70 <a href="{% url "directory" tag.label %}">{{ tag.label }}</a>
71 </span>
72 {% endfor %}
73 </div>
74 {% endcache %}
75 {% endblock %}
78 {% block sidebar %}
80 {% cache 3600 podcastlist %}
81 {% for podcastlist in podcastlists %}
82 {% if podcastlist and podcastlist.user.username %}
83 <div class="well">
84 <h4>
85 <a href="{% url "list-show" podcastlist.user.username podcastlist.slug %}">
86 {{ podcastlist.title }}
87 </a>
88 <small>{% trans "Podcast List by" %}
89 <a href="{% url "lists-user" podcastlist.user.username %}">
90 {{ podcastlist.user.username }}
91 </a>
92 </small>
93 </h4>
95 <div class="logo-group">
96 {% for podcast in podcastlist.podcasts %}
98 <a href="{% podcast_link_target podcast %}">
99 {{ podcast|podcast_logo }}
100 </a>
102 {% endfor %}
104 {% if podcastlist.more_podcasts %}
105 {% blocktrans with podcastlist.more_podcasts as more %}and {{ more }} more{% endblocktrans %}
106 {% endif %}
107 </div>
109 <div class="btn-group">
110 <a class="btn btn-primary" href="{% url "lists-overview" %}">
111 {% trans "Create a Podcast List" %}
112 </a>
113 </div>
115 </div>
116 {% endif %}
117 {% endfor %}
118 {% endcache %}
121 {% cache 3600 directory_trending %}
122 {% if trending_podcasts %}
123 {% with trending_podcasts|slice:":1"|first as trending_podcast %}
124 {% if trending_podcast %}
125 <div class="well">
127 <h4><small>{% trans "Trending" %} {% subscriber_change trending_podcast.subscriber_change %}</small></h4>
129 <a href="{% podcast_link_target trending_podcast %}">
130 <div id="podcastlogo">{{ trending_podcast|podcast_logo_medium }}</div>
131 </a>
133 <h4>{{ trending_podcast.title }}</h4>
135 <p class="description">
136 {{ trending_podcast.description|default:""|truncatewords:"50" }}
137 </p>
140 <a href="{% podcast_link_target trending_podcast %}">{% trans "more..." %}</a>
141 </p>
143 </div>
144 {% endif %}
145 {% endwith %}
146 {% endif %}
147 {% endcache %}
150 {% cache 3600 random_podcast %}
151 {% for random_podcast in random_podcasts %}
152 <div class="well">
154 <h4><small>{% trans "Random" %}</small></h4>
157 <a href="{% podcast_link_target random_podcast %}">
158 <div id="podcastlogo">{{ random_podcast|podcast_logo_medium }}</div>
159 </a>
161 <h4>{{ random_podcast.title }}</h4>
163 <p class="description">
164 {{ random_podcast.description|default:""|truncatewords:"50" }}
165 </p>
168 <a href="{% podcast_link_target random_podcast %}">{% trans "more..." %}</a>
169 </p>
171 </div>
172 {% endfor %}
173 {% endcache %}
175 {% endblock %}