From fc21d2f7a040d611d16858f41299fce3b48ce018 Mon Sep 17 00:00:00 2001 From: "kilian (ksmachome)" Date: Mon, 2 Dec 2019 10:01:53 +0100 Subject: [PATCH] test sidebar --- backoffice/css/w3pro.css | 15 +++--- backoffice/js/admin.js | 78 ++++++++++++++++++++----------- backoffice/tmpl/block/head.tt | 2 +- backoffice/tmpl/skeleton/index.tt | 71 ++++++++++++++-------------- 4 files changed, 94 insertions(+), 72 deletions(-) diff --git a/backoffice/css/w3pro.css b/backoffice/css/w3pro.css index 30134899..7b4b45d9 100644 --- a/backoffice/css/w3pro.css +++ b/backoffice/css/w3pro.css @@ -44,8 +44,8 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0} .w3-ul{list-style-type:none;padding:0;margin:0}.w3-ul li{padding:8px 16px;border-bottom:1px solid #ddd}.w3-ul li:last-child{border-bottom:none} .w3-tooltip,.w3-display-container{position:relative}.w3-tooltip .w3-text{display:none}.w3-tooltip:hover .w3-text{display:inline-block} .w3-ripple:active{opacity:0.5}.w3-ripple{transition:opacity 0s} -.w3-input{padding:8px;display:block;border:1px solid #ccc;width:100%;background-color: #e8f0fe; } -.w3-select{padding:9px 0; display:block;width:100%;border:1px solid #ccc;background-color: #e8f0fe;} +.w3-input{padding:4px;display:block;border:1px solid #ccc;width:100%;background-color: #e8f0fe; } +.w3-select{padding:4px 0; display:block;width:100%;border:1px solid #ccc;background-color: #e8f0fe;} .w3-dropdown-click,.w3-dropdown-hover{position:relative;display:inline-block;cursor:pointer} .w3-dropdown-hover:hover .w3-dropdown-content{display:block; } .w3-dropdown-hover:first-child,.w3-dropdown-click:hover{background-color:#ccc;color:#000} @@ -68,13 +68,13 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0} .w3-responsive{display:block;overflow-x:auto} .w3-container:after,.w3-container:before,.w3-panel:after,.w3-panel:before,.w3-row:after,.w3-row:before,.w3-row-padding:after,.w3-row-padding:before, .w3-cell-row:before,.w3-cell-row:after,.w3-clear:after,.w3-clear:before,.w3-bar:before,.w3-bar:after{content:"";display:table;clear:both} -.w3-col,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{float:left;width:100%} +.w3-col,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter,.w3-fifth,.w3-twofifth,.w3-threefifth,.w3-fourfifth{float:left;width:100%} .w3-col.s1{width:8.33333%}.w3-col.s2{width:16.66666%}.w3-col.s3{width:24.99999%}.w3-col.s4{width:33.33333%} .w3-col.s5{width:41.66666%}.w3-col.s6{width:49.99999%}.w3-col.s7{width:58.33333%}.w3-col.s8{width:66.66666%} .w3-col.s9{width:74.99999%}.w3-col.s10{width:83.33333%}.w3-col.s11{width:91.66666%}.w3-col.s12{width:99.99999%} -@media (min-width:601px){.w3-col.m1{width:8.33333%}.w3-col.m2{width:16.66666%}.w3-col.m3,.w3-quarter{width:24.99999%}.w3-col.m4,.w3-third{width:33.33333%} +@media (min-width:601px){.w3-col.m1{width:8.33333%}.w3-col.m2{width:16.66666%}.w3-col.m3,.w3-quarter{width:24.99999%}.w3-col.m4,.w3-third{width:33.33333%}.w3-fifth{width:20%;min-width:100px} .w3-col.m5{width:41.66666%}.w3-col.m6,.w3-half{width:49.99999%}.w3-col.m7{width:58.33333%}.w3-col.m8,.w3-twothird{width:66.66666%} -.w3-col.m9,.w3-threequarter{width:74.99999%}.w3-col.m10{width:83.33333%}.w3-col.m11{width:91.66666%}.w3-col.m12{width:99.99999%}} +.w3-col.m9,.w3-threequarter{width:74.99999%}.w3-col.m10{width:83.33333%}.w3-col.m11{width:91.66666%}.w3-col.m12{width:99.99999%}.w3-twofifth{width:40%}.w3-threefifth{width:60%}.w3-fourfifth{width:80%}} @media (min-width:993px){.w3-col.l1{width:8.33333%}.w3-col.l2{width:16.66666%}.w3-col.l3{width:24.99999%}.w3-col.l4{width:33.33333%} .w3-col.l5{width:41.66666%}.w3-col.l6{width:49.99999%}.w3-col.l7{width:58.33333%}.w3-col.l8{width:66.66666%} .w3-col.l9{width:74.99999%}.w3-col.l10{width:83.33333%}.w3-col.l11{width:91.66666%}.w3-col.l12{width:99.99999%}} @@ -106,7 +106,7 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0} .w3-circle{border-radius:50%} .w3-round-small{border-radius:2px}.w3-round,.w3-round-medium{border-radius:4px}.w3-round-large{border-radius:8px}.w3-round-xlarge{border-radius:16px}.w3-round-xxlarge{border-radius:32px} .w3-row-padding,.w3-row-padding>.w3-half,.w3-row-padding>.w3-third,.w3-row-padding>.w3-twothird,.w3-row-padding>.w3-threequarter,.w3-row-padding>.w3-quarter,.w3-row-padding>.w3-col{padding:0 8px} -.w3-container,.w3-panel{padding:0.01em 16px}.w3-panel{margin-top:16px;margin-bottom:16px} +.w3-container,.w3-panel{padding:0.01em 8px}.w3-panel{margin-top:8px;margin-bottom:8px} .w3-code,.w3-codespan{font-family:Consolas,"courier new";font-size:16px} .w3-code{width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #4CAF50;word-wrap:break-word} .w3-codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%} @@ -174,6 +174,7 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0} .w3-dark-grey,.w3-hover-dark-grey:hover{color:#fff!important;background-color:#616161!important} .w3-pale-red,.w3-hover-pale-red:hover{color:#000!important;background-color:#ffe7e7!important}.w3-pale-green,.w3-hover-pale-green:hover{color:#000!important;background-color:#e7ffe7!important} .w3-pale-yellow,.w3-hover-pale-yellow:hover{color:#000!important;background-color:#ffffd7!important}.w3-pale-blue,.w3-hover-pale-blue:hover{color:#000!important;background-color:#e7ffff!important} +.w3-text-align-right { text-align: right;} .w3-text-amber,.w3-hover-text-amber:hover{color:#ffc107!important} .w3-text-aqua,.w3-hover-text-aqua:hover{color:#00ffff!important} .w3-text-blue,.w3-hover-text-blue:hover{color:#2196F3!important} @@ -253,7 +254,7 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0} .w3-hover-border-theme:hover {border-color:#6a92d3 !important} .w3-label { color: rgb(153, 150, 150);} -#main {margin-left: 210px;} +/* #main {margin-left: 210px;} */ @media (max-width:768px){ #sidebar { display: none;} #main { margin-left: 0px;} diff --git a/backoffice/js/admin.js b/backoffice/js/admin.js index 2c7e9cb0..f6b9e325 100644 --- a/backoffice/js/admin.js +++ b/backoffice/js/admin.js @@ -1,37 +1,59 @@ var admin = { - loadpage: function(modulepage,modulename){ - //console.log(modulename); - //console.log("Load module:" + modulepage); - if (modulename){ - document.getElementById("modulename").innerHTML = modulename; + loadpage: function(modulepage, modulename) { + //console.log(modulename); + //console.log("Load module:" + modulepage); + if (modulename) { + document.getElementById("modulename").innerHTML = modulename; + } + document.getElementById("moduleframe").setAttribute('src', modulepage); + }, + sidebarclick: function(modulepage, modulename) { + admin.ladpage(modulepage, modulename); + }, + logout: function() { + req.reqdata("POST", location.href, { "logout": "1" }, admin.reloadpage); + + }, + reloadpage(page) { + location.href = location.href; + } - document.getElementById("moduleframe").setAttribute('src',modulepage); - }, - sidebarclick: function(modulepage,modulename){ - admin.ladpage(modulepage,modulename); - }, - logout: function(){ - req.reqdata("POST",location.href,{"logout":"1"},admin.reloadpage); - - }, - reloadpage(page){ - location.href=location.href; - - } } -function reload_page(){ - location.href=location.href; +function reload_page() { + location.href = location.href; } -function closeSidebar(){ - document.getElementById("sidebar").style.display = "none"; - document.getElementById("main").style.margin = "0 0 0 0"; - document.getElementById("modulename").style.setProperty("margin-left","0px"); +// function closeSidebar(){ +// document.getElementById("sidebar").style.display = "none"; +// document.getElementById("main").style.margin = "0 0 0 0"; +// document.getElementById("modulename").style.setProperty("margin-left","0px"); +// } + +// function openSidebar(){ +// document.getElementById("sidebar").style.display = "block"; +// document.getElementById("main").style.setProperty("margin-left","210px"); +// document.getElementById("modulename").style.setProperty("margin-left","150px"); +// } + +var mySidebar = document.getElementById("mySidebar"); + +// Get the DIV with overlay effect +var overlayBg = document.getElementById("myOverlay"); + +// Toggle between showing and hiding the sidebar, and add overlay effect +function w3_open() { + if (mySidebar.style.display === 'block') { + mySidebar.style.display = 'none'; + overlayBg.style.display = "none"; + } else { + mySidebar.style.display = 'block'; + overlayBg.style.display = "block"; + } } -function openSidebar(){ - document.getElementById("sidebar").style.display = "block"; - document.getElementById("main").style.setProperty("margin-left","210px"); - document.getElementById("modulename").style.setProperty("margin-left","150px"); +// Close the sidebar with the close button +function w3_close() { + mySidebar.style.display = "none"; + overlayBg.style.display = "none"; } \ No newline at end of file diff --git a/backoffice/tmpl/block/head.tt b/backoffice/tmpl/block/head.tt index 32d38589..7382d2b8 100644 --- a/backoffice/tmpl/block/head.tt +++ b/backoffice/tmpl/block/head.tt @@ -1,7 +1,7 @@ - + [% sitename %] - [% pagename %] diff --git a/backoffice/tmpl/skeleton/index.tt b/backoffice/tmpl/skeleton/index.tt index 68f33a62..141c89c6 100644 --- a/backoffice/tmpl/skeleton/index.tt +++ b/backoffice/tmpl/skeleton/index.tt @@ -1,47 +1,46 @@ -[% USE dksdb = DBI(dsn, dbuser, dbpassword) %] -[% appaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup from useringroups uig join apps ap on (uig.id_group=ap.id_usergroup) join usergroups ug on (uig.id_group=ug.id) where uig.id_user=? group by ap.id,ug.id order by ap.sort;")%] +[% USE dksdb = DBI(dsn, dbuser, dbpassword) %] [% appgaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup from useringroups uig join apps ap on (uig.id_group=ap.id_usergroup) join usergroups ug on (uig.id_group=ug.id) where uig.id_user=? +and menutype='global' group by ap.id,ug.id order by ap.sort;")%] [% appsaccess = dksdb.prepare("select ap.icon,ap.app,ap.name,ug.usergroup from useringroups uig join apps ap on (uig.id_group=ap.id_usergroup) join usergroups ug on (uig.id_group=ug.id) +where uig.id_user=? and menutype='schema' group by ap.id,ug.id order by ap.sort;")%] - [% INCLUDE block/head.tt %] +[% INCLUDE block/head.tt %] + - - - -
- -
-
- -
- - -
- +
- - +
-
-
- - - + + + + + + - + \ No newline at end of file -- 2.39.5