Wrapped admin menu to a div

This commit is contained in:
Djamil Legato
2016-03-11 10:44:36 -08:00
parent 2b34b02bf4
commit 2c279d6341
2 changed files with 61 additions and 52 deletions

View File

@@ -314,13 +314,20 @@ $sidebar-padding: 2rem;
}
}
.admin-menu-wrapper {
height: calc(100vh - 180px);
overflow: hidden;
@include breakpoint(mini-nav-range) {
height: calc(100vh - 136px);
}
}
#admin-menu {
display: block;
margin: 0;
padding: 0;
list-style: none;
overflow: hidden;
height: calc(100vh - 180px);
em {
font-style: normal;

View File

@@ -17,67 +17,69 @@
</div>
{#{% endif %}#}
<ul id="admin-menu">
<li class="{{ (location == 'dashboard') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}"><i class="fa fa-fw fa-th"></i><em>{{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</em></a>
</li>
{% if authorize(['admin.configuration', 'admin.super']) %}
<li class="{{ (location == 'system' or location == 'site' or location == 'config') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/config/system"><i class="fa fa-fw fa-wrench"></i><em>{{ "PLUGIN_ADMIN.CONFIGURATION"|tu }}</em></a>
<div class="admin-menu-wrapper">
<ul id="admin-menu">
<li class="{{ (location == 'dashboard') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}"><i class="fa fa-fw fa-th"></i><em>{{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</em></a>
</li>
{% endif %}
{% if authorize(['admin.pages', 'admin.super']) %}
<li class="{{ (location == 'pages') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/pages">
<i class="fa fa-fw fa-file-text-o"></i>
<em>{{ "PLUGIN_ADMIN.PAGES"|tu }}</em>
{% if authorize(['admin.configuration', 'admin.super']) %}
<li class="{{ (location == 'system' or location == 'site' or location == 'config') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/config/system"><i class="fa fa-fw fa-wrench"></i><em>{{ "PLUGIN_ADMIN.CONFIGURATION"|tu }}</em></a>
</li>
{% endif %}
{% if authorize(['admin.pages', 'admin.super']) %}
<li class="{{ (location == 'pages') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/pages">
<i class="fa fa-fw fa-file-text-o"></i>
<em>{{ "PLUGIN_ADMIN.PAGES"|tu }}</em>
<span class="badges">
<span class="badge count">{{ admin.pagesCount }}</span>
</span>
</a>
</li>
{% endif %}
{% if grav.twig.plugins_hooked_nav %}
{% for label, item in grav.twig.plugins_hooked_nav %}
{% if authorize(['admin.' ~ item.route, 'admin.super']) %}
<li class="{{ (location == item.route) ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/{{ item.route }}">
<i class="fa fa-fw {{ item.icon }}"></i>
<em>{{ label|tu }}</em>
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% if authorize(['admin.plugins', 'admin.super']) %}
<li class="{{ (location == 'plugins') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/plugins">
<i class="fa fa-fw fa-plug"></i>
<em>{{ "PLUGIN_ADMIN.PLUGINS"|tu }}</em>
</a>
</li>
{% endif %}
{% if grav.twig.plugins_hooked_nav %}
{% for label, item in grav.twig.plugins_hooked_nav %}
{% if authorize(['admin.' ~ item.route, 'admin.super']) %}
<li class="{{ (location == item.route) ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/{{ item.route }}">
<i class="fa fa-fw {{ item.icon }}"></i>
<em>{{ label|tu }}</em>
</a>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% if authorize(['admin.plugins', 'admin.super']) %}
<li class="{{ (location == 'plugins') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/plugins">
<i class="fa fa-fw fa-plug"></i>
<em>{{ "PLUGIN_ADMIN.PLUGINS"|tu }}</em>
<span class="badges">
<span class="badge updates"></span>
<span class="badge count">{{ admin.plugins|length }}</span>
</span>
</a>
</li>
{% endif %}
{% if authorize(['admin.themes', 'admin.super']) %}
<li class="{{ (location == 'themes') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/themes">
<i class="fa fa-fw fa-tint"></i>
<em>{{ "PLUGIN_ADMIN.THEMES"|tu }}</em>
</a>
</li>
{% endif %}
{% if authorize(['admin.themes', 'admin.super']) %}
<li class="{{ (location == 'themes') ? 'selected' : '' }}">
<a href="{{ base_url_relative }}/themes">
<i class="fa fa-fw fa-tint"></i>
<em>{{ "PLUGIN_ADMIN.THEMES"|tu }}</em>
<span class="badges">
<span class="badge updates"></span>
<span class="badge count">{{ admin.themes|length }}</span>
</span>
</a>
</a>
</li>
{% endif %}
{% include 'nav-pro.html.twig' ignore missing %}
<li>
<a href="{{ uri.addNonce(base_url_relative ~ '/task' ~ config.system.param_sep ~ 'logout', 'logout-form', 'logout-nonce') }}"><i class="fa fa-fw fa-sign-out"></i><em>{{ "PLUGIN_ADMIN.LOGOUT"|tu }}</em></a>
</li>
{% endif %}
{% include 'nav-pro.html.twig' ignore missing %}
<li>
<a href="{{ uri.addNonce(base_url_relative ~ '/task' ~ config.system.param_sep ~ 'logout', 'logout-form', 'logout-nonce') }}"><i class="fa fa-fw fa-sign-out"></i><em>{{ "PLUGIN_ADMIN.LOGOUT"|tu }}</em></a>
</li>
</ul>
</ul>
</div>
</nav>