mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-06 01:12:03 +00:00
[contact_email] modified 'share popup' & 'user profile'
This commit is contained in:
@@ -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,
|
||||||
|
@@ -3,25 +3,32 @@
|
|||||||
|
|
||||||
{% block main_panel %}
|
{% block main_panel %}
|
||||||
<div id="user-profile">
|
<div id="user-profile">
|
||||||
{% if user %}
|
{% if user %}
|
||||||
{% avatar user.username 290 %}
|
{% avatar user.username 290 %}
|
||||||
{% else %}
|
<p title="{{ nickname }}" class="user-profile-nickname ellipsis">{{ nickname }}</p>
|
||||||
{% avatar "" 290 %}
|
<ul>
|
||||||
{% endif %}
|
{% if d_profile %}
|
||||||
<p title="{{ nickname }}" class="nickname ellipsis">{{ nickname }}</p>
|
|
||||||
{% if d_profile %}
|
|
||||||
{% if d_profile.department %}
|
{% if d_profile.department %}
|
||||||
<p title="{{ d_profile.department }}" class="info ellipsis">
|
<li title="{{ d_profile.department }}" class="user-profile-info ellipsis">
|
||||||
<span class="icon-building fa-1x vam"></span>
|
<span class="user-profile-info-icon icon-building fa-1x vam"></span>
|
||||||
<span class="info-detail vam">{{ d_profile.department }}</span>
|
<span class="vam">{{ d_profile.department }}</span>
|
||||||
</p>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if d_profile.telephone %}
|
{% if d_profile.telephone %}
|
||||||
<p title="{{ d_profile.telephone }}" class="info ellipsis">
|
<li title="{{ d_profile.telephone }}" class="user-profile-info ellipsis">
|
||||||
<span class="icon-phone fa-1x vam"></span>
|
<span class="user-profile-info-icon icon-phone fa-1x vam"></span>
|
||||||
<span class="info-detail vam">{{ d_profile.telephone }}</span>
|
<span class="vam">{{ d_profile.telephone }}</span>
|
||||||
</p>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% 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 %}
|
||||||
|
{% avatar "" 290 %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -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))
|
||||||
|
|
||||||
|
@@ -546,12 +546,12 @@ define([
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
delay: 250,
|
delay: 250,
|
||||||
cache: true,
|
cache: true,
|
||||||
data: function (params) {
|
data: function(params) {
|
||||||
return {
|
return {
|
||||||
q: params
|
q: params
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
results: function (data) {
|
results: function(data) {
|
||||||
var user_list = [], users = data['users'];
|
var user_list = [], users = data['users'];
|
||||||
|
|
||||||
for (var i = 0, len = users.length; i < len; i++) {
|
for (var i = 0, len = users.length; i < len; i++) {
|
||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user