]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/users/stats.html
the variable needs to be defined with var in front of it, because otherwise it is...
[osqa.git] / forum / skins / default / templates / users / stats.html
index 35c344adc5bb1145a8a855858f34f6cacbd4896f..358771dd59b912bc373ec93951daf41f07413dc8 100644 (file)
@@ -6,50 +6,44 @@
 {% load humanize %}
 {% load question_list_tags %}
                {% block usercontent %}
-
-               {% declare %}
-                   question_count = questions.count()
-                   show_more_questions_link = question_count > 15
-                   questions = questions[:15]
-
-                   answer_count = answers.count()
-                   show_more_answers_link = answer_count > 30
-                   answers = answers[:30]
-               {% enddeclare %}
-       
+    <div id="questionsBlock" class="userSection">
         <a name="questions"></a>
         {% spaceless %}
             <h2>
-                {% blocktrans count question_count as counter %}
-                <span class="count">1</span> Question
+                {% blocktrans count questions.paginator.count as counter %}
+                <span class="count">{{counter}}</span> Question
                 {% plural %}
                 <span class="count">{{counter}}</span> Questions
                 {% endblocktrans %}
+                <a class="feed-icon" style="background-image:url('{% media "media/images/feed-icon-small.png" %}');"
+                    href="{{ view_user.get_asked_url }}?type=rss" title="{% trans "subscribe to question RSS feed" %}"></a>
             </h2>
         {% endspaceless %}
-               <div class="user-stats-table">
-                   {% for question in questions %}
+        <div id="questionTabs">{{ questions.paginator.sort_tabs }}</div>
+               <div id="listA" class="user-stats-table">
+                   {% for question in questions.paginator.page %}
                        {% question_list_item question favorite_count=yes signature_type=badges %}
                    {% endfor %}
-            {% if show_more_questions_link %}
-                <div class="short-summary"  style="text-align: right">
-                    <a href="{{ view_user.get_asked_url }}">{% blocktrans with view_user.username as username %}View all questions by {{ username }}{% endblocktrans %}</a>
-                </div>
-            {% endif %}
                </div>
                <br clear="all"/>
+               <div class="pager">{{ questions.paginator.page_numbers }}</div>
+               <br clear="all"/>
+    </div>
+
+    <div id="answersBlock" class="userSection">
         <a name="answers"></a>
         {% spaceless %}
             <h2>
-                {% blocktrans count answer_count as counter %}
-                <span class="count">1</span> Answer
+                {% blocktrans count answers.paginator.count as counter %}
+                <span class="count">{{counter}}</span> Answer
                 {% plural %}
                 <span class="count">{{counter}}</span> Answers
                 {% endblocktrans %}
             </h2>
         {% endspaceless %}
+        <div id="answerTabs">{{ answers.paginator.sort_tabs }}</div>
         <div class="user-stats-table">
-            {% for answer in answers %}
+            {% for answer in answers.paginator.page %}
             <div class="answer-summary">
                 <a title="{{answer.question.title}}"
                     href="{{ answer.get_absolute_url }}">
                 </div>
             </div>
             {% endfor %}
-            {% if show_more_answers_link %}
-                <div class="short-summary"  style="text-align: right">
-                    <a href="{{ view_user.get_answered_url }}">{% blocktrans with view_user.username as username %}View all questions answered by {{ username }}{% endblocktrans %}</a>
-                </div>
-            {% endif %}
         </div>
         <br clear="all"/>
+               <div class="pager">{{ answers.paginator.page_numbers }}</div>
+        <br clear="all"/>
+    </div>
+
+
         <a name="votes"></a>
         {% spaceless %}
             <h2>
                 {% blocktrans count total_votes as cnt %}
-                    <span class="count">1</span> Vote
+                    <span class="count">{{cnt}}</span> Vote
                 {% plural %}
                     <span class="count">{{cnt}}</span> Votes
                 {% endblocktrans %}
         {% spaceless %}
             <h2>
                 {% blocktrans count user_tags|length as counter %}
-                    <span class="count">1</span> Tag
+                    <span class="count">{{counter}}</span> Tag
                 {% plural %}
                     <span class="count">{{counter}}</span> Tags
                 {% endblocktrans %}
         {% endspaceless %}
         <div class="user-stats-table">
             <table class="tags">
-                <tr>
-                    <td width="180" valign="top">
+                <tr style="vertical-align: top;">
+                    <td valign="top" style="padding-right: 20px;">
                         {% for tag in user_tags%}
                         <a rel="tag" 
-                                                       title="{% blocktrans with tag.name as tag_name %}see other questions with {{view_user}}'s contributions tagged '{{ tag_name }}' {% endblocktrans %}" 
+                            class="tag-link-{{ tag.name }}"
+                                                       title="{% blocktrans with tag.name as tag_name %}see other questions with {{view_user}}'s contributions tagged '{{ tag_name }}' {% endblocktrans %}"
                                                        href="{% url tag_questions tag|urlencode %}?user={{view_user.username}}">{{tag.name}}</a>
                         <span class="tag-number">&#215; {{ tag.user_tag_usage_count|intcomma }}</span><br/>
                             {% if forloop.counter|divisibleby:"10" %}
         {% spaceless %}
         <h2>
             {% blocktrans count total_awards as counter %}
-            <span class="count">1</span> Badge
+            <span class="count">{{counter}}</span> Badge
             {% plural %}
             <span class="count">{{counter}}</span> Badges
             {% endblocktrans %}
         {% endspaceless %}
         <div class="user-stats-table">
             <table>
-                <tr>
-                    <td width="180" style="line-height:35px">
+                <tr style="vertical-align: top;">
+                    <td style="line-height:35px; padding-right: 20px;">
                         {% for award, count in awards %}
-                            <a href="{% url badges %}{{award.id}}/{{award.name}}" 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/>
+                            {% spaceless %}
+                            <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>
+                            {% ifnotequal count 1 %}
+                                <span class="tag-number"> &#215; {{ count|intcomma }}</span>
+                            {% endifnotequal %}<br/>
                             {% if forloop.counter|divisibleby:"6" %}
                                 </td>
                                 <td width="180" style="line-height:35px">
                             {% endif %}
+                            {% endspaceless %}
                         {% endfor %}
                     </td>
                 </tr>