Commit 9fcd18ef86f6501ab1191ea0c860878fc20f415a
1 parent
acd97859
firs page
Showing
3 changed files
with
248 additions
and
1 deletions
Show diff stats
frontend/controllers/SiteController.php
| ... | ... | @@ -69,6 +69,10 @@ class SiteController extends Controller |
| 69 | 69 | ]; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 72 | 76 | /** |
| 73 | 77 | * @inheritdoc |
| 74 | 78 | */ |
| ... | ... | @@ -85,6 +89,13 @@ class SiteController extends Controller |
| 85 | 89 | ]; |
| 86 | 90 | } |
| 87 | 91 | |
| 92 | + | |
| 93 | + | |
| 94 | + public function actionFormsModal() | |
| 95 | + { | |
| 96 | + | |
| 97 | + } | |
| 98 | + | |
| 88 | 99 | /** |
| 89 | 100 | * Displays homepage. |
| 90 | 101 | * | ... | ... |
| 1 | +<script> | |
| 2 | + $(document).ready(function(){ | |
| 3 | + jQuery('.off_list').jScrollPane({ | |
| 4 | + showArrows:true, | |
| 5 | + autoReinitialise: true, | |
| 6 | + autoReinitialiseDelay:200, | |
| 7 | + scrollbarWidth: 25, | |
| 8 | + arrowSize: 25 | |
| 9 | + }); | |
| 10 | + | |
| 11 | + $('.off_list').hide(); | |
| 12 | + $('.main_item, .arrow.up').click(function () {$('.off_list').toggle()}); | |
| 13 | + | |
| 14 | + var listOffer = $('.list-form-offer li'); | |
| 15 | + var listOfferLength = listOffer.length; | |
| 16 | + | |
| 17 | + $(listOffer[listOfferLength-1]).addClass('act-offer-li'); | |
| 18 | + function activeOf(){ | |
| 19 | + var title1 = $('.act-offer-li').find('.title1').text(); | |
| 20 | + var title2 = $('.act-offer-li').find('.title2').text(); | |
| 21 | + | |
| 22 | + $('.main_item .pr_title').empty().text(title1) | |
| 23 | + $('.main_item span').empty().text(title2) | |
| 24 | + } | |
| 25 | + activeOf(); | |
| 26 | + | |
| 27 | + listOffer.click(function(){ | |
| 28 | + var thisOfInd = $(this).index(); | |
| 29 | + var actOfInd = $('.act-offer-li').index(); | |
| 30 | + listOffer.removeClass('act-offer-li'); | |
| 31 | + $(this).addClass('act-offer-li'); | |
| 32 | + | |
| 33 | + if(thisOfInd!=actOfInd) { | |
| 34 | + activeOf(); | |
| 35 | + $('.off_list').hide(); | |
| 36 | + } | |
| 37 | + }) | |
| 38 | + validationModal(); | |
| 39 | + function validationModal(){ | |
| 40 | + var jVal_off = { | |
| 41 | + 'offNsme' : function() { | |
| 42 | + var ele = $('#off_name'); | |
| 43 | + if(ele.val().length < 2) { | |
| 44 | + jVal_off.errors = true; | |
| 45 | + ele.removeClass('normal').addClass('wrong'); | |
| 46 | + } else { | |
| 47 | + ele.removeClass('wrong').addClass('normal'); | |
| 48 | + } | |
| 49 | + }, | |
| 50 | + | |
| 51 | + 'offComm' : function() { | |
| 52 | + var ele = $('#off_text'); | |
| 53 | + if(ele.val().length < 6) { | |
| 54 | + jVal_off.errors = true; | |
| 55 | + ele.removeClass('normal').addClass('wrong'); | |
| 56 | + } else { | |
| 57 | + ele.removeClass('wrong').addClass('normal'); | |
| 58 | + } | |
| 59 | + }, | |
| 60 | + | |
| 61 | + 'offPrice' : function() { | |
| 62 | + var ele = $('#off_price'); | |
| 63 | + if(ele.val().length < 1) { | |
| 64 | + jVal_off.errors = true; | |
| 65 | + ele.removeClass('normal').addClass('wrong'); | |
| 66 | + } else { | |
| 67 | + ele.removeClass('wrong').addClass('normal'); | |
| 68 | + } | |
| 69 | + }, | |
| 70 | + | |
| 71 | + 'offSendIt' : function (){ | |
| 72 | + if(!jVal_off.errors) { | |
| 73 | + $('.question-project').submit(); | |
| 74 | + } | |
| 75 | + } | |
| 76 | + }; | |
| 77 | +// ====================================================== // | |
| 78 | + $('#off_submit').click(function (){ | |
| 79 | + jVal_off.errors = false; | |
| 80 | + jVal_off.offNsme(); | |
| 81 | + jVal_off.offComm(); | |
| 82 | + jVal_off.offPrice(); | |
| 83 | + jVal_off.offSendIt(); | |
| 84 | + return false; | |
| 85 | + }); | |
| 86 | + | |
| 87 | + $('#off_name').focusout(function(){ | |
| 88 | + jVal_off.offNsme(); | |
| 89 | + }); | |
| 90 | + $('#off_text').focusout(function(){ | |
| 91 | + jVal_off.offComm(); | |
| 92 | + }); | |
| 93 | + $('#off_price').focusout(function(){ | |
| 94 | + jVal_off.offPrice(); | |
| 95 | + }); | |
| 96 | + | |
| 97 | + var jVal_qst = { | |
| 98 | + 'qstNsme' : function() { | |
| 99 | + var ele = $('#qst_name'); | |
| 100 | + if(ele.val().length < 2) { | |
| 101 | + jVal_qst.errors = true; | |
| 102 | + ele.removeClass('normal').addClass('wrong'); | |
| 103 | + } else { | |
| 104 | + ele.removeClass('wrong').addClass('normal'); | |
| 105 | + } | |
| 106 | + }, | |
| 107 | + 'qstPhone' : function (){ | |
| 108 | + var ele = $('#qst_phone'); | |
| 109 | + var patt = /[0-9]/g; | |
| 110 | + if(!patt.test(ele.val())) { | |
| 111 | + jVal_qst.errors = true; | |
| 112 | + ele.removeClass('normal').addClass('wrong'); | |
| 113 | + } else { | |
| 114 | + ele.removeClass('wrong').addClass('normal'); | |
| 115 | + } | |
| 116 | + }, | |
| 117 | + 'qstComm' : function() { | |
| 118 | + var ele = $('#qst_text'); | |
| 119 | + if(ele.val().length < 6) { | |
| 120 | + jVal_qst.errors = true; | |
| 121 | + ele.removeClass('normal').addClass('wrong'); | |
| 122 | + } else { | |
| 123 | + ele.removeClass('wrong').addClass('normal'); | |
| 124 | + } | |
| 125 | + }, | |
| 126 | + 'qstSendIt' : function (){ | |
| 127 | + if(!jVal_qst.errors) { | |
| 128 | + $('.question-project').submit(); | |
| 129 | + } | |
| 130 | + } | |
| 131 | + }; | |
| 132 | +// ====================================================== // | |
| 133 | + $('#qst_submit').click(function (){ | |
| 134 | + jVal_qst.errors = false; | |
| 135 | + jVal_qst.qstNsme(); | |
| 136 | + jVal_qst.qstPhone(); | |
| 137 | + jVal_qst.qstComm(); | |
| 138 | + jVal_qst.qstSendIt(); | |
| 139 | + return false; | |
| 140 | + }); | |
| 141 | + | |
| 142 | + $('#qst_name').focusout(function(){ | |
| 143 | + jVal_qst.qstNsme(); | |
| 144 | + }); | |
| 145 | + $('#qst_phone').focusout(function(){ | |
| 146 | + jVal_qst.qstPhone(); | |
| 147 | + }); | |
| 148 | + $('#qst_text').focusout(function(){ | |
| 149 | + jVal_qst.qstComm(); | |
| 150 | + }); | |
| 151 | + } | |
| 152 | + }) | |
| 153 | +</script> | |
| 154 | + | |
| 155 | +<div id="modal_form_favorite"> | |
| 156 | + <div class="closed-form"></div> | |
| 157 | + <div class="form-resume-wr"> | |
| 158 | + <div class="form-resume-sub style">Добавлено в закладки</div> | |
| 159 | + <div class="favorite-user-wr"> | |
| 160 | + <img src="images/ded-ico.png" alt=""/> | |
| 161 | + <div class="favorite-user-profile">Петер Цумторь</div> | |
| 162 | + <div class="favorite-user-profile-add"><img src="images/sidebar-ico/ico-16.png" alt=""/><span>Добавлен</span></div> | |
| 163 | + </div> | |
| 164 | + <div class="res_form_line"></div> | |
| 165 | + <div class="page-favorite"><a href="#" >Перейти на страницу закладок</a></div> | |
| 166 | + </div> | |
| 167 | +</div> | |
| 168 | + | |
| 169 | +<div id="modal_form_offer"> | |
| 170 | + <div class="closed-form"></div> | |
| 171 | + <div class="form-resume-wr offer"> | |
| 172 | + <div class="form-resume-sub style">Предложить проект</div> | |
| 173 | + <form action="" class="offer-project"> | |
| 174 | + | |
| 175 | + <label>Выбрать проект</label><div style="clear:both;"></div> | |
| 176 | + <div class="list_item title"> | |
| 177 | + <div class="main_item"> | |
| 178 | + <div class="pr_title"></div> | |
| 179 | + <span></span> | |
| 180 | + </div> | |
| 181 | + <div class="arrow up"></div> | |
| 182 | + <div class="off_list"> | |
| 183 | + <ul class="content list-form-offer"> | |
| 184 | + <li> | |
| 185 | + <div class="title1">Проект бассейна 1</div> | |
| 186 | + <div class="title2">Подряд: Вилла 1</div> | |
| 187 | + </li> | |
| 188 | + <li> | |
| 189 | + <div class="title1">Проект бассейна 2</div> | |
| 190 | + <div class="title2">Подряд: Вилла 2</div> | |
| 191 | + </li> | |
| 192 | + <li> | |
| 193 | + <div class="title1">Проект бассейна 3</div> | |
| 194 | + <div class="title2">Подряд: Вилла 3</div> | |
| 195 | + </li> | |
| 196 | + <li> | |
| 197 | + <div class="title1">Проект бассейна 4</div> | |
| 198 | + <div class="title2">Подряд: Вилла 4</div> | |
| 199 | + </li> | |
| 200 | + <li> | |
| 201 | + <div class="title1">Проект бассейна 5</div> | |
| 202 | + <div class="title2">Подряд: Вилла 5</div> | |
| 203 | + </li> | |
| 204 | + </ul> | |
| 205 | + </div> | |
| 206 | + </div> | |
| 207 | + | |
| 208 | + <label for="off_name">Название проекта</label><input id="off_name" name="" type="text"> | |
| 209 | + | |
| 210 | + <label for="off_text">Описание</label><textarea id="off_text" name=""></textarea> | |
| 211 | + | |
| 212 | + <label for="off_price">Цена</label><input id="off_price" name="" type="text"> | |
| 213 | + | |
| 214 | + <input id="off_submit" type="submit" value="Предложить"> | |
| 215 | + </form> | |
| 216 | + <div class="res_form_line"></div> | |
| 217 | + </div> | |
| 218 | +</div> | |
| 219 | + | |
| 220 | +<div id="modal_form_question"> | |
| 221 | + <div class="closed-form"></div> | |
| 222 | + <div class="form-resume-wr question"> | |
| 223 | + <div class="form-resume-sub style">Задать вопрос МФП</div> | |
| 224 | + <form action="" class="question-project"> | |
| 225 | + <label for="qst_name">Ваши имя и фамилия</label><input id="qst_name" name="" type="text"> | |
| 226 | + | |
| 227 | + <label for="qst_phone">Контактный телефон</label><input id="qst_phone" name="" type="text"> | |
| 228 | + | |
| 229 | + <label for="qst_text">Вопрос</label><textarea id="qst_text" name=""></textarea> | |
| 230 | + | |
| 231 | + <input id="qst_submit" type="submit" value="Отправить"> | |
| 232 | + </form> | |
| 233 | + <div class="res_form_line"></div> | |
| 234 | + </div> | |
| 235 | +</div> | |
| 236 | + | ... | ... |
frontend/web/js/no-comprss/forms-nocompress.js
| 1 | 1 | $(document).ready(function(){ |
| 2 | 2 | if($('.blog-buttons-add-favorite, .performance-vacancy-add-favorite a, .get-list, .main-menu-icons-copy, .blog-buttons-offer, .get-project, .main-menu-icons-home').length>0) { |
| 3 | 3 | var overlayLength = $('#overlay').length |
| 4 | - $.post("forms-modal.html", function (data) { | |
| 4 | + $.post("site/forms-modal", function (data) { | |
| 5 | 5 | if ( !overlayLength>0 ){ |
| 6 | 6 | $("body").append('<div id="overlay"></div>'); |
| 7 | 7 | } | ... | ... |