From 9a7fa79a176ea17fb5da90e662bf0a5215386607 Mon Sep 17 00:00:00 2001 From: llj Date: Fri, 22 Jun 2012 11:51:26 +0800 Subject: [PATCH] improved set_profile --- media/css/seahub.css | 19 ++++++++++++++----- profile/templates/profile/set_profile.html | 11 ++++++++--- profile/templates/profile/user_ids.html | 9 --------- profile/views.py | 4 +++- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/media/css/seahub.css b/media/css/seahub.css index 5cf7a5f13d..8ef1e33240 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -212,19 +212,28 @@ p.path, p.access-notice { margin: 12px 0 6px 0; } margin:12px 0 15px; } #user-basic-info label { - width:5em; + text-align:right; + width:5.5em; + margin-right:1em; +} +#user-basic-info .avatar, +#user-basic-info textarea { + vertical-align:text-top; +} +#user-basic-info .avatar, +#user-basic-info .text-input, +#user-basic-info textarea { + margin-bottom:8px; } #user-basic-info .text-input, #user-basic-info textarea { width:260px; - margin-bottom:5px; } #user-basic-info textarea { - vertical-align:text-top; - height:150px; + height:70px; } #user-basic-info .submit { - margin-left:5em; + margin-left:6.5em; } /*narrow-panel: for form pages*/ diff --git a/profile/templates/profile/set_profile.html b/profile/templates/profile/set_profile.html index 7321f61e49..657579bc5c 100644 --- a/profile/templates/profile/set_profile.html +++ b/profile/templates/profile/set_profile.html @@ -1,10 +1,9 @@ {% extends "profile/profile_base.html" %} +{% load avatar_tags %} {% block left_panel %}

操作

{% endblock %} @@ -12,9 +11,15 @@ {% block right_panel %}

个人基本信息修改

+{% if modified %} +

修改成功。

+{% endif %}
+ {% avatar request.user.username 60 %} + 更改
+ 更改

-
+
diff --git a/profile/templates/profile/user_ids.html b/profile/templates/profile/user_ids.html index 415d00e5ac..fb7cf6539c 100644 --- a/profile/templates/profile/user_ids.html +++ b/profile/templates/profile/user_ids.html @@ -1,14 +1,5 @@ {% extends "profile/profile_base.html" %} -{% block left_panel %} -

操作

- -{% endblock %} - {% block right_panel %}

所有已登录的计算机

{% if peers %} diff --git a/profile/views.py b/profile/views.py index 0811891bb2..03c934789a 100644 --- a/profile/views.py +++ b/profile/views.py @@ -40,9 +40,10 @@ def edit_profile(request): profile = Profile.objects.filter(user=request.user.username)[0] if request.method == 'GET': - pass + modified = False if request.method == 'POST': + modified = True new_nickname = request.POST.get('nickname', '') new_intro = request.POST.get('intro', '') @@ -57,6 +58,7 @@ def edit_profile(request): return render_to_response('profile/set_profile.html', { 'nickname':profile.nickname, 'intro':profile.intro, + 'modified':modified, }, context_instance=RequestContext(request))