]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/users/stats.html
Adds user based question listings and context sensitive rss feeds.
[osqa.git] / forum / skins / default / templates / users / stats.html
index adc6e12652151fb8728ed11d905308b0c830edf1..35c344adc5bb1145a8a855858f34f6cacbd4896f 100644 (file)
@@ -6,11 +6,21 @@
 {% 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 %}
        
         <a name="questions"></a>
         {% spaceless %}
             <h2>
-                {% blocktrans count questions|length as counter %}
+                {% blocktrans count question_count as counter %}
                 <span class="count">1</span> Question
                 {% plural %}
                 <span class="count">{{counter}}</span> Questions
                    {% for question in questions %}
                        {% 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"/>
         <a name="answers"></a>
         {% spaceless %}
             <h2>
-                {% blocktrans count answers|length as counter %}
+                {% blocktrans count answer_count as counter %}
                 <span class="count">1</span> Answer
                 {% plural %}
                 <span class="count">{{counter}}</span> Answers
@@ -38,8 +53,8 @@
             <div class="answer-summary">
                 <a title="{{answer.question.title}}"
                     href="{{ answer.get_absolute_url }}">
-                    <span class="{% if answer.accepted %}answered-accepted {% endif %} answer-votes" 
-                                               title="{% blocktrans with answer.score as vote_count %}the answer has been voted for {{ vote_count }} times{% endblocktrans %} {% if answer.accepted %}{% trans "this answer has been selected as correct" %}{%endif%}">
+                    <span class="{% if answer.nis.accepted %}answered-accepted {% endif %} answer-votes" 
+                                               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%}">
                         {{ answer.score }}
                     </span>
                 </a>
                 </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/>
+        <br clear="all"/>
         <a name="votes"></a>
         {% spaceless %}
             <h2>