fix user-variable mixup on userpage
[mygpo.git] / mygpo / share / templates / userpage.html
blob5124945f0244c8f7892d95eec8701f064571f4ea
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">
25 {% blocktrans %}a user on {{ site }}{% endblocktrans %}
26 {% if page_user.twitter %}
27 ยท <a href="https://twitter/{{ page_user.twitter }}"><i class="icon-twitter"></i></a>
28 {% endif %}
30 </small>
32 <div class="description">
33 {% if page_user.about %}
34 {{ page_user.about|markdown }}
35 {% else %}
36 {% blocktrans with page_user.username as username %}<strong>{{ username }}</strong> is sharing his favorite podcasts on {{ site }}.{% endblocktrans %}
37 {% endif %}
39 </div>
40 {% endblock %}
42 {% block content %}
44 <br style="clear: both;" />
46 {% if subscriptions and not subscriptions_token %}
48 <h2>{% blocktrans with subscriptions|length as subscription_count %}{{ subscription_count }} Subscriptions{% endblocktrans %}</h2>
49 <table class="list">
50 <tr>
51 <th></th>
52 <th></th>
53 <th>{% trans "Episodes Listened" %}</th>
54 </tr>
56 {% for podcast in subscriptions|slice:":5" %}
57 <tr>
58 <td>{{ podcast|podcast_logo }}</td>
59 <td class="listlink">{% podcast_group_link podcast %}</td>
60 <td>{% vertical_bar podcast.episodes_listened podcast.episode_count "ratio" %}</td>
61 </tr>
62 {% endfor %}
64 {% if subscriptions|length > 5 %}
65 <tr>
66 <td></td>
67 <td colspan="2">
68 <a href="{% url "shared-subscriptions" page_user.username %}">
69 {% trans "see all" %}
70 </a>
71 </td>
72 </tr>
73 {% endif %}
75 </table>
77 {% endif %}
82 {% if lists %}
84 <h2>{% blocktrans with lists|length as list_count %}{{ list_count }} Podcast Lists{% endblocktrans %}</h2>
85 <table class="list">
86 {% for list in lists|slice:":5" %}
87 <tr>
88 <td><a href="{% url "list-show" page_user.username list.slug %}">{{ list.title }}</a></td>
89 <td>{% blocktrans with list.podcasts|length as num_podcasts %}{{ num_podcasts }} Podcasts{% endblocktrans %}</td>
90 </tr>
91 {% endfor %}
93 {% if lists|length > 5 %}
94 <tr>
95 <td></td>
96 <td>
97 <a href="{% url "lists-user" page_user.username %}">
98 {% trans "see all" %}
99 </a>
100 </td>
101 </tr>
102 {% endif %}
104 </table>
106 {% endif %}
109 {% if recent_episodes %}
111 <h2>{% blocktrans with recent_episodes|length as num_episodes%}{{ num_episodes }} Recently Played Episodes{% endblocktrans %}</h2>
112 <table class="list">
113 {% for episode in recent_episodes %}
114 <tr>
115 <td>{{ episode.podcast|podcast_logo }}</td>
116 <td>
117 {% episode_link episode episode.podcast %}<br />
118 {% if episode.podcast %}
119 <span class="from_podcast">{% trans "from" %} {% podcast_group_link episode.podcast %}</td>
120 {% endif %}
121 </td>
122 </tr>
123 {% endfor %}
125 </table>
127 {% endif %}
130 {% if favorite_episodes and not favorite_feeds_token %}
132 <h2>{% blocktrans with favorite_episodes|length as num_fav_episodes %}{{ num_fav_episodes }} Favorite Episodes{% endblocktrans %}</h2>
133 <table class="list">
134 {% for episode in favorite_episodes|slice:":5" %}
135 <tr>
136 <td>{% if episode.podcast %}{{ episode.podcast|podcast_logo }}{% endif %}</td>
137 <td>{% episode_link episode episode.podcast %}<br/>
138 {% if episode.podcast %}
139 <span class="from_podcast">{% trans "from" %} {% podcast_group_link episode.podcast %}</td>
140 {% endif %}
141 </tr>
142 {% endfor %}
144 {% if favorite_episodes|length > 5 %}
145 <tr>
146 <td></td>
147 <td>
148 <a href="{% url "favorites-feed" page_user.username %}">
149 {% trans "see all" %}
150 </a>
151 </td>
152 </tr>
153 {% endif %}
155 </table>
157 {% endif %}
159 {% endblock %}
162 {% block sidebar %}
164 {% if user == page_user %}
166 <div class="well">
167 <h3>{% trans "That's You!" %}</h3>
169 <a href="{% url "account"%}" class="btn btn-primary">{% trans "Edit your profile" %}</a>
171 </div>
173 {% endif %}
176 <div class="well">
177 <h3>{% trans "Stats" %}</h3>
178 <ul>
179 <li>{% trans "Total Played:" %}
180 {% if seconds_played_total %}
181 {{ seconds_played_total|format_duration }} /
182 {% endif %}
183 {{ num_played_episodes_total }} {% trans "Episodes" %}
184 </li>
185 <li>{% trans "Played Last Month:" %}
186 {% if seconds_played_month %}
187 {{ seconds_played_month|format_duration }} /
188 {% endif %}
189 {{ num_played_episodes_month }} {% trans "Episodes" %}
190 </li>
191 <li>{% trans "Member Since:" %}
192 {% if user.date_joined.year > 2000 %}
193 {{ user.date_joined }}
194 {% else %}
195 {% trans "the early days" %}
196 {% endif %}
197 </li>
198 </ul>
199 </div>
201 {% endblock %}