diff --git a/admin/survey/Branching.php b/admin/survey/Branching.php index b5be7d635..3e2c859ae 100644 --- a/admin/survey/Branching.php +++ b/admin/survey/Branching.php @@ -339,10 +339,8 @@ class Branching { $row = SurveyInfo::getInstance()->getSurveyRow(); - //if ($row['toolbox'] == 1 || $row['toolbox'] == 2) if($this->survey_type != 0) $this->toolbox_basic2(); - //else if ($row['toolbox'] >= 3) $this->toolbox_library(); @@ -353,6 +351,8 @@ class Branching { }); anketa); } /** diff --git a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php index 2a13b2888..82eb28f40 100644 --- a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php +++ b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php @@ -689,4 +689,34 @@ class MobileSurveyAdmin{ echo ''.$title.''; echo ''; } + + + // Gumb za dodajanje vprasanja + public static function displayAddQuestion($ank_id){ + global $lang; + + echo '
'; + echo ' '; + echo ' + '; + echo ' '.$lang['srv_mobile_add_question'].''; + echo ' '; + echo '
'; + + + // Popup za dodajanje vprašanja + echo '
'; + + echo '
'.$lang['srv_vprasanje_tip_1'].'
'; + echo '
'.$lang['srv_vprasanje_tip_2'].'
'; + echo '
'.$lang['srv_vprasanje_tip_21'].'
'; + echo '
'.$lang['srv_vprasanje_tip_7'].'
'; + echo '
'.$lang['srv_vprasanje_tip_5'].'
'; + echo '
'.$lang['srv_vprasanje_tip_6'].'
'; + + echo ' '; + echo ' Zapri'; + echo ' '; + + echo '
'; + } } diff --git a/admin/survey/script/branching.js b/admin/survey/script/branching.js index 1dd4f39c9..02703def1 100644 --- a/admin/survey/script/branching.js +++ b/admin/survey/script/branching.js @@ -2035,13 +2035,16 @@ function dodaj_blok_interpretacije() { // --------------------------------------- // refresha levo stran z branchingom -function refreshLeft(spremenljivka, removeID) { +function refreshLeft(spremenljivka, callback) { $.post('ajax.php?t=branching&a=refresh_left', { spremenljivka: spremenljivka, anketa: srv_meta_anketa_id }, function (data) { $('#branching').html(data); + + if (typeof callback == "function") + callback(); }); } diff --git a/admin/survey/script/mobile.js b/admin/survey/script/mobile.js index 4e69731c9..432fd9e2d 100644 --- a/admin/survey/script/mobile.js +++ b/admin/survey/script/mobile.js @@ -35,3 +35,41 @@ function mobile_init(){ }); }) } + +// Popup za dodajanje vprasanja na mobile +function mobile_add_question_popup(){ + $('.mobile_add_question_popup').fadeIn(); +} + +// Popup za dodajanje vprasanja na mobile +function mobile_add_question_popup_close(){ + $('.mobile_add_question_popup').fadeOut(); +} + +// Popup za dodajanje vprasanja na mobile +function mobile_add_question(tip){ + + mobile_add_question_popup_close(); + + $.post('ajax.php?t=branching&a=spremenljivka_new', { + spremenljivka: 0, + 'if': 0, + endif: 1, + copy: 0, + tip: tip, + podtip: 0, + anketa: srv_meta_anketa_id + }, function (data) { + if (!data) return; + + refreshLeft(data.nova_spremenljivka_id, function(){ + + // Scroll do novega vprasanja + $("html, body").animate({ + scrollTop: $('#spremenljivka_content_'+data.nova_spremenljivka_id).offset().top - 100 + }, 1000); + }); + + }, 'json'); +} + diff --git a/lang/1.php b/lang/1.php index 577fa6502..0c855545d 100644 --- a/lang/1.php +++ b/lang/1.php @@ -3852,6 +3852,7 @@ $lang = array ( "srv_mobile_settings" => "Mobilne nastavitve", "srv_mobile_settings_title" => "Nastavitve prikaza pri mobinih napravah", "srv_mobile_survey" => "Anketa ustvarjena v mobilni aplikaciji", + "srv_mobile_add_question" => "Dodaj vprašanje", "srv_standardne_besede" => "Standardne besede", "srv_prevajanje_dodaj" => "Dodaj nov prevod za", "srv_base_lang" => "Osnovni jezik", diff --git a/lang/2.php b/lang/2.php index d3ef4486f..854686884 100644 --- a/lang/2.php +++ b/lang/2.php @@ -3825,6 +3825,7 @@ $lang = array ( "srv_mobile_settings" => "Mobile settings", "srv_mobile_settings_title" => "Display settings for mobile devices", "srv_mobile_survey" => "Survey created with mobile app", + "srv_mobile_add_question" => "Add question", "srv_prevajanje_dodaj" => "Add translation for", "srv_base_lang" => "Basic language", "srv_lang_elements" => "Standard text", diff --git a/public/css/admin.css b/public/css/admin.css index 2ae9583d4..1e44e0ba9 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -14116,6 +14116,14 @@ and open the template in the editor. padding-top: 85px; } +.mobile_add_question { + display: none; +} + +.mobile_add_question_popup { + display: none; +} + /* To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates @@ -28841,11 +28849,15 @@ table.dashboard > tbody > tr > td { margin: 15px 0; } + .page_branching #placeholder { + margin-left: 0; + } + #branching { width: 100%; } #branching li { - margin: 0 10px 0 20px !important; + margin: 0 10px 0 10px !important; } #branching .spr_edit { display: none !important; @@ -28886,10 +28898,12 @@ table.dashboard > tbody > tr > td { } #toolbox_advanced_settings { + display: none !important; top: 150px; } #toolbox_basic { + display: none !important; top: 187px; } @@ -28897,6 +28911,81 @@ table.dashboard > tbody > tr > td { display: none !important; } + .mobile_add_question { + display: block; + position: fixed; + bottom: 25px; + left: calc(50% - 95px); + width: 190px; + } + .mobile_add_question a { + display: flex !important; + justify-content: center; + padding: 10px 20px 10px !important; + font-size: 14px; + font-weight: 500; + } + .mobile_add_question .plus { + margin-right: 8px; + font-size: 28px; + line-height: 15px; + font-weight: 600; + } + + .mobile_add_question_popup { + z-index: 9999; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + box-sizing: border-box; + padding: 40px 20px 20px 20px; + background: white; + } + .mobile_add_question_popup .mobile_add_question_item { + cursor: pointer; + position: relative; + box-sizing: border-box; + width: 300px; + height: 45px; + margin: 15px auto 5px auto; + font-size: 16px; + font-weight: 500; + text-align: center; + background-color: #f5fafe; + border: 1px #dfeffb solid; + } + .mobile_add_question_popup .mobile_add_question_item:hover { + background-color: #dfeffb; + border: 1px #c8e3f8 solid; + } + .mobile_add_question_popup .mobile_add_question_item span.faicon { + position: absolute; + left: 20px; + line-height: 42px; + } + .mobile_add_question_popup .mobile_add_question_item span.faicon.matrix_32 { + line-height: 10px; + margin-top: 9px; + } + .mobile_add_question_popup .mobile_add_question_item span.item_text { + line-height: 42px; + } + .mobile_add_question_popup .mobile_add_question_button { + position: absolute; + bottom: 25px; + left: calc(50% - 95px); + box-sizing: border-box; + width: 190px; + text-align: center; + } + .mobile_add_question_popup .mobile_add_question_button a { + padding: 10px 20px 10px !important; + font-size: 14px; + font-weight: 500; + } + #vprasanje_float_editing { position: fixed; z-index: 99999; diff --git a/resources/sass/admin/branching/toolbox.scss b/resources/sass/admin/branching/toolbox.scss index eaaec6168..73b8111af 100644 --- a/resources/sass/admin/branching/toolbox.scss +++ b/resources/sass/admin/branching/toolbox.scss @@ -232,4 +232,12 @@ and open the template in the editor. } height: 266px; top: 235px; -} \ No newline at end of file +} + + +.mobile_add_question{ + display: none; +} +.mobile_add_question_popup{ + display: none; +} diff --git a/resources/sass/admin/mobile/pages/branching.scss b/resources/sass/admin/mobile/pages/branching.scss index dc4f75e15..184818614 100644 --- a/resources/sass/admin/mobile/pages/branching.scss +++ b/resources/sass/admin/mobile/pages/branching.scss @@ -1,9 +1,13 @@ +.page_branching #placeholder{ + margin-left: 0; +} + #branching{ width: 100%; li{ - margin: 0 10px 0 20px !important; + margin: 0 10px 0 10px !important; } .spr_edit{ @@ -58,9 +62,11 @@ // Toolbox na levi #toolbox_advanced_settings{ + display: none !important; top: 150px; } #toolbox_basic{ + display: none !important; top: 187px; } @@ -70,6 +76,106 @@ } +// Mobile gumb za dodajanje vprašanja na konec +.mobile_add_question{ + display: block; + position: fixed; + bottom: 25px; + left: calc(50% - 95px); + + width: 190px; + + a{ + display: flex !important; + justify-content: center; + padding: 10px 20px 10px !important; + + font-size: 14px; + font-weight: 500; + } + + .plus{ + margin-right: 8px; + + font-size: 28px; + line-height: 15px; + font-weight: 600; + } +} + +// Mobile popup za dodajanje vprasanja +.mobile_add_question_popup{ + z-index: 9999; + position: fixed; + top: 0; + left: 0; + + width: 100%; + height: 100%; + + box-sizing: border-box; + padding: 40px 20px 20px 20px; + + background: white; + + .mobile_add_question_item{ + cursor: pointer; + position: relative; + + box-sizing: border-box; + width: 300px; + height: 45px; + + margin: 15px auto 5px auto; + + font-size: 16px; + font-weight: 500; + text-align: center; + + background-color: $soft_blue_very_lighten; + border: 1px $soft_blue_lighten solid; + + &:hover{ + background-color: $soft_blue_lighten; + border: 1px $soft_blue solid; + } + + span.faicon{ + position: absolute; + left: 20px; + line-height: 42px; + + &.matrix_32{ + line-height: 10px; + margin-top: 9px; + } + } + span.item_text{ + line-height: 42px; + } + } + + .mobile_add_question_button{ + position: absolute; + bottom: 25px; + left: calc(50% - 95px); + + box-sizing: border-box; + width: 190px; + + text-align: center; + + a{ + padding: 10px 20px 10px !important; + + font-size: 14px; + font-weight: 500; + } + } +} + + + // Urejanje vprasanja popup #vprasanje_float_editing{ position: fixed;