• 老广's avatar
    Dev license (#2409) · cccc7427
    老广 authored
    * [Update] 更新用户组
    
    * [Update] license - 更新翻译
    
    * [Feature] interface - 自定义配置logo,修改前端(待续)
    
    * [Update] interface更新前端页面,两个登陆首页的模版设
    
    * [Update]修改新登陆模版全局变量,国际化翻译,登陆逻辑页面切换
    
    * [Update] 优化Interface前端逻辑
    
    * [Update] Interface 修改前端一些小问题
    
    * [Update] License/Interface 生成翻译信息
    Unverified
    cccc7427
_user_profile.html 2.54 KB
{% load static %}
{% load i18n %}
<li class="nav-header">
    <div class="profile-element" style="height: 65px">
        <div href="http://www.jumpserver.org" target="_blank" style="width: 100%; background-image: url({% static 'img/header-profile.png' %})">
            {% if interface and interface.logo_index %}
                    <img alt="logo" height="55" width="185" src="{{ MEDIA_URL }}{{ interface.logo_index }}"/>
            {% else %}
                  <img alt="logo" height="55" width="185" src="{% static 'img/logo-text.png' %}"/>
            {% endif %}
        </div>
    </div>
    <div class="logo-element">
        <img alt="image" height="40" src="/static/img/logo.png"/>
    </div>
    {% if ADMIN_ORGS and request.COOKIES.IN_ADMIN_PAGE != 'No' %}
        {% if ADMIN_ORGS|length > 1 or not CURRENT_ORG.is_default %}
        <div style="height: 55px;">
            <a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false" style="display: block; background-color: transparent; color: #8095a8; padding: 14px 20px 14px 25px">
                <i class="fa fa-bookmark" style="width: 14px; "></i>
                <span class="nav-label" style="padding-left: 7px">
                    {{ CURRENT_ORG.name }}
                </span>
                <span class="fa fa-sort-desc pull-right"></span>
            </a>
            <ul class="dropdown-menu" style="width: 219px;">
                {% for org in ADMIN_ORGS %}
                    <li>
                        <a class="org-dropdown"
                           href="{% url 'orgs:org-switch' pk=org.id %}"
                           data-id="{{ org.id }}">
                            {{ org.name }}
                            {% if org.id == CURRENT_ORG.id %}
                                <span class="fa fa-circle pull-right" style="padding-top: 5px; color: #1ab394"></span>
                            {% endif %}
                        </a>
                    </li>
                {% endfor %}
            </ul>
        </div>
        {% endif %}
    {% endif %}
</li>
<script>
$(document).ready(function () {
})
.on('click', '#switch_admin', function () {
    var cookieName = "IN_ADMIN_PAGE";
    setTimeout(function () {
        delCookie(cookieName);
        setCookie(cookieName, "Yes");
        window.location = "/"
    }, 100)
})
.on('click', '#switch_user', function () {
    var cookieName = "IN_ADMIN_PAGE";
    setTimeout(function () {
        delCookie(cookieName);
        setCookie(cookieName, "No");
        window.location = "{% url 'assets:user-asset-list' %}"
    }, 100);
})
</script>