diff --git a/contacts/templates/contacts/contact_add.html b/contacts/templates/contacts/contact_add.html index babcfcb82a..156d066c8a 100644 --- a/contacts/templates/contacts/contact_add.html +++ b/contacts/templates/contacts/contact_add.html @@ -32,4 +32,3 @@ $('input[type="submit"]').click(function() { }); {% endblock %} - diff --git a/group/templates/group/group_info.html b/group/templates/group/group_info.html index cd3153f655..d1b9db1b4b 100644 --- a/group/templates/group/group_info.html +++ b/group/templates/group/group_info.html @@ -9,7 +9,11 @@

管理员

@@ -17,7 +21,11 @@ {% if common_members %} {% else %} diff --git a/media/css/seahub.css b/media/css/seahub.css index 2426040253..c316b47eb3 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -373,14 +373,17 @@ h2.repo-history { .contact-list-link:hover { text-decoration:none; } -/* group */ -.group-member .avatar { +/* group, org */ +.group-member .avatar, +.org-member .avatar { border-radius: 2px; -moz-border-radius: 2px; margin-right: 5px; } .group-member .avatar, -.group-member-name { +.group-member-name, +.org-member .avatar, +.org-member-name { vertical-align:middle; } #member-add { @@ -394,13 +397,26 @@ h2.repo-history { /* notification admin */ .cur-note { color: red; font-size: 75%; } -/* org */ -.org-member .avatar { - border-radius: 2px; - -moz-border-radius: 2px; - margin-right: 5px; +/*user-profile*/ +.user-profile .pic { + width:80px; + text-align:center; + margin-right:20px; } -.org-member .avatar, -.org-member-name { - vertical-align:middle; +.user-profile .avatar { + border-radius:4px; + -moz-border-radius:4px; + margin-bottom:5px; +} +.user-profile .txt { + width:225px; + word-wrap:break-word; +} +.user-profile .txt p { + margin-bottom:4px; +} +.user-profile .intro { + color:#444; + font-size:12px; + margin-top:10px; } diff --git a/profile/templates/profile/user_profile.html b/profile/templates/profile/user_profile.html new file mode 100644 index 0000000000..51a311c69d --- /dev/null +++ b/profile/templates/profile/user_profile.html @@ -0,0 +1,48 @@ +{% extends "profile/profile_base.html" %} +{% load avatar_tags %} + +{% block main_panel %} +{% if not err_msg %} +
+
+ {% avatar email 80 %} + +
+ +
+ {% if nickname %} +

{{ nickname }}

+ {% endif %} + +

{{ email }}

+ + {% if intro %} +

{{ intro }}

+ {% endif %} +
+ +
+ +
+
+
+
+
+
+ +
+
+{% else %} +
+

{{ err_msg }}

+
+{% endif %} +{% endblock %} + +{% block extra_script %} + +{% endblock %} diff --git a/profile/urls.py b/profile/urls.py index 50e1e4088d..4751c87bba 100644 --- a/profile/urls.py +++ b/profile/urls.py @@ -3,5 +3,6 @@ from django.conf.urls.defaults import * urlpatterns = patterns('profile.views', url(r'^list_user/$', 'list_userids', name="list_userids"), url(r'^$', 'edit_profile', name="edit_profile"), + url(r'^user/$', 'user_profile', name="user_profile"), url(r'^logout/$', 'logout_relay', name="logout_relay"), ) diff --git a/profile/views.py b/profile/views.py index ba35d2d143..0811891bb2 100644 --- a/profile/views.py +++ b/profile/views.py @@ -1,3 +1,4 @@ +# encoding: utf-8 from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 @@ -58,3 +59,35 @@ def edit_profile(request): 'intro':profile.intro, }, context_instance=RequestContext(request)) + +def user_profile(request): + user = request.GET.get('user', '') + + user_nickname = '' + user_intro = '' + err_msg = '' + + if user: + try: + user_check = ccnet_rpc.get_emailuser(user) + except: + user_check = None + + if user_check: + profile = Profile.objects.filter(user=user) + if profile: + profile = profile[0] + user_nickname = profile.nickname + user_intro = profile.intro + else: + err_msg = '该用户不存在' + else: + err_msg = '该用户不存在' + + return render_to_response('profile/user_profile.html', { + 'email': user, + 'nickname':user_nickname, + 'intro':user_intro, + 'err_msg':err_msg, + }, + context_instance=RequestContext(request))