]> 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 96a1f36d17723a57b500ce098baf08becd422e53..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
             <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 class="answer-link">
                     {% spaceless %}
-                    <a href="{{ answer.get_absolute_url }}#{{answer.id}}">{{answer.question.title}}</a>
+                    <a href="{{ answer.get_absolute_url }}">{{answer.headline}}</a>
                     {% endspaceless %}
-                    {% if answer.comment_count %}
-                    <span>
-                                   {% blocktrans count answer.comment_count as comment_count %}
-                    (one comment)
-                    {% plural %}
-                    the answer has been commented {{comment_count}} times
-                    {% endblocktrans %}
-                    </span> 
-                    {% endif %}
                 </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>
             <table>
                 <tr>
                     <td width="180" style="line-height:35px">
-                        {% for award 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; {{ award.count|intcomma }}</span><br/>
+                        {% 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/>
                             {% if forloop.counter|divisibleby:"6" %}
                                 </td>
                                 <td width="180" style="line-height:35px">