mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 06:33:48 +00:00
improved set_profile
This commit is contained in:
@@ -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*/
|
||||
|
@@ -1,10 +1,9 @@
|
||||
{% extends "profile/profile_base.html" %}
|
||||
{% load avatar_tags %}
|
||||
|
||||
{% block left_panel %}
|
||||
<h3>操作</h3>
|
||||
<ul class="with-bg">
|
||||
<li><a href="{{ SITE_ROOT }}avatar/add/">上传头像</a></li>
|
||||
<li><a href="{{ SITE_ROOT }}accounts/password/change/">修改网站帐号密码</a></li>
|
||||
<li><a href="{{ SITE_ROOT }}profile/list_user/">所有已登录的计算机</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
@@ -12,9 +11,15 @@
|
||||
{% block right_panel %}
|
||||
<div id="user-basic-info">
|
||||
<h2>个人基本信息修改</h2>
|
||||
{% if modified %}
|
||||
<p class="notification">修改成功。</p>
|
||||
{% endif %}
|
||||
<form action="" method="post">
|
||||
<label>头像:</label>{% avatar request.user.username 60 %}
|
||||
<a href="{{ SITE_ROOT }}avatar/add/">更改</a><br />
|
||||
<label>密码:</label><a href="{{ SITE_ROOT }}accounts/password/change/">更改</a><br/>
|
||||
<label>昵称:</label><input type="text" name="nickname" value="{{ nickname }}" class="text-input" /><br/>
|
||||
<label>自我介绍:</label><textarea name="intro">{{ intro }}</textarea><br />
|
||||
<label>一句话介绍:</label><textarea name="intro">{{ intro }}</textarea><br />
|
||||
<input type="submit" value="提交" class="submit" />
|
||||
</form>
|
||||
</div>
|
||||
|
@@ -1,14 +1,5 @@
|
||||
{% extends "profile/profile_base.html" %}
|
||||
|
||||
{% block left_panel %}
|
||||
<h3>操作</h3>
|
||||
<ul class="with-bg">
|
||||
<li><a href="{{ SITE_ROOT }}profile/">修改昵称等基本信息</a></li>
|
||||
<li><a href="{{ SITE_ROOT }}avatar/add/">上传头像</a></li>
|
||||
<li><a href="{{ SITE_ROOT }}accounts/password/change/">修改网站帐号密码</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block right_panel %}
|
||||
<h2>所有已登录的计算机</h2>
|
||||
{% if peers %}
|
||||
|
@@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user