summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askbot/doc/source/contributors.rst1
-rw-r--r--askbot/skins/default/templates/user_profile/user_edit.html24
-rw-r--r--askbot/views/users.py3
3 files changed, 21 insertions, 7 deletions
diff --git a/askbot/doc/source/contributors.rst b/askbot/doc/source/contributors.rst
index 5da7076d..6285d9a6 100644
--- a/askbot/doc/source/contributors.rst
+++ b/askbot/doc/source/contributors.rst
@@ -34,6 +34,7 @@ Programming and documentation
* Rosandra Cuello Suñol
* `hjwp <https://github.com/hjwp>`_
* `Jacob Oscarson <http://www.aspektratio.net>`_
+* `Radim Řehůřek <https://github.com/piskvorky>`_
Translations
------------
diff --git a/askbot/skins/default/templates/user_profile/user_edit.html b/askbot/skins/default/templates/user_profile/user_edit.html
index 8f9dd62f..daaa3663 100644
--- a/askbot/skins/default/templates/user_profile/user_edit.html
+++ b/askbot/skins/default/templates/user_profile/user_edit.html
@@ -9,12 +9,24 @@
<div id="main-body" style="width:100%;padding-top:10px">
<form name="" action="{% url edit_user request.user.id %}" method="post">{% csrf_token %}
<div id="left" style="float:left;width:180px">
- {% if request.user.email %}
- {{ macros.gravatar(request.user, 128) }}
- {% else %}
- <img src="{{"/images/nophoto.png"|media}}">
- {% endif %}
- <br><a href="{% url faq %}#gravatar">{% trans %}change picture{% endtrans %}</a>
+ <div class='avatar'>
+ {{ macros.gravatar(view_user, 128) }}
+ {% if request.user == view_user %}
+ <p><a
+ {% if support_custom_avatars %}
+ href="{% url avatar_change %}"
+ {% else %}
+ href="{% url faq %}#gravatar"
+ {% endif %}
+ >{% trans %}change picture{% endtrans %}</a></p>
+ {% if support_custom_avatars %}
+ <p><a
+ href="{% url avatar_delete %}"
+ >{% trans %}remove{% endtrans %}</a>
+ </p>
+ {% endif %}
+ {% endif %}
+ </div>
</div>
<div style="float:right;width:750px;text-align:left;">
<h2>{% trans %}Registered user{% endtrans %}</h2>
diff --git a/askbot/views/users.py b/askbot/views/users.py
index 52e05842..935bf4fa 100644
--- a/askbot/views/users.py
+++ b/askbot/views/users.py
@@ -271,7 +271,8 @@ def edit_user(request, id):
'active_tab': 'users',
'page_class': 'user-profile-edit-page',
'form' : form,
- 'gravatar_faq_url' : reverse('faq') + '#gravatar',
+ 'support_custom_avatars': ('avatar' in django_settings.INSTALLED_APPS),
+ 'view_user': user,
}
return render_into_skin('user_profile/user_edit.html', data, request)