From ac5369a16f371f9897290fe12642880aeaba3d56 Mon Sep 17 00:00:00 2001 From: pero1203 Date: Tue, 14 Sep 2021 14:22:08 +0200 Subject: [PATCH] Dokoncan desni meni z nastavitvami za mobile --- .../mobile/class.MobileSurveyAdmin.php | 143 +++++++++--------- admin/survey/script/mobile.js | 114 +++++++++----- public/css/admin.css | 51 ++++--- resources/sass/admin/mobile/header.scss | 69 ++++++--- 4 files changed, 228 insertions(+), 149 deletions(-) diff --git a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php index c6e2246ae..72d3ef16b 100644 --- a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php +++ b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php @@ -41,21 +41,23 @@ class MobileSurveyAdmin{ // Naslov ankete + slider za nastavitve if($this->surveyAdminClass->anketa > 0){ + + // Naslov ankete na sredini $this->displaySurveyTitle(); - if ($_GET['a'] == 'branching') { - $this->displaySurveySettingsIcon(); - $this->displayMenuSurveySettings(); - } + + // Ikona za nastavitve + $this->displaySurveySettingsIcon(); + + // Div holder za nastavitve + $this->displayMenuSurveySettings(); } // Logo - enak kot na desktopu else{ $this->displayLogo(); } - // Se inicializiramo zeynep jquery mobile menu + // Se inicializiramo zeynep jquery mobile menu in settings meni na desni echo ''; - // inicializira meni nastavitev v urejanju ankete - echo ''; echo ''; } @@ -120,9 +122,6 @@ class MobileSurveyAdmin{ // Izris glavne navigacije v dropdownu $this->displayMenuSurveyNavigation(); - - // Izris akcij za anketo (kopiraj, brisi...) v dropdownu - $this->displayMenuSurveyActions(); } // Meni v mojih anketah else{ @@ -133,57 +132,64 @@ class MobileSurveyAdmin{ } - -// Izris menija za nastavitve v urejanju ankete -private function displayMenuSurveySettings(){ - global $lang; + + // Izris menija za nastavitve v urejanju ankete + private function displayMenuSurveySettings(){ + global $lang; + global $admin_type; - echo '
'; - echo '
'; + echo '
'; - // prikaz gumbov za vklop in odklepanje ankete - v delu - $d = new Dostop(); + echo '
'; + + $row = SurveyInfo::getInstance()->getSurveyRow(); + + $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null); + + + // prikaz gumbov za vklop in odklepanje ankete + $d = new Dostop(); if ($d->checkDostopAktiven()) { - echo ''; - + # anketa je aktivna if (SurveyInfo::getSurveyColumn('active') == 1) { - # anketa je aktivna + # V kolikor gre za hierarhijo in uporabnik ni administrator hierarhije if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){ if ($hierarhija_type == 1) { - echo ''; - } else{ + echo ''; + } + else{ echo ''; } - }else { - echo ''; + } + else { + echo ''; } - echo '
ON
'; + echo '
ON
'; + echo '
'.$lang['srv_anketa_active'].'
'; echo '
'; - } else { - $anketa_active = "anketa_active('" . $this->anketa . "','" . $row['active'] . "'); "; + } + else { + $anketa_active = " mobile_settings_close(function(){ anketa_active('" . $this->surveyAdminClass->anketa . "','" . $row['active'] . "'); }); "; - //Preden anketo aktiviramo preverimo, če gre tudi za izgradnjo hierarhije in če anketa še ni bila aktivirana + // Preden anketo aktiviramo preverimo, če gre tudi za izgradnjo hierarhije in če anketa še ni bila aktivirana if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){ if ($hierarhija_type == 1) { - echo ''; - } else{ + echo ''; + } + else{ echo ''; } - }else { + } + else { echo ''; } - - if ((int)$_last_active > 0) { - # anketa je zaključena - echo '
OFF
'; - } else { - # anketa je neaktivna - echo '
OFF
'; - } + + echo '
OFF
'; + echo '
'.$lang['srv_anketa_noactive'].'
'; echo '
'; } @@ -191,29 +197,46 @@ private function displayMenuSurveySettings(){ // Ce ima uporabnik prepreceno moznost odklepanja ankete, anketo ima vedno zaklenjeno če je vklopljena hierarhija $prevent_unlock = (SurveyInfo::getSurveyModules('hierarhija') == 2 || $d->checkDostopSub('lock') && $row['locked'] == 1 && ($admin_type != 0 && $admin_type != 1)) ? 1 : 0; if ($prevent_unlock == 1) { + echo ''; + echo ''; - echo ''; + echo '
'; + echo '
'.$lang['srv_anketa_locked_close'].'
'; echo '
'; - } else { + } + else { # zaklepanje - //echo ''; if ($hierarhija_type == 10) { echo ''; - } else { - echo ''; + } + else { + echo ''; } - echo ''; + echo '
'; + echo '
'.$lang['srv_anketa_locked_' . $row['locked']].'
'; echo '
'; } - echo '
'; + + // Izris akcij za anketo (kopiraj, brisi...) v dropdownu + # kopiranje + echo ' '; + echo '
'; + echo '
'.$lang['srv_anketacopy'].'
'; + echo '
'; + + # brisanje + echo ' '; + echo '
'; + echo '
'.$lang['srv_anketadelete'].'
'; + echo '
'; } + echo '
'; - echo '
'; - -} + echo '
'; + } // Izris uporabniških podatkov v dropdownu private function displayMenuUser(){ @@ -935,26 +958,6 @@ private function displayMenuSurveySettings(){ echo ''; } - // Izris akcij za anketo (kopiraj, brisi...) v dropdownu - private function displayMenuSurveyActions(){ - global $lang; - - echo '
'; - - # kopiranje - echo ' '; - echo ' '.$lang['srv_anketacopy']; - echo ' '; - - # brisanje - echo ' '; - echo ' '.$lang['srv_anketadelete']; - echo ' '; - - echo '
'; - } - - private function displayMenuItemWithSubmenu($name, $title, $submenu, $active=""){ global $lang; diff --git a/admin/survey/script/mobile.js b/admin/survey/script/mobile.js index b1a326516..162c6ec4b 100644 --- a/admin/survey/script/mobile.js +++ b/admin/survey/script/mobile.js @@ -8,55 +8,97 @@ function mobile_init(){ closed: function () { } - }) + }) - // dynamically bind 'closing' event - zeynep.on('closing', function () { + // dynamically bind 'closing' event + zeynep.on('closing', function () { - }) + }) - // handle zeynepjs overlay click - $('.mobile_menu_close').on('click', function () { - zeynep.close(); - $('#fade').fadeOut(); + // handle zeynepjs overlay click + $('.mobile_menu_close').on('click', function () { - $('.mobile_menu_close').fadeOut('fast', function(){ - $('.mobile_menu_open').fadeIn('fast'); - }); - }) + $('#fade').fadeOut(); - // open zeynepjs side menu - $('.mobile_menu_open').on('click', function () { - zeynep.open(); + mobile_menu_close(zeynep); + }) + + // open zeynepjs side menu + $('.mobile_menu_open').on('click', function () { + + if($('#fade').is(':hidden')){ $('#fade').fadeIn(); + } + else{ + mobile_settings_close(zeynep); + } + + mobile_menu_open(zeynep); + }) - $('.mobile_menu_open').fadeOut('fast', function(){ - $('.mobile_menu_close').fadeIn('fast'); - }); - }) + // handle settings overlay click + $('.mobile_settings_close').on('click', function () { + + $('#fade').fadeOut(); + + mobile_settings_close(zeynep); + }) + + // open settings side menu + $('.mobile_settings_open').on('click', function () { + + if($('#fade').is(':hidden')){ + $('#fade').fadeIn(); + } + else{ + mobile_menu_close(zeynep); + } + + mobile_settings_open(zeynep); + }) } -function mobile_settings_init() { +// Odpremo mobile meni na levi +function mobile_menu_open(zeynep){ - // handle settings overlay click - $('.mobile_settings_close').on('click', function () { - $('.mobile_settings').animate({"margin-right": '-=85vw'},200,'linear'); - $('#fade').fadeOut(); + zeynep.open(); - $('.mobile_settings_close').fadeOut('fast', function(){ - $('.mobile_settings_open').fadeIn('fast'); - }); - }) + $('.mobile_menu_open').fadeOut('fast', function(){ + $('.mobile_menu_close').fadeIn('fast'); + }); +} - // open settings side menu - $('.mobile_settings_open').on('click', function () { - $('.mobile_settings').animate({"margin-right": '+=85vw'},200,'linear'); - $('#fade').fadeIn(); +// Zapremo mobile meni na levi +function mobile_menu_close(zeynep){ - $('.mobile_settings_open').fadeOut('fast', function(){ - $('.mobile_settings_close').fadeIn('fast'); - }); - }) + zeynep.close(); + + $('.mobile_menu_close').fadeOut('fast', function(){ + $('.mobile_menu_open').fadeIn('fast'); + }); +} + +// Odpremo settings meni na desni +function mobile_settings_open(){ + + $('.mobile_settings').animate({"margin-right": '+=85vw'},200,'linear'); + + $('.mobile_settings_open').fadeOut('fast', function(){ + $('.mobile_settings_close').fadeIn('fast'); + }); +} + +// Zapremo settings meni na desni +function mobile_settings_close(callback){ + + $('.mobile_settings').animate({"margin-right": '-85vw'},200,'linear'); + + $('.mobile_settings_close').fadeOut('fast', function(){ + $('.mobile_settings_open').fadeIn('fast'); + }); + + if (typeof callback == "function") + callback(); } diff --git a/public/css/admin.css b/public/css/admin.css index 5054fb18f..1665dae38 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -28708,6 +28708,9 @@ fieldset textarea { .mobile_header .mobile_settings_icon span { cursor: pointer; } + .mobile_header .mobile_settings_icon span::before { + font-size: 24px; + } .mobile_header .mobile_survey_title { width: calc(100% - 120px); text-align: center; @@ -28856,27 +28859,12 @@ fieldset textarea { padding-right: 10px; vertical-align: -1px; } - .mobile_menu .mobile_menu_actions { - display: flex; - flex-direction: column; - padding: 20px; - } - .mobile_menu .mobile_menu_actions a { - padding: 0 0 15px 0; - font-size: 13px; - } - .mobile_menu .mobile_menu_actions a .faicon::before { - padding-right: 10px; - font-size: 20px; - } /* Mobile meni - NASTAVITVE V UREJANJU ANKETE*/ .mobile_settings { position: fixed; right: 0; z-index: 9994; - display: flex; - flex-direction: column; top: 71px; bottom: 0; width: 85vw; @@ -28885,13 +28873,40 @@ fieldset textarea { overflow: hidden; -webkit-overflow-scrolling: touch; overflow-y: auto; - pointer-events: none; + /*pointer-events: none;*/ margin-right: -85vw; } - - .mobile_settings_content { + .mobile_settings .mobile_settings_content { + display: flex; + flex-direction: column; padding: 20px; } + .mobile_settings .mobile_settings_content a { + display: flex; + align-items: center; + padding: 0 0 15px 0; + font-size: 13px; + } + .mobile_settings .mobile_settings_content a.anketa_img_nav { + padding-bottom: 20px; + margin-bottom: 20px; + border-bottom: 1px #c8e3f8 solid; + } + .mobile_settings .mobile_settings_content a .faicon::before { + padding-right: 10px; + font-size: 20px; + } + .mobile_settings .mobile_settings_content a .setting_icon { + width: 60px; + min-width: 60px; + } + .mobile_settings .mobile_settings_content a .setting_icon.bottom { + width: 30px; + min-width: 30px; + } + .mobile_settings .mobile_settings_content a .setting_text { + width: auto; + } #srv_footer { display: flex; diff --git a/resources/sass/admin/mobile/header.scss b/resources/sass/admin/mobile/header.scss index 2046bd4d1..b957bcdb0 100644 --- a/resources/sass/admin/mobile/header.scss +++ b/resources/sass/admin/mobile/header.scss @@ -62,6 +62,10 @@ span{ cursor: pointer; + + &::before{ + font-size: 24px; + } } } @@ -262,24 +266,6 @@ } } } - - .mobile_menu_actions{ - display: flex; - flex-direction: column; - - padding: 20px; - - a{ - padding: 0 0 15px 0; - - font-size: 13px; - - .faicon::before{ - padding-right: 10px; - font-size: 20px; - } - } - } } /* Mobile meni - NASTAVITVE V UREJANJU ANKETE*/ @@ -288,9 +274,6 @@ right: 0; z-index: 9994; - display: flex; - flex-direction: column; - top: 71px; bottom: 0; width: 85vw; @@ -302,10 +285,46 @@ overflow: hidden; -webkit-overflow-scrolling: touch; overflow-y: auto; - pointer-events: none; + /*pointer-events: none;*/ margin-right: -85vw; -} -.mobile_settings_content { - padding: 20px; + .mobile_settings_content { + display: flex; + flex-direction: column; + + padding: 20px; + + a{ + display: flex; + align-items: center; + + padding: 0 0 15px 0; + + font-size: 13px; + + &.anketa_img_nav{ + padding-bottom: 20px; + margin-bottom: 20px; + border-bottom: 1px $soft_blue solid; + } + + .faicon::before{ + padding-right: 10px; + font-size: 20px; + } + + .setting_icon{ + width: 60px; + min-width: 60px; + + &.bottom{ + width: 30px; + min-width: 30px; + } + } + .setting_text{ + width: auto; + } + } + } }