diff --git a/media/css/seahub.css b/media/css/seahub.css
index 4d39adfa58..3805a30abd 100644
--- a/media/css/seahub.css
+++ b/media/css/seahub.css
@@ -77,6 +77,7 @@
.icon-eye:before { content: "\f06e"; }
.icon-eye-slash:before { content: "\f070"; }
.icon-plus-square:before { content: "\f0fe"; }
+.icon-envelope:before { content: "\f0e0"; }
.fa-1x {
font-size: 1.3em;
}
@@ -3145,18 +3146,18 @@ button.dropdown-toggle:focus {
#user-profile .avatar {
border-radius: 0;
}
-#user-profile p {
+.user-profile-nickname {
padding: 8px 15px;
margin: 0;
-}
-#user-profile .nickname {
font-size: 18px;
}
-#user-profile .info {
+.user-profile-info {
+ padding: 8px 15px;
border-top: 1px solid #eee;
}
-#user-profile .info-detail {
- padding-left: 6px;
+.user-profile-info-icon {
+ display:inline-block;
+ width:1.4em;
}
/* shared file view */
#shared-file-view-hd .cur-path,
diff --git a/seahub/profile/templates/profile/user_profile.html b/seahub/profile/templates/profile/user_profile.html
index 1b9057b9e4..dd9685ce3d 100644
--- a/seahub/profile/templates/profile/user_profile.html
+++ b/seahub/profile/templates/profile/user_profile.html
@@ -3,25 +3,32 @@
{% block main_panel %}
- {% if user %}
+{% if user %}
{% avatar user.username 290 %}
- {% else %}
- {% avatar "" 290 %}
- {% endif %}
-
{{ nickname }}
- {% if d_profile %}
+
{{ nickname }}
+
+ {% if d_profile %}
{% if d_profile.department %}
-
-
- {{ d_profile.department }}
-
+ -
+
+ {{ d_profile.department }}
+
{% endif %}
{% if d_profile.telephone %}
-
-
- {{ d_profile.telephone }}
-
+ -
+
+ {{ d_profile.telephone }}
+
{% endif %}
- {% endif %}
+ {% endif %}
+ -
+
+ {{ contact_email }}
+
+
+
+{% else %}
+ {% avatar "" 290 %}
+{% endif %}
{% endblock %}
diff --git a/seahub/profile/views.py b/seahub/profile/views.py
index 9ba174b7b3..596be414d0 100644
--- a/seahub/profile/views.py
+++ b/seahub/profile/views.py
@@ -94,17 +94,20 @@ def user_profile(request, username):
else:
user = None
- nickname = '' if user is None else email2nickname(user.username)
-
if user is not None:
+ nickname = email2nickname(user.username)
+ contact_email = Profile.objects.get_contact_email_by_user(user.username)
d_profile = DetailedProfile.objects.get_detailed_profile_by_user(
user.username)
else:
+ nickname = ''
+ contact_email = ''
d_profile = None
return render_to_response('profile/user_profile.html', {
'user': user,
'nickname': nickname,
+ 'contact_email': contact_email,
'd_profile': d_profile,
}, context_instance=RequestContext(request))
diff --git a/static/scripts/common.js b/static/scripts/common.js
index 25610e08cd..7586918d61 100644
--- a/static/scripts/common.js
+++ b/static/scripts/common.js
@@ -546,12 +546,12 @@ define([
dataType: 'json',
delay: 250,
cache: true,
- data: function (params) {
+ data: function(params) {
return {
q: params
};
},
- results: function (data) {
+ results: function(data) {
var user_list = [], users = data['users'];
for (var i = 0, len = users.length; i < len; i++) {
@@ -559,8 +559,9 @@ define([
"id": users[i].email,
// for search. both name & email can be searched.
// use ' '(space) to separate name & email
- "text": users[i].name + ' ' + users[i].email,
+ "text": users[i].name + ' ' + users[i].contact_email,
"avatar_url": users[i].avatar_url,
+ "contact_email": users[i].contact_email,
"name": users[i].name
});
}
@@ -574,7 +575,7 @@ define([
// format items shown in the drop-down menu
formatResult: function(item) {
if (item.avatar_url) {
- return '
' + _this.HTMLescape(item.name) + '
' + _this.HTMLescape(item.id) + '';
+ return '
' + _this.HTMLescape(item.name) + '
' + _this.HTMLescape(item.contact_email) + '';
} else {
return; // if no match, show nothing
}