use new style {% url "view" %} template syntax
[mygpo.git] / mygpo / share / templates / userpage.html
blobc763d10ddced9dd20222ab2d1dd71b6e7ae32d57
1 {% extends "base.html" %}
3 {% load url from future %}
4 {% load i18n %}
5 {% load podcasts %}
6 {% load episodes %}
7 {% load charts %}
8 {% load math %}
9 {% load utils %}
10 {% load time %}
11 {% load gravatar %}
13 {% load menu %}
14 {% block mainmenu %}{{ "/share/"|main_menu }}{% endblock %}
15 {% block sectionmenu %}{{ "/share/me"|section_menu:page_user.username }}{% endblock %}
17 {% block title %}{{ page_user.username }}{% endblock %}
20 {% block header %}
21 <div id="podcastlogo">{% gravatar_img page_user %}</div>
23 <h1>{{ page_user.username }}</h1>
24 <small class="description"></small>
25 {% endblock %}
27 {% block content %}
29 <br style="clear: both;" />
31 {% if subscriptions and not subscriptions_token %}
33 <h2>{% blocktrans with subscriptions|length as subscription_count %}{{ subscription_count }} Subscriptions{% endblocktrans %}</h2>
34 <table class="list">
35 <tr>
36 <th></th>
37 <th></th>
38 <th>{% trans "Episodes Listened" %}</th>
39 </tr>
41 {% for podcast in subscriptions|slice:":5" %}
42 <tr>
43 <td>{{ podcast|podcast_logo }}</td>
44 <td class="listlink">{% podcast_group_link podcast %}</td>
45 <td>{% vertical_bar podcast.episodes_listened podcast.episode_count "ratio" %}</td>
46 </tr>
47 {% endfor %}
49 {% if subscriptions|length > 5 %}
50 <tr>
51 <td></td>
52 <td colspan="2">
53 <a href="{% url "shared-subscriptions" page_user.username %}">
54 {% trans "see all" %}
55 </a>
56 </td>
57 </tr>
58 {% endif %}
60 </table>
62 {% endif %}
67 {% if lists %}
69 <h2>{% blocktrans with lists|length as list_count %}{{ list_count }} Podcast Lists{% endblocktrans %}</h2>
70 <table class="list">
71 {% for list in lists|slice:":5" %}
72 <tr>
73 <td><a href="{% url "list-show" page_user.username list.slug %}">{{ list.title }}</a></td>
74 <td>{% blocktrans with list.podcasts|length as num_podcasts %}{{ num_podcasts }} Podcasts{% endblocktrans %}</td>
75 </tr>
76 {% endfor %}
78 {% if lists|length > 5 %}
79 <tr>
80 <td></td>
81 <td>
82 <a href="{% url "lists-user" page_user.username %}">
83 {% trans "see all" %}
84 </a>
85 </td>
86 </tr>
87 {% endif %}
89 </table>
91 {% endif %}
94 {% if recent_episodes %}
96 <h2>{% blocktrans with recent_episodes|length as num_episodes%}{{ num_episodes }} Recently Played Episodes{% endblocktrans %}</h2>
97 <table class="list">
98 {% for episode in recent_episodes %}
99 <tr>
100 <td>{{ episode.podcast|podcast_logo }}</td>
101 <td>
102 {% episode_link episode episode.podcast %}<br />
103 {% if episode.podcast %}
104 <span class="from_podcast">{% trans "from" %} {% podcast_group_link episode.podcast %}</td>
105 {% endif %}
106 </td>
107 </tr>
108 {% endfor %}
110 </table>
112 {% endif %}
115 {% if favorite_episodes and not favorite_feeds_token %}
117 <h2>{% blocktrans with favorite_episodes|length as num_fav_episodes %}{{ num_fav_episodes }} Favorite Episodes{% endblocktrans %}</h2>
118 <table class="list">
119 {% for episode in favorite_episodes|slice:":5" %}
120 <tr>
121 <td>{% if episode.podcast %}{{ episode.podcast|podcast_logo }}{% endif %}</td>
122 <td>{% episode_link episode episode.podcast %}<br/>
123 {% if episode.podcast %}
124 <span class="from_podcast">{% trans "from" %} {% podcast_group_link episode.podcast %}</td>
125 {% endif %}
126 </tr>
127 {% endfor %}
129 {% if favorite_episodes|length > 5 %}
130 <tr>
131 <td></td>
132 <td>
133 <a href="{% url "favorites-feed" page_user.username %}">
134 {% trans "see all" %}
135 </a>
136 </td>
137 </tr>
138 {% endif %}
140 </table>
142 {% endif %}
144 {% endblock %}
147 {% block sidebar %}
149 <div class="well">
150 <h3>{% trans "Stats" %}</h3>
151 <ul>
152 <li>{% trans "Total Played:" %}
153 {% if seconds_played_total %}
154 {{ seconds_played_total|format_duration }} /
155 {% endif %}
156 {{ num_played_episodes_total }} {% trans "Episodes" %}
157 </li>
158 <li>{% trans "Played Last Month:" %}
159 {% if seconds_played_month %}
160 {{ seconds_played_month|format_duration }} /
161 {% endif %}
162 {{ num_played_episodes_month }} {% trans "Episodes" %}
163 </li>
164 <li>{% trans "Member Since:" %}
165 {% if user.date_joined.year > 2000 %}
166 {{ user.date_joined }}
167 {% else %}
168 {% trans "the early days" %}
169 {% endif %}
170 </li>
171 </ul>
172 </div>
174 {% endblock %}