summaryrefslogtreecommitdiffstats
path: root/askbot/skins/default/templates/user_profile/user_stats.html
blob: 2ccc277f46a456d546040a9e0265405cc8854c49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
{% extends "user_profile/user.html" %}
{% import "macros.html" as macros %}
{% import "user_profile/macros.html" as user_profile_macros %}
<!-- user_stats.html -->
{% block profilesection %}
    {% trans %}overview{% endtrans %}
{% endblock %}
{% block usercontent %}
    {% include "user_profile/user_info.html" %}
    {% if settings.GROUPS_ENABLED %}
    <div id="user-groups">
        <h2>{% trans 
                username = view_user.username|escape
            %}{{username}}'s groups{% endtrans %}
        </h2>
        <table id="groups-list">
            {% for group in user_groups %}
            <tr>
                {{ macros.user_group(group, groups_membership_info[group.id]) }}
            </tr>
            {% endfor %}
        </table>
        <div class="clearfix"></div>
        <a id="add-group">{% trans %}add group{% endtrans %}</a>
    </div>
    {% endif %}
    <a name="questions"></a>
    {% spaceless %}
        <h2>{% trans counter=question_count %}<span class="count">{{counter}}</span> Question{% pluralize %}<span class="count">{{counter}}</span> Questions{% endtrans %}</h2>
    {% endspaceless %}
    {% include "user_profile/users_questions.html" %}
    <a name="answers"></a>
    {% spaceless %}
        <h2 style="clear:both;"><span class="count">{{ top_answer_count }}</span> {% trans counter=top_answer_count %}Answer{% pluralize %}Answers{% endtrans %}</h2>
    {% endspaceless %}
    <div class="user-stats-table">
        {% for top_answer in top_answers %}
        <div class="answer-summary">
            <a title="{{ top_answer.summary|collapse|escape }}"
                href="{% url question top_answer.thread._question_post().id %}{{ top_answer.thread.title|slugify }}#{{ top_answer.id }}">
                <span class="answer-votes {% if top_answer.accepted() %}answered-accepted{% endif %}"
                      title="{% trans answer_score=top_answer.score %}the answer has been voted for {{ answer_score }} times{% endtrans %} {% if top_answer.accepted() %}{% trans %}this answer has been selected as correct{% endtrans %}{%endif%}">
                    {{ top_answer.score }}
                </span>
            </a>
            <div class="answer-link">
                {% spaceless %}
                <a href="{% url question top_answer.thread._question_post().id %}{{ top_answer.thread.title|slugify }}#{{top_answer.id}}">{{ top_answer.thread.title|escape }}</a>
                {% endspaceless %}
                {% if top_answer.comment_count > 0 %}
                <span>
                    {% trans comment_count=top_answer.comment_count %}({{ comment_count }} comment){% pluralize %}the answer has been commented {{ comment_count }} times{% endtrans %}
                </span>
                {% endif %}
            </div>
        </div>
        {% endfor %}
    </div>
    <br/>
    <a name="votes"></a>
    {% spaceless %}
        <h2>{% trans cnt=total_votes %}<span class="count">{{cnt}}</span> Vote{% pluralize %}<span class="count">{{cnt}}</span> Votes {% endtrans %}</h2>
    {% endspaceless %}
    <div class="user-stats-table">
        <table>
            <tr>
                <td width="60">
                    <img style="cursor: default;" src="{{"/images/vote-arrow-up-on.png"|media}}" alt="{% trans %}thumb up{% endtrans %}" />
                        <span title="{% trans %}user has voted up this many times{% endtrans %}" class="vote-count">{{up_votes}}</span>
                </td>
                <td width="60">
                    <img style="cursor: default;" src="{{"/images/vote-arrow-down-on.png"|media}}" alt="{% trans %}thumb down{% endtrans %}" />
                        <span title="{% trans %}user voted down this many times{% endtrans %}" class="vote-count">{{down_votes}}</span>

                </td>
            </tr>
        </table>
    </div>
    <a name="tags"></a>
    {% spaceless %}
        <h2>{% trans counter=user_tags|length %}<span class="count">{{counter}}</span> Tag{% pluralize %}<span class="count">{{counter}}</span> Tags{% endtrans %}</h2>
    {% endspaceless %}
    <div class="user-stats-table">
        <table class="tags">
            <tr>
                <td valign="top">
                    <ul id="ab-user-tags" class="tags">
                    {% for tag in user_tags %}
                        <li>
                        {{ macros.tag_widget(
                            tag.name,
                            html_tag = 'div',
                            search_state = search_state,
                            truncate_long_tag = True,
                            extra_content =
                                '<span class="tag-number">&#215; ' ~
                                tag.user_tag_usage_count|intcomma ~
                                '</span>'
                           )
                        }}
                        </li>
                        {#
                        {% if loop.index is divisibleby 10 %}
                            </td>
                            <td width="180"  valign="top">
                        {% endif %}
                        #}
                    {% endfor %}
                    </ul>
                </td>
            </tr>
        </table>
    </div>
    {% if interesting_tag_names %}
        {{ user_profile_macros.tag_selection(interesting_tag_names, 'interesting') }}
    {% endif %}
    {% if ignored_tag_names %}
        {{ user_profile_macros.tag_selection(ignored_tag_names, 'ignored') }}
    {% endif %}
    {% if subscribed_tag_names %}
        {{ user_profile_macros.tag_selection(subscribed_tag_names, 'subscribed') }}
    {% endif %}
    {% if settings.BADGES_MODE == 'public' %}
    <a name="badges"></a>
    {% spaceless %}
    <h2>{% trans counter=total_badges %}<span class="count">{{counter}}</span> Badge{% pluralize %}<span class="count">{{counter}}</span> Badges{% endtrans %}</h2>
    {% endspaceless %}
    <div class="user-stats-table badges">
        <table>
            <tr>
                <td style="line-height:35px">
                    {% for badge, badge_user_awards in badges %}
                        <a
                            href="{{badge.get_absolute_url()}}"
                            title="{% trans description=badge.description %}{{description}}{% endtrans %}"
                            class="medal"
                        ><span class="{{ badge.css_class }}">&#9679;</span>&nbsp;{% trans name=badge.name %}{{name}}{% endtrans %}
                        </a>&nbsp;
                        <span class="tag-number">&#215;
                            <span class="badge-context-toggle">{{ badge_user_awards|length|intcomma }}</span>
                        </span>
                        <ul id="badge-context-{{ badge.id }}" class="badge-context-list" style="display:none">
                            {% for award in badge_user_awards %}
                                {% if award.content_object_is_post %}
                                <li>
                                    <a
                                        title="{{ award.content_object.get_snippet()|collapse }}"
                                        href="{{ award.content_object.get_absolute_url() }}"
                                    >{% if award.content_type.post_type == 'answer' %}{% trans %}Answer to:{% endtrans %}{% endif %} {{ award.content_object.thread.title|escape }}</a>
                                </li>
                                {% endif %}
                            {% endfor %}
                        </ul>
                        {% if loop.index is divisibleby 3 %}
                            </td></tr>
                            <tr><td style="line-height:35px">
                        {% endif %}
                    {% endfor %}
                </td>
            </tr>
        </table>
    </div>
    {% endif %}
{% endblock %}
{% block endjs %}
    {{ super() }}
    <script type="text/javascript">
        askbot['urls']['join_or_leave_group'] = '{% url join_or_leave_group %}';
        $(document).ready(function(){
            setup_badge_details_toggle();
            $.each($('.group-join-btn'), function(idx, elem){
                var group_join_btn = new GroupJoinButton();
                group_join_btn.decorate($(elem));
            });
        });
    </script>
    <script type='text/javascript' src='{{"/js/tag_selector.js"|media}}'></script>
	<script type="text/javascript">
	askbot['urls']['questions'] = '{% url "questions" %}';
	</script>
{% endblock %}
<!-- end user_stats.html -->