forked from OSQA/osqa
-
Notifications
You must be signed in to change notification settings - Fork 623
Expand file tree
/
Copy pathuser_info.html
More file actions
181 lines (178 loc) · 7.73 KB
/
Copy pathuser_info.html
File metadata and controls
181 lines (178 loc) · 7.73 KB
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
<!-- user_info.html -->
{% import "macros.html" as macros %}
{% if show_moderation_warning %}
<div class="user-memo">
{% trans %}Note: the homepage link and the about section won't be shown to other users until your profile is approved by the moderators.{% endtrans %}
</div>
{% endif %}
<div class="user-info-table">
<div class="col1">
<div class='avatar'>
{{ macros.gravatar(view_user, 128) }}
{% if request.user.pk == view_user.pk %}
<p><a
{% if support_custom_avatars %}
href="{% url askbot_avatar_show_list view_user.id %}"
{% else %}
href="{% url faq %}#gravatar"
{% endif %}
>{% trans %}change picture{% endtrans %}</a></p>
{% endif %}
</div>
{% if can_show_karma %}
<div class="scoreNumber">{{ view_user.get_localized_profile().get_reputation()|intcomma }}</div>
<p><b style="color:#777;">{% trans %}karma{% endtrans %}</b></p>
{% endif %}
{% if user_follow_feature_on and request.user != view_user %}
{# User follow button #}
{% if request.user.is_authenticated() %}
{% set is_following = request.user.is_following(view_user) %}
{% else %}
{% set is_following = False %}
{% endif %}
<button class="js-follow-user button large"
data-is-on="{{ is_following|as_js_bool }}"
data-off-prompt-text="{% trans %}unfollow{% endtrans %}"
data-on-prompt-text="{% trans %}follow{% endtrans %}"
data-min-lines="10"
data-on-state-text="{% trans %}following{% endtrans %}"
data-off-state-text="{% trans %}follow{% endtrans %}"
data-toggle-url="{% url 'toggle_follow_object' model_name='user', object_id=view_user.id %}"
>
{% if is_following %}
{% trans %}following{% endtrans %}
{% else %}
{% trans %}follow{% endtrans %}
{% endif %}
</button>
{% endif %}
</div>
<div class="col2">
<table class="user-details">
{% if request.user.is_authenticated() and (request.user.pk == view_user.pk or request.user.is_administrator_or_moderator()) %}
<tr>
<td class="user-profile-tool-links" align="left" colspan="2">
<a href="{% url edit_user view_user.id %}">
{% trans %}update profile{% endtrans %}
</a>
{% if settings.USE_ASKBOT_LOGIN_SYSTEM and request.user.pk == view_user.pk and settings.ALLOW_ADD_REMOVE_LOGIN_METHODS %}
| <a href="{{ settings.LOGIN_URL }}?next={{ settings.LOGIN_URL }}">
{% trans %}manage login methods{% endtrans %}
</a>
{% endif %}
</td>
</tr>
{% endif %}
<tr>
<th colspan="2" align="left">
<h3>{{ view_user.get_status_display() }}</h3>
</th>
</tr>
{% if view_user.real_name %}
<tr>
<td>{% trans %}real name{% endtrans %}</td>
<td><b>{{view_user.real_name|escape}}</b></td>
</tr>
{% endif %}
{% if request.user|can_see_private_user_data(view_user) %}
<tr>
<td>{% trans %}email{% endtrans %}</td>
<td>{{view_user.email}}</td>
</tr>
{% endif %}
{% if settings.GROUPS_ENABLED %}
<tr>
<td>{% trans %}groups{% endtrans %}</td>
<td>
<div id="user-groups">
<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>
</td>
</tr>
{% endif %}
<tr>
<td>{% trans %}member since{% endtrans %}</td>
<td><strong>{{ macros.timeago(view_user.date_joined) }}</strong></td>
</tr>
{% if view_user.last_seen %}
<tr>
<td>{% trans %}last seen{% endtrans %}</td>
<td><strong title="{{ view_user.last_seen }}">{{ macros.timeago(view_user.last_seen) }}</strong></td>
</tr>
{% endif %}
{% if view_user.website and show_profile_info %}
<tr>
<td>{% trans %}website{% endtrans %}</td>
<td>{{ macros.user_website_link(
view_user,
max_display_length=30,
force_show=show_profile_info
)
}}</td>
</tr>
{% endif %}
{% if request.user == view_user and
settings.TWITTER_SECRET and
settings.TWITTER_KEY and
settings.ENABLE_SHARING_TWITTER
%}
{% include "user_profile/twitter_sharing_controls.html" %}
{% endif %}
{% if view_user.location or (view_user.country and view_user.country.code != 'none') %}
<tr>
<td>{% trans %}location{% endtrans %}</td>
<td>{{ macros.user_full_location(view_user) }}</td>
</tr>
{% endif %}
{% if view_user.date_of_birth %}
<tr>
<td>{% trans %}age, years{% endtrans %}</td>
<td>{{ view_user.date_of_birth|get_age }}</td>
</tr>
{% endif %}
{% if votes_today_left %}
<tr>
<td>{% trans %}todays unused votes{% endtrans %}</td>
<td><strong class="darkred">{{ votes_today_left }}</strong> {% trans %}votes left{% endtrans %}</td>
</tr>
{% endif %}
</table>
</div>
<div class="col3 user-about">
{% if show_profile_info %}
{% set editable=(request.user.is_authenticated()
and (
(request.user == view_user) or request.user.is_admin_or_mod()
)
) %}
{% if editable %}
<div class="js-editable"
id="js-user-about-{{ view_user.pk}}"
{# urls below are parsed and parameters added as part of request #}
data-get-text-url="{% url get_user_description %}?user_id={{ view_user.pk }}"
data-save-text-url="{% url set_user_description %}?user_id={{ view_user.pk }}"
data-save-text-param-name="description"
data-validated-text-param-name="description_html"
data-editor-type="{{ settings.EDITOR_TYPE }}"
data-previewer-enabled="false"
>
<div class="js-editable-content">{{ view_user.get_localized_profile().about|convert_text }}</div>
<div class="js-editable-controls">
<button id="js-edit-btn-user-about-{{ view_user.pk }}">{% trans %}edit{% endtrans %}</button>
</div>
</div>
{% else %}
{{ view_user.get_localized_profile().about|convert_text }}
{% endif %}
{% endif %}
</div>
</div>
<!-- end user_info.html -->