summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-12-15 15:00:11 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-12-15 15:00:11 -0300
commit803ee84f5b821decd41ab3f05f95c40705a7a0d7 (patch)
tree7ca420637bb22daf52420554d8975a79ddb94b38
parent640a08c277a697cff38ff9e2784fab889098ca09 (diff)
downloadaskbot-803ee84f5b821decd41ab3f05f95c40705a7a0d7.tar.gz
askbot-803ee84f5b821decd41ab3f05f95c40705a7a0d7.tar.bz2
askbot-803ee84f5b821decd41ab3f05f95c40705a7a0d7.zip
Radim's fix for the user profile page
-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)