2020-08-12 00:36:09 +00:00
|
|
|
<!-- partial -->
|
2022-10-04 21:10:03 +00:00
|
|
|
<!-- partial:partials/_sidebar.html -->
|
|
|
|
<style>
|
|
|
|
@media screen and (max-width: 991px) {
|
|
|
|
.sidebar-offcanvas {
|
|
|
|
-webkit-transition: all 0.25s cubic-bezier(.22, .61, .36, 1);
|
|
|
|
transition: all 0.25s cubic-bezier(.22, .61, .36, 1);
|
|
|
|
box-shadow: 0px 8px 17px 2px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12), 0px 5px 5px -3px rgba(0, 0, 0, 0.2);
|
2022-06-18 19:57:37 +00:00
|
|
|
}
|
2022-10-04 21:10:03 +00:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<script>
|
|
|
|
function debounce(func, wait, immediate) {
|
|
|
|
var timeout;
|
|
|
|
return function () {
|
|
|
|
var context = this, args = arguments;
|
|
|
|
var later = function () {
|
|
|
|
timeout = null;
|
|
|
|
if (!immediate) func.apply(context, args);
|
2022-06-18 19:57:37 +00:00
|
|
|
};
|
2022-10-04 21:10:03 +00:00
|
|
|
var callNow = immediate && !timeout;
|
|
|
|
clearTimeout(timeout);
|
|
|
|
timeout = setTimeout(later, wait);
|
|
|
|
if (callNow) func.apply(context, args);
|
2022-06-18 19:57:37 +00:00
|
|
|
};
|
2022-10-04 21:10:03 +00:00
|
|
|
};
|
|
|
|
function isExtraLargeBreakpoint() {
|
|
|
|
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
|
|
|
return vw >= 1200;
|
|
|
|
}
|
|
|
|
function isLargeBreakpoint() {
|
|
|
|
const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
|
|
|
return vw >= 992;
|
|
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
|
|
sidebarResizeHandler(null);
|
|
|
|
$(window).on(
|
|
|
|
'resize',
|
|
|
|
debounce(sidebarResizeHandler, 25, true)
|
|
|
|
);
|
|
|
|
});
|
|
|
|
function sidebarResizeHandler(e) {
|
|
|
|
/*
|
|
|
|
Viewport sizes: Extra large (vw >= 1200px), large (vw >= 992px), medium (vw >= 768px)
|
|
|
|
- A localstorage item is set to remember a user's preference between collapsed or expanded.
|
|
|
|
- For extra large viewports, the sidebar is the user's preference (by default expanded). When
|
|
|
|
expanded or collapsed manually, it doesn't overlap the page content and the preference
|
|
|
|
gets saved to a localstorage item.
|
|
|
|
- For large viewports, the sidebar is collapsed. When expanded manually, it doesn't overlap
|
|
|
|
the page content. The user's localstorage preference is not overridden during this state.
|
|
|
|
- For medium and below viewports, the sidebar is hidden behing a hamburger icon. When expanded, the sidebar
|
|
|
|
overlaps the page content. The user's localstorage preference is not overridden during this state.
|
2022-02-09 22:26:16 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
More code in `app/frontend/static/assets/js/shared/misc.js` and `app/frontend/templates/base.html`
|
|
|
|
*/
|
2022-10-06 05:52:24 +00:00
|
|
|
if (isLargeBreakpoint()) {
|
2022-10-04 21:10:03 +00:00
|
|
|
let value = localStorage.getItem('crafty-sidebar-expanded') !== 'false';
|
|
|
|
$('body').toggleClass('sidebar-icon-only', !value);
|
|
|
|
localStorage.setItem('crafty-sidebar-expanded', value);
|
2022-06-18 19:57:37 +00:00
|
|
|
}
|
2022-10-04 21:10:03 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<nav class="sidebar sidebar-offcanvas" id="sidebar">
|
|
|
|
<ul class="nav">
|
2020-08-12 00:36:09 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="/panel/dashboard">
|
2023-02-03 20:59:52 +00:00
|
|
|
<i class="fa-solid fa-diagram-project"></i>
|
2022-10-04 21:10:03 +00:00
|
|
|
<span class="menu-title">{{ translate('sidebar', 'dashboard', data['lang']) }}</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2020-08-17 02:47:53 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" data-toggle="collapse" href="#page-layouts" aria-expanded="false"
|
2023-02-03 20:59:52 +00:00
|
|
|
aria-controls="page-layouts">
|
2022-10-04 21:10:03 +00:00
|
|
|
<i class="fas fa-server"></i>
|
|
|
|
<span class="menu-title">{{ translate('sidebar', 'servers', data['lang']) }}</span>
|
|
|
|
<i class="menu-arrow"></i>
|
|
|
|
</a>
|
|
|
|
<div class="collapse" id="page-layouts">
|
2023-02-10 18:35:22 +00:00
|
|
|
<ul class="nav flex-column sub-menu" id="sidebar-servers">
|
2022-10-04 21:10:03 +00:00
|
|
|
{% if data['crafty_permissions']['Server_Creation'] in data['user_crafty_permissions'] %}
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="/server/step1"><i class="fas fa-plus-circle"></i> {{ translate('sidebar',
|
|
|
|
'newServer', data['lang']) }}</a>
|
|
|
|
</li>
|
|
|
|
{% end %}
|
|
|
|
{% for s in data['menu_servers'] %}
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="/panel/server_detail?id={{s['server_id']}}"><i class="fas fa-server"></i>
|
|
|
|
{{s['server_name']}}</a>
|
|
|
|
</li>
|
|
|
|
{% end %}
|
2020-08-12 00:36:09 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</li>
|
2020-08-24 23:11:17 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
<li class="nav-item">
|
2023-05-14 20:31:19 +00:00
|
|
|
<a class="nav-link" href="https://docs.craftycontrol.com" target="_blank">
|
2022-10-04 21:10:03 +00:00
|
|
|
<i class="fas fa-book"></i>
|
|
|
|
<span class="menu-title">{{ translate('sidebar', 'documentation', data['lang']) }}</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2020-08-24 23:11:17 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="/panel/wiki">
|
|
|
|
<i class="fa fa-info-circle"></i>
|
2023-05-14 20:31:19 +00:00
|
|
|
<span class="menu-title">{{ translate('sidebar', 'inApp', data['lang']) }}</span>
|
2022-10-04 21:10:03 +00:00
|
|
|
</a>
|
|
|
|
</li>
|
2020-08-12 00:36:09 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="https://discord.gg/9VJPhCE" target="_blank">
|
|
|
|
<i class="fab fa-discord"></i>
|
|
|
|
<span class="menu-title">Discord</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-06-18 19:57:37 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="/panel/credits">
|
|
|
|
<i class="fas fa-heart"></i>
|
|
|
|
<span class="menu-title">{{ translate('sidebar', 'credits', data['lang']) }}</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
2022-06-18 19:57:37 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
{% if data['show_contribute'] %}
|
|
|
|
<li class="nav-item">
|
|
|
|
<a class="nav-link" href="/panel/contribute">
|
|
|
|
<i class="fas fa-donate"></i>
|
|
|
|
<span class="menu-title">{{ translate('sidebar', 'contribute', data['lang']) }}</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
{% end %}
|
2022-06-18 19:57:37 +00:00
|
|
|
|
2022-10-04 21:10:03 +00:00
|
|
|
</ul>
|
|
|
|
</nav>
|
2023-02-10 18:35:22 +00:00
|
|
|
<script>
|
|
|
|
$(document).ready(function () {
|
|
|
|
$('#sidebar-servers li:gt(10)').remove();
|
|
|
|
})
|
|
|
|
</script>
|
2022-10-04 21:10:03 +00:00
|
|
|
<!-- partial -->
|