diff --git a/common/messages/en/app.php b/common/messages/en/app.php index d891ff2..0c8e42c 100644 --- a/common/messages/en/app.php +++ b/common/messages/en/app.php @@ -9,32 +9,32 @@ return [ 'Categories' => 'Categories', 'Contact form' => "Contact form", 'Continue reading' => 'Continue reading', - 'Contact us!' => 'Contact us!', - 'Email'=>'Email', - 'Gallery'=>'Gallery', - 'Go to contact page' => 'Go to contact page', - 'Our clients'=>'Our clients', - 'No results found'=>'No results found', - 'Home'=>'Home', - 'Search'=>'Search', - 'Search by tag' => 'Search by tag', - "Search by article"=>'Search by article', - 'Send' => 'Send', - 'Send message' => 'Send message', - 'Events' => 'Events', - 'You question' => 'You question', - 'News' => 'News', - 'Media' => 'Media', - 'More' => 'More', - - 'Message' => 'Message', - 'Name' => 'Name', - 'Phone' => 'Phone', - - - - - + 'Contact us!' => 'Contact us!', + 'Email' =>'Email', + 'Gallery' =>'Gallery', + 'Go to contact page' => 'Go to contact page', + 'Our clients' =>'Our clients', + 'No results found' =>'No results found', + 'Home' =>'Home', + 'Search' =>'Search', + 'Search by tag' => 'Search by tag', + "Search by article" =>'Search by article', + 'Send' => 'Send', + 'Send message' => 'Send message', + 'Events' => 'Events', + 'You question' => 'You question', + 'News' => 'News', + 'Media' => 'Media', + 'More' => 'More', + 'Form sends success' => 'Form sends success', + 'Message' => 'Message', + 'Name' => 'Name', + 'Phone' => 'Phone', + 'Form sends success Header' => 'Success', + + + + 'phone' => 'phone', 'Without category'=>'Without category', 'Our advantages' => 'Our advantages', diff --git a/common/messages/ru/app.php b/common/messages/ru/app.php index 52b8524..9cb9bf6 100644 --- a/common/messages/ru/app.php +++ b/common/messages/ru/app.php @@ -6,40 +6,30 @@ return [ 'Blog' => 'Блог', 'Events' => 'Мероприятия', 'You question' => 'Ваш вопрос', - 'Send' => 'Отправить', 'Contact us!' => 'Свяжитесь с нами', - 'Go to contact page' => 'Перейти на страницу контактов', - 'Send message' => 'Отправить сообщение', - 'Contact form' => "Форма для связи", - 'News' => 'Новости', - 'Media' => 'Медиа', - 'More' => 'Подробнее', - 'Company Blog' => 'Блог компании', - - 'email'=>'Email 12345', - 'Email'=>'Email 12345', - 'Message' => 'Сообщения', - - 'Name' => 'Имя', - 'Phone' => 'Телефон', - - - - - 'blog-txt' => ' Мы собираем полезные материалы по тематике бытовой техники и электроники', - 'Continue reading' => 'Продолжить чтение', - 'Address' => 'Адрес', - 'phone' => 'Телефон', - - 'Gallery'=>'Галерея', - 'Categories' => 'Категории', - 'Without category'=>'Без категории', - 'No results found'=>'Ничего не найдено', - - - 'Our advantages' => 'Наши преимущества', - 'Our clients'=>'Наши клиенты', - + 'Go to contact page' => 'Перейти на страницу контактов', + 'Send message' => 'Отправить сообщение', + 'Contact form' => "Форма для связи", + 'News' => 'Новости', + 'Media' => 'Медиа', + 'More' => 'Подробнее', + 'Company Blog' => 'Блог компании', + 'Message' => 'Сообщения', + 'Name' => 'Имя', + 'Phone' => 'Телефон', + 'blog-txt' => ' Мы собираем полезные материалы по тематике бытовой техники и электроники', + 'Continue reading' => 'Продолжить чтение', + 'Address' => 'Адрес', + 'phone' => 'Телефон', + 'Form sends success' => 'Форма успешно отправлена', + 'Gallery' =>'Галерея', + 'Categories' => 'Категории', + 'Without category' =>'Без категории', + 'No results found' =>'Ничего не найдено', + 'Form sends success Header' => 'Форма успешно отправлена ', + 'Our advantages' => 'Наши преимущества', + 'Our clients' =>'Наши клиенты', + 'Send' => 'Отправить', "Search"=>'Поиск', 'Search by tag' => 'Поиск по тегам', diff --git a/common/messages/ua/app.php b/common/messages/ua/app.php index 250545e..a321d6e 100644 --- a/common/messages/ua/app.php +++ b/common/messages/ua/app.php @@ -1,40 +1,46 @@ 'Головна', - 'Contacts' => 'Контакти', - 'About' => 'Про нас', - 'Blog' => 'Блог', - 'Events' => 'Заходи', - 'Name' => 'Ім\'я', - 'Phone' => 'Телефон', - 'Message' => 'Повідомленя', - 'You question' => 'Ваше питання', - 'Send' => 'Відправити', - 'Contact us!' => 'Зв\'яжіться з нами', + 'Home' => 'Головна', + 'Contacts' => 'Контакти', + 'About' => 'Про нас', + 'Blog' => 'Блог', + 'Events' => 'Заходи', + 'Empty field' => 'Поле є обов\'язковим для заповнення', + 'Name' => 'Ім\'я', + 'Phone' => 'Телефон', + 'Message' => 'Повідомленя', + 'You question' => 'Ваше питання', + 'Send' => 'Відправити', + 'Contact us!' => 'Зв\'яжіться з нами', 'Go to contact page' => 'Перейти до сторінки контактів', - 'Читать далее' => 'Читати далі', - "Send message" => 'Надіслати повідомлення', - "Contact form" => 'Форма для зв\'язку', - 'News' => 'Новини', - 'Media' => 'Медіа', - 'More' => 'Докладніше', - 'Company Blog' => 'Блог компанії', - 'Categories' => 'Категорії', - 'blog-txt' => 'Ми збираємо корисні матеріали з тематики побутової техніки та електроніки', - 'Continue reading' => 'Продовжити читання', - 'Address' => 'Адреса', - 'phone' => 'телефон', - 'Gallery'=>'Галерея', - 'Without category'=>'Без категорії', - 'No results found'=>'Нічого не знайдено', - + 'Читать далее' => 'Читати далі', + "Send message" => 'Надіслати повідомлення', + "Contact form" => 'Форма для зв\'язку', + 'News' => 'Новини', + 'Media' => 'Медіа', + 'More' => 'Докладніше', + 'Company Blog' => 'Блог компанії', + 'Categories' => 'Категорії', + 'blog-txt' => 'Ми збираємо корисні матеріали з тематики побутової техніки та електроніки', + 'Continue reading' => 'Продовжити читання', + 'Address' => 'Адреса', + 'phone' => 'телефон', + 'Gallery' =>'Галерея', + 'Without category' =>'Без категорії', + 'No results found' =>'Нічого не знайдено', + 'Our advantages' => 'Наші переваги', 'Our clients'=>'Наші клієнти', - + 'Search'=>'Пошук', 'Search by tag' => 'Пошук по тегам', "Search by article"=>'Поиск по статтям', - + 'Form sends success Header' => 'Форма успішно відправлена', + 'name' => 'Ім\'я', + 'email' => 'Email', + 'message' => 'Повідомленя', + 'Form sends success' => 'Форма успішно відправлена ', + 'Wrong email' => 'Поле Email не валідне ', ]; \ No newline at end of file diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index a41bbd0..6aaace0 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -32,6 +32,7 @@ 'js/owl.carousel.min.js', 'js/script.js', 'js/modal.js', + 'js/jquery.mask.min.js', ]; public $depends = [ 'yii\web\YiiAsset', diff --git a/frontend/config/main.php b/frontend/config/main.php index 8a7ef8a..64a80b5 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -8,7 +8,6 @@ require( __DIR__ . '/params.php' ), require( __DIR__ . '/params-local.php' ) ); - return [ 'id' => 'app-frontend', 'homeUrl' => '/', @@ -20,6 +19,64 @@ 'artbox\core\services\Languages' =>'artbox\core\services\Languages', ] ], + + 'components' => [ + 'request' => [ + 'csrfParam' => '_csrf-frontend', + 'baseUrl' => '', + ], + + 'user' => [ + 'identityClass' => 'common\models\User', + 'enableAutoLogin' => true, + 'identityCookie' => [ + 'name' => '_identity-frontend', + 'httpOnly' => true, + ], + ], + 'session' => [ + // this is the name of the session cookie used for login on the frontend + 'name' => 'advanced-frontend', + ], + 'log' => [ + 'traceLevel' => YII_DEBUG ? 3 : 0, + 'targets' => [ + [ + 'class' => 'yii\log\FileTarget', + 'levels' => [ + 'error', + 'warning', + ], + ], + ], + ], + 'seo' => [ + 'class' => SeoComponent::className(), + ], + 'errorHandler' => [ + 'errorAction' => 'site/error', + ], + 'i18n' => [ + 'translations' => [ + 'core' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@common/messages', + ], + 'app' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@common/messages', + ], + ], + ], + 'urlManager' => [ + 'class' => UrlManager::className(), + 'baseUrl' => '/', + 'enablePrettyUrl' => true, + 'showScriptName' => false, + 'rules' => [ ], + 'hideDefaultLanguagePrefix' => true, + ], + ], 'modules' => [ 'feedback' => [ 'class' => 'artbox\core\forms\Module', @@ -77,7 +134,7 @@ 'name', 'email', 'phone', - 'message', + 'message', ], 'rules' => [ [ @@ -102,7 +159,7 @@ 'inputOptions' => [ 'name' => [ - 'template' => '
- = \Yii::$app->formatter->asDate($model->created_at); ?> + + = \Yii::$app->formatter->asDate($model->created_at, 'short'); ?>
diff --git a/frontend/views/event/_event.php b/frontend/views/event/_event.php index ca125a6..5448f8b 100755 --- a/frontend/views/event/_event.php +++ b/frontend/views/event/_event.php @@ -59,8 +59,8 @@ } } ?>- - = \Yii::$app->formatter->asDate($model->created_at); ?> + + = \Yii::$app->formatter->asDate($model->created_at, 'short'); ?>
diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index a077bd1..9f81a72 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -388,11 +388,11 @@ _________________________________________________________ -->Thank for your reply, we will call you, maybe.
+ += \Yii::t('app', 'Form sends success') ?>
diff --git a/frontend/views/site/contact.php b/frontend/views/site/contact.php index 0059424..e5e39eb 100755 --- a/frontend/views/site/contact.php +++ b/frontend/views/site/contact.php @@ -6,7 +6,7 @@ * @var \artbox\core\forms\Module $module; */ - use artbox\core\models\Feedback; + use frontend\models\Feedback; use common\models\Settings; use frontend\assets\MapAsset; use yii\helpers\Html; diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index 3ffee43..904105c 100755 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -1,6 +1,6 @@ $( function() { - + phoneMask('input[name="Feedback[phone]"]'); // /** // * Modal form submit code // */ @@ -103,5 +103,37 @@ $( } ); } + + function phoneMask(maskCssSelector) { + var phoneInput = maskCssSelector; + + if ($('body') + .find(phoneInput).length > 0) { + $(phoneInput) + .mask('+38(000)000-00-00', {placeholder: '+38(000)000-00-00'}); + $(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('') + } + } + ); + } + } } ); \ No newline at end of file -- libgit2 0.21.4