diff --git a/common/messages/ru/app.php b/common/messages/ru/app.php index ad07570..588b307 100644 --- a/common/messages/ru/app.php +++ b/common/messages/ru/app.php @@ -91,7 +91,6 @@ return [ 'Company Title' => 'ArtPlast', - 'Description 1' => 'Завод-производитель «Артпласт» предлагает отличный профессиональный скотч. Наш продукт выдерживает растяжение, высокие нагрузки, не теряет своих качеств при низких и высоких температурах.', diff --git a/common/models/Feedback.php b/common/models/Feedback.php index ade069f..b1d4177 100644 --- a/common/models/Feedback.php +++ b/common/models/Feedback.php @@ -129,11 +129,13 @@ [ 'email' ], 'email', ], - // [ - // [ 'phone' ], - // 'match', - // 'pattern' => '/^\+38\(\d{3}\)\d{3}-\d{2}-\d{2}$/', - // ], + [ + [ 'phone' ], + 'match', + 'pattern' => '/^\+38\(\d{3}\)\d{3}-\d{2}-\d{2}$/', + 'message' => 'test 12345', + 'on' => self::SCENARIO_DEFAULT, + ], [ [ 'name', diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index e6ddb21..577d5f4 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -16,6 +16,7 @@ ]; public $js = [ + 'js/jquery.mask.min.js', "js/script.js", "js/markerclusterer.js", "js/map.js", diff --git a/frontend/config/main.php b/frontend/config/main.php index 3f7933b..965f790 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -75,7 +75,7 @@ 'contact' => [ 'class' => 'artbox\core\forms\Module', - 'activeRecord' => "artbox\core\models\Feedback", + 'activeRecord' => "common\models\Feedback", 'templateForm' => '
{form}
', 'attributes' => [ 'name', @@ -115,11 +115,9 @@ ], ], - 'buttonTemplate' => '
{button}
', - 'buttonOptions' => [ - 'class' => 'btn btn-template-main', - ], - 'buttonContent' => ' Send message', + 'buttonTemplate' => '
{button}
', + + 'buttonContent' => ' Отправить', 'sendEmail' => true, 'email' => 'alkhonko@gmail.com', 'subject' => 'test tt22', diff --git a/frontend/mail/layouts/html.php b/frontend/mail/layouts/html.php index 6cf6670..ed688a9 100644 --- a/frontend/mail/layouts/html.php +++ b/frontend/mail/layouts/html.php @@ -1 +1,7 @@ -

Поступила новая заявка от пользователя

\ No newline at end of file + + + +

Поступила новая заявка от пользователя

+

Email:

+

Имя:

+

Телефон:

diff --git a/frontend/web/js/jquery.mask.min.js b/frontend/web/js/jquery.mask.min.js old mode 100644 new mode 100755 index cc9e30c..cc9e30c --- a/frontend/web/js/jquery.mask.min.js +++ b/frontend/web/js/jquery.mask.min.js diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index cbe613a..dd2cd2d 100644 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -4,10 +4,28 @@ $(document).ready(function() { modalForms(); openMobMenuNew(); closeMobMenu(); - + phoneMask('#feedback-phone'); anchor(); fixedHeader(); + function phoneMask(phoneInput2) { + var phoneInput = phoneInput2; + + if($('body').find(phoneInput).length>0){ + $(phoneInput).mask('+38(000)000-00-00',{placeholder:'+38(0__)___-__-__'}); + $(phoneInput).focus(function () { + if(($(this).val())== '') {$(this).val('+38(0')} + }) + $(phoneInput).focusout(function () { + var phoneVal = $(this).val() + //if(phoneVal == '+38(0' || phoneVal == '+38(' || phoneVal == '+38' || phoneVal == '+3' || phoneVal == '+') {$(this).val('')} + if(phoneVal.length <17) {$(this).val('')} + }) + } + } + + + function footerBottom(){ var heightHeader = document.getElementById('header_').offsetHeight var heightFooter = document.getElementById('footer_').offsetHeight -- libgit2 0.21.4