Unverified Commit a48fb9de authored by 老广's avatar 老广 Committed by GitHub

Tmp org (#1596)

* [Update] 修改index view

* [Update] 修改nav

* [Update] 修改profile
parent 04e7f54c
...@@ -21,10 +21,10 @@ class IndexView(AdminUserRequiredMixin, TemplateView): ...@@ -21,10 +21,10 @@ class IndexView(AdminUserRequiredMixin, TemplateView):
session_month_dates = [] session_month_dates = []
session_month_dates_archive = [] session_month_dates_archive = []
def get(self, request, *args, **kwargs): def dispatch(self, request, *args, **kwargs):
if not request.user.is_org_admin: if not request.user.is_org_admin:
return redirect('assets:user-asset-list') return redirect('assets:user-asset-list')
return super(IndexView, self).get(request, *args, **kwargs) return super(IndexView, self).dispatch(request, *args, **kwargs)
@staticmethod @staticmethod
def get_user_count(): def get_user_count():
......
...@@ -335,13 +335,13 @@ div.dataTables_wrapper div.dataTables_filter { ...@@ -335,13 +335,13 @@ div.dataTables_wrapper div.dataTables_filter {
.nav-header, body.mini-navbar .nav-header { .nav-header, body.mini-navbar .nav-header {
padding: 0; padding: 0;
background: #202c37; /*background: #202c37;*/
} }
.profile-element div:first-child { .profile-element div:first-child {
line-height: 60px; line-height: 60px;
/*width: 70px;*/ /*width: 70px;*/
float: left; /*float: left;*/
text-align: center; text-align: center;
} }
......
{% load i18n %} {% load i18n %}
{% if ADMIN_ORGS and ADMIN_ORGS|length > 1 %}
<li id="org">
<a class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-star" style="width: 14px"></i> <span class="nav-label">{{ CURRENT_ORG.name }}</span>
<span class="fa fa-caret-down arrow"></span>
</a>
<ul class="dropdown-menu">
{% for org in ADMIN_ORGS %}
{% if org.id != CURRENT_ORG.id %}
<li><a class="org-dropdown" href="{% url 'orgs:org-switch' pk=org.id %}" data-id="{{ org.id }}">{{ org.name }}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
<hr>
{% endif %}
<li id="index"> <li id="index">
<a href="{% url 'index' %}"> <a href="{% url 'index' %}">
<i class="fa fa-dashboard" style="width: 14px"></i> <span class="nav-label">{% trans 'Dashboard' %}</span> <i class="fa fa-dashboard" style="width: 14px"></i> <span class="nav-label">{% trans 'Dashboard' %}</span>
......
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
<li class="nav-header"> <li class="nav-header">
<div class="dropdown profile-element"> <div class="profile-element" style="height: 65px">
<div href="http://www.jumpserver.org" target="_blank"> <div href="http://www.jumpserver.org" target="_blank" style="width: 100%; background-image: url({% static 'img/header-profile.png' %})">
<img alt="logo" height="55" width="185" src="/static/img/logo-text.png" style="margin-left: 20px"/> <img alt="logo" height="55" width="185" src="/static/img/logo-text.png"/>
</div> </div>
</div> </div>
<div class="clearfix"></div> {# <div class="clearfix"></div>#}
<div class="logo-element"> <div class="logo-element">
<img alt="image" height="40" src="/static/img/logo.png"/> <img alt="image" height="40px" src="/static/img/logo.png"/>
</div> </div>
{% if ADMIN_ORGS and ADMIN_ORGS|length != 1 %}
<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">
{% trans 'Org' %} - {{ 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 %}
</li> </li>
<script> <script>
$(document).ready(function () { $(document).ready(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment