mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-19 07:27:56 +00:00
Merge pull request #1669 from haiwen/fix
fixed UI bugs for mv/del selected dirents; modified 'avatar'
This commit is contained in:
commit
4c5ca6292d
@ -54,7 +54,7 @@ def avatar(user, size=AVATAR_DEFAULT_SIZE):
|
|||||||
if not isinstance(user, User):
|
if not isinstance(user, User):
|
||||||
try:
|
try:
|
||||||
user = User.objects.get(email=user)
|
user = User.objects.get(email=user)
|
||||||
url = avatar_url(user, size)
|
url = avatar_url(user, size*2)
|
||||||
except User.DoesNotExist:
|
except User.DoesNotExist:
|
||||||
url = get_default_avatar_non_registered_url()
|
url = get_default_avatar_non_registered_url()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -63,7 +63,7 @@ def avatar(user, size=AVATAR_DEFAULT_SIZE):
|
|||||||
url = get_default_avatar_non_registered_url()
|
url = get_default_avatar_non_registered_url()
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
url = avatar_url(user, size)
|
url = avatar_url(user, size*2)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Catch exceptions to avoid 500 errors.
|
# Catch exceptions to avoid 500 errors.
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
|
@ -338,7 +338,7 @@ AVATAR_DEFAULT_URL = '/avatars/default.png'
|
|||||||
AVATAR_DEFAULT_NON_REGISTERED_URL = '/avatars/default-non-register.jpg'
|
AVATAR_DEFAULT_NON_REGISTERED_URL = '/avatars/default-non-register.jpg'
|
||||||
AVATAR_MAX_AVATARS_PER_USER = 1
|
AVATAR_MAX_AVATARS_PER_USER = 1
|
||||||
AVATAR_CACHE_TIMEOUT = 14 * 24 * 60 * 60
|
AVATAR_CACHE_TIMEOUT = 14 * 24 * 60 * 60
|
||||||
AUTO_GENERATE_AVATAR_SIZES = (16, 20, 24, 28, 32, 36, 40, 42, 48, 60, 64, 80, 84)
|
AUTO_GENERATE_AVATAR_SIZES = (16, 20, 24, 28, 32, 36, 40, 42, 48, 60, 64, 72, 80, 84, 96, 128, 160)
|
||||||
# Group avatar
|
# Group avatar
|
||||||
GROUP_AVATAR_STORAGE_DIR = 'avatars/groups'
|
GROUP_AVATAR_STORAGE_DIR = 'avatars/groups'
|
||||||
GROUP_AVATAR_DEFAULT_URL = 'avatars/groups/default.png'
|
GROUP_AVATAR_DEFAULT_URL = 'avatars/groups/default.png'
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<span class="meta-info split">
|
<span class="meta-info split">
|
||||||
<span class="author">
|
<span class="author">
|
||||||
{% if current_commit.props.creator_name %}
|
{% if current_commit.props.creator_name %}
|
||||||
<img src="{% avatar_url current_commit.props.creator_name 20 %}" width="20" class="avatar" />
|
<img src="{% avatar_url current_commit.props.creator_name 40 %}" width="20" class="avatar" />
|
||||||
<a class="name" href="{% url 'user_profile' current_commit.props.creator_name %}">{{ current_commit.props.creator_name|email2nickname }}</a>
|
<a class="name" href="{% url 'user_profile' current_commit.props.creator_name %}">{{ current_commit.props.creator_name|email2nickname }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% trans "Unknown"%}
|
{% trans "Unknown"%}
|
||||||
|
@ -1000,6 +1000,7 @@ define([
|
|||||||
_this.$('th .checkbox').removeClass('checkbox-checked');
|
_this.$('th .checkbox').removeClass('checkbox-checked');
|
||||||
_this.$('#multi-dirents-op').hide();
|
_this.$('#multi-dirents-op').hide();
|
||||||
_this.$('#cur-dir-ops').show();
|
_this.$('#cur-dir-ops').show();
|
||||||
|
_this.updateDirOpBarUI();
|
||||||
} else {
|
} else {
|
||||||
$(selected_dirents).each(function() {
|
$(selected_dirents).each(function() {
|
||||||
if (data['deleted'].indexOf(this.get('obj_name')) != -1) {
|
if (data['deleted'].indexOf(this.get('obj_name')) != -1) {
|
||||||
@ -1144,6 +1145,7 @@ define([
|
|||||||
_this.$('th .checkbox').removeClass('checkbox-checked');
|
_this.$('th .checkbox').removeClass('checkbox-checked');
|
||||||
_this.$('#multi-dirents-op').hide();
|
_this.$('#multi-dirents-op').hide();
|
||||||
_this.$('#cur-dir-ops').show();
|
_this.$('#cur-dir-ops').show();
|
||||||
|
_this.updateDirOpBarUI();
|
||||||
} else {
|
} else {
|
||||||
$(dirs).each(function() {
|
$(dirs).each(function() {
|
||||||
if (this.get('obj_name') in data['success']) {
|
if (this.get('obj_name') in data['success']) {
|
||||||
|
Loading…
Reference in New Issue
Block a user