[Change] 修改图片

pull/417/head
ibuler 2017-03-31 18:47:50 +08:00
parent 61a481f427
commit 7720e9f3fd
10 changed files with 13 additions and 9 deletions

View File

@ -81,9 +81,15 @@ $(document).ready(function(){
var connect_btn = '<a href="{% url "applications:terminal-connect" pk=99991937 %}"" class="btn btn-xs btn-warning btn-connect" >{% trans "Connect" %}</a> '
.replace('99991937', cellData);
if (rowData.is_accepted) {
$(td).html(connect_btn + update_btn + delete_btn)
{% if user.is_superuser %}
$(td).html(connect_btn + update_btn + delete_btn);
{% else %}
$(td).html(connect_btn);
{% endif %}
} else {
$(td).html(accept_btn + reject_btn)
{% if user.is_superuser %}
$(td).html(accept_btn + reject_btn);
{% endif %}
}
}}
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -16,8 +16,8 @@
</span>
</a>
<ul class="dropdown-menu animated fadeInRight m-t-xs">
<li><a value="">{% trans 'Profile' %}</a></li>
<li><a value="">{% trans 'Profile settings' %}</a></li>
<li><a href="{% url 'users:user-profile' %}">{% trans 'Profile' %}</a></li>
<li><a href="{% url 'users:user-profile-update' %}">{% trans 'Profile settings' %}</a></li>
<li class="divider"></li>
<li><a href="">{% trans 'Logout' %}</a></li>
</ul>

View File

@ -183,11 +183,9 @@ class User(AbstractUser):
if self.avatar:
return self.avatar.url
else:
default_dir = os.path.join(settings.MEDIA_ROOT, 'avatar', 'default')
if os.path.isdir(default_dir):
default_avatar_list = os.listdir(default_dir)
default_avatar = default_avatar_list[len(self.username) % len(default_avatar_list)]
return os.path.join(settings.MEDIA_URL, 'avatar', 'default', default_avatar)
avatar_dir = os.path.join(settings.MEDIA_ROOT, 'avatar')
if os.path.isdir(avatar_dir):
return os.path.join(settings.MEDIA_URL, 'avatar', 'default.png')
return 'https://www.gravatar.com/avatar/c6812ab450230979465d7bf288eadce2a?s=120&d=identicon'
def generate_reset_token(self):