[Change] 修改图片
|
@ -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 %}
|
||||
}
|
||||
}}
|
||||
],
|
||||
|
|
After Width: | Height: | Size: 106 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.3 KiB |
|
@ -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>
|
||||
|
|
|
@ -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):
|
||||
|
|