1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-06 09:21:54 +00:00

[contact_email] modified 'share popup' & 'user profile'

This commit is contained in:
llj
2016-07-05 16:02:33 +08:00
parent 532ae5357d
commit 8bd80118b2
4 changed files with 39 additions and 27 deletions

View File

@@ -77,6 +77,7 @@
.icon-eye:before { content: "\f06e"; } .icon-eye:before { content: "\f06e"; }
.icon-eye-slash:before { content: "\f070"; } .icon-eye-slash:before { content: "\f070"; }
.icon-plus-square:before { content: "\f0fe"; } .icon-plus-square:before { content: "\f0fe"; }
.icon-envelope:before { content: "\f0e0"; }
.fa-1x { .fa-1x {
font-size: 1.3em; font-size: 1.3em;
} }
@@ -3145,18 +3146,18 @@ button.dropdown-toggle:focus {
#user-profile .avatar { #user-profile .avatar {
border-radius: 0; border-radius: 0;
} }
#user-profile p { .user-profile-nickname {
padding: 8px 15px; padding: 8px 15px;
margin: 0; margin: 0;
}
#user-profile .nickname {
font-size: 18px; font-size: 18px;
} }
#user-profile .info { .user-profile-info {
padding: 8px 15px;
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
#user-profile .info-detail { .user-profile-info-icon {
padding-left: 6px; display:inline-block;
width:1.4em;
} }
/* shared file view */ /* shared file view */
#shared-file-view-hd .cur-path, #shared-file-view-hd .cur-path,

View File

@@ -5,23 +5,30 @@
<div id="user-profile"> <div id="user-profile">
{% if user %} {% if user %}
{% avatar user.username 290 %} {% avatar user.username 290 %}
<p title="{{ nickname }}" class="user-profile-nickname ellipsis">{{ nickname }}</p>
<ul>
{% if d_profile %}
{% if d_profile.department %}
<li title="{{ d_profile.department }}" class="user-profile-info ellipsis">
<span class="user-profile-info-icon icon-building fa-1x vam"></span>
<span class="vam">{{ d_profile.department }}</span>
</li>
{% endif %}
{% if d_profile.telephone %}
<li title="{{ d_profile.telephone }}" class="user-profile-info ellipsis">
<span class="user-profile-info-icon icon-phone fa-1x vam"></span>
<span class="vam">{{ d_profile.telephone }}</span>
</li>
{% endif %}
{% endif %}
<li title="{{ contact_email }}" class="user-profile-info ellipsis">
<span class="user-profile-info-icon icon-envelope fa-1x vam"></span>
<span class="vam">{{ contact_email }}</span>
</li>
</ul>
{% else %} {% else %}
{% avatar "" 290 %} {% avatar "" 290 %}
{% endif %} {% endif %}
<p title="{{ nickname }}" class="nickname ellipsis">{{ nickname }}</p>
{% if d_profile %}
{% if d_profile.department %}
<p title="{{ d_profile.department }}" class="info ellipsis">
<span class="icon-building fa-1x vam"></span>
<span class="info-detail vam">{{ d_profile.department }}</span>
</p>
{% endif %}
{% if d_profile.telephone %}
<p title="{{ d_profile.telephone }}" class="info ellipsis">
<span class="icon-phone fa-1x vam"></span>
<span class="info-detail vam">{{ d_profile.telephone }}</span>
</p>
{% endif %}
{% endif %}
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -94,17 +94,20 @@ def user_profile(request, username):
else: else:
user = None user = None
nickname = '' if user is None else email2nickname(user.username)
if user is not None: 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( d_profile = DetailedProfile.objects.get_detailed_profile_by_user(
user.username) user.username)
else: else:
nickname = ''
contact_email = ''
d_profile = None d_profile = None
return render_to_response('profile/user_profile.html', { return render_to_response('profile/user_profile.html', {
'user': user, 'user': user,
'nickname': nickname, 'nickname': nickname,
'contact_email': contact_email,
'd_profile': d_profile, 'd_profile': d_profile,
}, context_instance=RequestContext(request)) }, context_instance=RequestContext(request))

View File

@@ -559,8 +559,9 @@ define([
"id": users[i].email, "id": users[i].email,
// for search. both name & email can be searched. // for search. both name & email can be searched.
// use ' '(space) to separate name & email // 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, "avatar_url": users[i].avatar_url,
"contact_email": users[i].contact_email,
"name": users[i].name "name": users[i].name
}); });
} }
@@ -574,7 +575,7 @@ define([
// format items shown in the drop-down menu // format items shown in the drop-down menu
formatResult: function(item) { formatResult: function(item) {
if (item.avatar_url) { if (item.avatar_url) {
return '<img src="' + item.avatar_url + '" width="32" height="32" class="avatar"><span class="text ellipsis">' + _this.HTMLescape(item.name) + '<br />' + _this.HTMLescape(item.id) + '</span>'; return '<img src="' + item.avatar_url + '" width="32" height="32" class="avatar"><span class="text ellipsis">' + _this.HTMLescape(item.name) + '<br />' + _this.HTMLescape(item.contact_email) + '</span>';
} else { } else {
return; // if no match, show nothing return; // if no match, show nothing
} }