Fix sidebar

This commit is contained in:
FabioL 2024-05-23 18:39:25 +02:00
parent 7caf878698
commit 03abf74f58
4 changed files with 75 additions and 76 deletions

View File

@ -1559,6 +1559,34 @@ body:not(.sidebar-collapse) .sidebar .nav-treeview .nav-treeview .nav-link {
display: none !important;
}
.with-control-sidebar {
margin-right: 200px;
}
.control-sidebar-open {
right: 0;
display: block !important;
width: 200px !important;
}
.control-sidebar.control-sidebar-open,
.control-sidebar.control-sidebar-open+.control-sidebar-bg {
right: 0;
}
.control-sidebar-button{
position: fixed;
right: 0px;
padding: 10px;
top: 62px;
z-index: 50;
cursor: pointer;
background: #fff;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
box-shadow: 0px 0px 3px rgba(0,0,0,0.1);
}
@media screen and (max-width: 767px) {
.navbar-left {
display: inline-block;
@ -1628,23 +1656,6 @@ body:not(.sidebar-collapse) .sidebar .nav-treeview .nav-treeview .nav-link {
}
@media screen and (min-width: 1140px) {
.with-control-sidebar {
margin-right: 200px;
}
.control-sidebar-open {
right: 0;
display: block !important;
width: 200px !important;
}
.control-sidebar.control-sidebar-open,
.control-sidebar.control-sidebar-open+.control-sidebar-bg {
right: 0;
}
}
/*
* Component: Sidebar Mini

View File

@ -79,6 +79,18 @@ $(document).ready(function () {
if (largeScreen && !globals.collapse_plugin_sidebar) {
pluginToggle.click();
}
$('.control-sidebar-button').on("click", function(){
toggleControlSidebar();
});
$('.control-sidebar .nav-item > a').on("click", function(){
toggleControlSidebar();
});
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
window.dispatchEvent(new Event('resize'));
});
});
/**
@ -88,13 +100,4 @@ function toggleControlSidebar() {
const sidebar = $(".control-sidebar");
sidebar.toggleClass("control-sidebar-open");
if (sidebar.hasClass("control-sidebar-open")) {
sidebar.delay(50)
.animate(
{width: "show"},
350,
'easeInOutQuint'
);
}
}

View File

@ -48,37 +48,25 @@ if ($segmenti) {
// Lettura eventuali plugins modulo da inserire come tab
echo '
<div class="nav-tabs-custom">
<ul class="nav nav-tabs" id="tabs" role="tablist">
<li class="pull-left active nav-item header">
<a data-widget="tab" href="#tab_0" class="nav-link">
<i class="'.$structure['icon'].'"></i> '.$structure->getTranslation('title');
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>
<i class="'.$structure['icon'].'"></i> '.$structure->getTranslation('title');
// Pulsante "Aggiungi" solo se il modulo è di tipo "table" e se esiste il template per la popup
if ($structure->hasAddFile() && $structure->permission == 'rw') {
echo '
<button type="button" class="btn btn-primary" data-widget="modal" data-title="'.tr('Aggiungi').'..." data-href="add.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'"><i class="fa fa-plus"></i></button>';
}
// Pulsante "Aggiungi" solo se il modulo è di tipo "table" e se esiste il template per la popup
if ($structure->hasAddFile() && $structure->permission == 'rw') {
echo '
<button type="button" class="btn btn-primary" data-widget="modal" data-title="'.tr('Aggiungi').'..." data-href="add.php?id_module='.$id_module.'&id_plugin='.$id_plugin.'"><i class="fa fa-plus"></i></button>';
}
</h1>
</div>
</div>
</section>
echo '
</a>
</li>';
$plugins = Plugin::where('idmodule_to', $id_module)->where('position', 'tab_main')->where('enabled', 1)->get();
// Tab dei plugin
foreach ($plugins as $plugin) {
echo '
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" data-widget="tab" href="#tab_'.$plugin->id.'" id="link-tab_'.$plugin->id.'">'.$plugin->getTranslation('title').'</a>
</li>
</ul>';
}
echo '
</ul>
<div class="tab-content">
<div id="tab_0" class="tab-pane active">';
@ -105,9 +93,6 @@ foreach ($plugins as $plugin) {
$record = $module_record;
echo '
</div>';
redirectOperation($id_module, !empty($id_parent) ? $id_parent : $id_record);
// Interfaccia per la modifica dell'ordine e della visibilità delle colonne (Amministratore)

View File

@ -107,12 +107,12 @@ if (empty($record) || !$has_access) {
}
echo '
<nav class="navbar navbar-expand navbar-light">
<ul class="navbar-nav" id="tabs">
<li class="nav-item">
<a data-widget="tab" href="#tab_0" class="nav-link">
<i class="'.$structure['icon'].'"></i> '.$structure->getTranslation('title');
<section class="content-header">
<div class="container-fluid">
<div class="row mb-2">
<div class="col-sm-6">
<h1>
<i class="'.$structure['icon'].'"></i> '.$structure->getTranslation('title');
// Pulsante "Aggiungi" solo se il modulo è di tipo "table" e se esiste il template per la popup
if ($structure->hasAddFile() && $structure->permission == 'rw') {
@ -121,19 +121,20 @@ if (empty($record) || !$has_access) {
}
echo '
</a>
</li>
</ul>
</h1>
</div>
<ul class="navbar-nav ml-auto">
<li class="nav-item control-sidebar-toggle">
<a class="nav-link" style="cursor: pointer">'.tr('Plugin').'</a>
</li>
</ul>
</nav>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="'.$rootdir.'/">Home</a></li>
<li class="breadcrumb-item"><a href="'.$rootdir.'/controller.php?id_module='.$id_module.'">'.$structure->getTranslation('title').'</a></li>
</ol>
</div>
</div>
</section>
<div class="tab-content">
<div id="tab_0" class="tab-pane active nav-item">';
<div class="tab-content">
<div id="tab_0" class="tab-pane active nav-item">';
if (!empty($record['deleted_at'])) {
$operation = $dbo->fetchOne("SELECT zz_operations.created_at, username FROM zz_operations INNER JOIN zz_users ON zz_operations.id_utente = zz_users.id WHERE op='delete' AND id_module=".prepare($id_module).' AND id_record='.prepare($id_record).' ORDER BY zz_operations.created_at DESC');
@ -400,8 +401,7 @@ if (empty($record) || !$has_access) {
$record = $module_record;
echo '
</div>
</div>';
</div>';
}
redirectOperation($id_module, !empty($id_parent) ? $id_parent : $id_record);