]> git.openstreetmap.org Git - osqa.git/blob - forum/skins/default/templates/users/stats.html
Fixes OSQA 348, Last seen field is not updated.
[osqa.git] / forum / skins / default / templates / users / stats.html
1 {% extends "user.html" %}
2 <!-- user_stats.html -->
3 {% load i18n %}
4 {% load extra_tags %}
5 {% load extra_filters %}
6 {% load humanize %}
7 {% load question_list_tags %}
8                 {% block usercontent %}
9
10                 {% declare %}
11                     question_count = questions.count()
12                     show_more_questions_link = question_count > 15
13                     questions = questions[:15]
14
15                     answer_count = answers.count()
16                     show_more_answers_link = answer_count > 30
17                     answers = answers[:30]
18                 {% enddeclare %}
19         
20         <a name="questions"></a>
21         {% spaceless %}
22             <h2>
23                 {% blocktrans count question_count as counter %}
24                 <span class="count">1</span> Question
25                 {% plural %}
26                 <span class="count">{{counter}}</span> Questions
27                 {% endblocktrans %}
28             </h2>
29         {% endspaceless %}
30                 <div class="user-stats-table">
31                     {% for question in questions %}
32                         {% question_list_item question favorite_count=yes signature_type=badges %}
33                     {% endfor %}
34             {% if show_more_questions_link %}
35                 <div class="short-summary"  style="text-align: right">
36                     <a href="{{ view_user.get_asked_url }}">{% blocktrans with view_user.username as username %}View all questions by {{ username }}{% endblocktrans %}</a>
37                 </div>
38             {% endif %}
39                 </div>
40                 <br clear="all"/>
41         <a name="answers"></a>
42         {% spaceless %}
43             <h2>
44                 {% blocktrans count answer_count as counter %}
45                 <span class="count">1</span> Answer
46                 {% plural %}
47                 <span class="count">{{counter}}</span> Answers
48                 {% endblocktrans %}
49             </h2>
50         {% endspaceless %}
51         <div class="user-stats-table">
52             {% for answer in answers %}
53             <div class="answer-summary">
54                 <a title="{{answer.question.title}}"
55                     href="{{ answer.get_absolute_url }}">
56                     <span class="{% if answer.nis.accepted %}answered-accepted {% endif %} answer-votes" 
57                                                 title="{% blocktrans with answer.score as vote_count %}the answer has been voted for {{ vote_count }} times{% endblocktrans %} {% if answer.nis.accepted %}{% trans "this answer has been selected as correct" %}{%endif%}">
58                         {{ answer.score }}
59                     </span>
60                 </a>
61                 <div class="answer-link">
62                     {% spaceless %}
63                     <a href="{{ answer.get_absolute_url }}">{{answer.headline}}</a>
64                     {% endspaceless %}
65                 </div>
66             </div>
67             {% endfor %}
68             {% if show_more_answers_link %}
69                 <div class="short-summary"  style="text-align: right">
70                     <a href="{{ view_user.get_answered_url }}">{% blocktrans with view_user.username as username %}View all questions answered by {{ username }}{% endblocktrans %}</a>
71                 </div>
72             {% endif %}
73         </div>
74         <br clear="all"/>
75         <a name="votes"></a>
76         {% spaceless %}
77             <h2>
78                 {% blocktrans count total_votes as cnt %}
79                     <span class="count">1</span> Vote
80                 {% plural %}
81                     <span class="count">{{cnt}}</span> Votes
82                 {% endblocktrans %}
83             </h2>
84         {% endspaceless %}
85         <div class="user-stats-table">
86             <table>
87                 <tr>
88                     <td width="60">
89                         <img style="cursor: default;" src="{% media  "/media/images/vote-arrow-up-on.png" %}" alt="{% trans "thumb up" %}" />
90                             <span title="{% trans "user has voted up this many times" %}" class="vote-count">{{up_votes}}</span>
91
92                     </td>
93                     <td width="60">
94                         <img style="cursor: default;" src="{% media  "/media/images/vote-arrow-down-on.png" %}" alt="{% trans "thumb down" %}" />
95                             <span title="{% trans "user voted down this many times" %}" class="vote-count">{{down_votes}}</span>
96
97                     </td>
98                 </tr>
99             </table>
100         </div>
101         <a name="tags"></a>
102         {% spaceless %}
103             <h2>
104                 {% blocktrans count user_tags|length as counter %}
105                     <span class="count">1</span> Tag
106                 {% plural %}
107                     <span class="count">{{counter}}</span> Tags
108                 {% endblocktrans %}
109             </h2>
110         {% endspaceless %}
111         <div class="user-stats-table">
112             <table class="tags">
113                 <tr>
114                     <td width="180" valign="top">
115                         {% for tag in user_tags%}
116                         <a rel="tag" 
117                                                         title="{% blocktrans with tag.name as tag_name %}see other questions with {{view_user}}'s contributions tagged '{{ tag_name }}' {% endblocktrans %}" 
118                                                         href="{% url tag_questions tag|urlencode %}?user={{view_user.username}}">{{tag.name}}</a>
119                         <span class="tag-number">&#215; {{ tag.user_tag_usage_count|intcomma }}</span><br/>
120                             {% if forloop.counter|divisibleby:"10" %}
121                                 </td>
122                                 <td width="180"  valign="top">
123                             {% endif %}
124                         {% endfor %}
125                     </td>
126                 </tr>
127             </table>
128         </div>
129         <a name="badges"></a>
130         {% spaceless %}
131         <h2>
132             {% blocktrans count total_awards as counter %}
133             <span class="count">1</span> Badge
134             {% plural %}
135             <span class="count">{{counter}}</span> Badges
136             {% endblocktrans %}
137         </h2>
138         {% endspaceless %}
139         <div class="user-stats-table">
140             <table>
141                 <tr>
142                     <td width="180" style="line-height:35px">
143                         {% for award, count in awards %}
144                             <a href="{% url badges %}{{award.id}}/{{award.name|slugify}}" title="{{ award.description }}" class="medal"><span class="badge{{ award.type }}">&#9679;</span>&nbsp;{{ award.name }}</a><span class="tag-number"> &#215; {{ count|intcomma }}</span><br/>
145                             {% if forloop.counter|divisibleby:"6" %}
146                                 </td>
147                                 <td width="180" style="line-height:35px">
148                             {% endif %}
149                         {% endfor %}
150                     </td>
151                 </tr>
152             </table>
153         </div>
154 {% endblock %}
155 <!-- end user_stats.html -->