diff --git a/backend/views/settings/_contact_tab.php b/backend/views/settings/_contact_tab.php
index e4916b7..502380a 100755
--- a/backend/views/settings/_contact_tab.php
+++ b/backend/views/settings/_contact_tab.php
@@ -19,6 +19,7 @@ echo '
';
echo $form->field($model, 'phone2')
->textInput()
->hint(\Yii::t('core', 'Contact phone for website'));
+ echo "
Введите несколько телефонов, разделенных ;
";
echo '
';
echo '';
echo $form->field($model, 'email')
diff --git a/frontend/components/UrlManager.php b/frontend/components/UrlManager.php
index dd798d5..26faa46 100644
--- a/frontend/components/UrlManager.php
+++ b/frontend/components/UrlManager.php
@@ -65,6 +65,22 @@
/**
* @var Alias $alias
*/
+ if ($request->pathInfo === '') {
+ // Do redirect if no active alias for homepage
+ $seo = \Yii::$app->get('seo');
+ $alias = Alias::findRoute([ 'site/index' ], $this->languages->getCurrent());
+ if ($alias) {
+ $seo->setAlias($alias);
+
+ $params = Json::decode($alias->route);
+
+ $route = array_shift($params);
+ return [
+ $route,
+ $params,
+ ];
+ }
+ }
$alias = Alias::find()
->where(
[
diff --git a/frontend/config/main.php b/frontend/config/main.php
index 37f78fa..35e61cf 100755
--- a/frontend/config/main.php
+++ b/frontend/config/main.php
@@ -1,5 +1,4 @@
'callback',
'successCallback' => 'function (data) {
document.getElementById("feedback-form").reset();
- $(".close").click();
+ $("#modal_close").click();
if (data.status == "success"){
document.getElementById("feedback-form").reset();
- $(".success_").animate({opacity: 1, top: \'40\'}, 200).addClass("done_");
- setTimeout(function(){$(".success_").animate({opacity: 0, top: \'0\'}, 200,function(){
- $(this).removeClass("done_");
- })}, 4000);
+ success();
var data = $("#feedback-form").data(\'yiiActiveForm\');
data.validated = false;
}
}',
],
+ 'contact' => [
+ 'class' => 'artbox\core\forms\Module',
+ 'activeRecord' => "artbox\core\models\Feedback",
+ 'attributes' => [
+ 'name',
+ 'email',
+ 'message',
+ ],
+ 'rules' => [
+ [
+ [
+ 'name',
+ 'email',
+ ],
+ 'required',
+ ]
+ ],
+ 'labels' => [
+ 'name' => 'Name',
+ 'message' => 'You Question',
+ 'phone' => 'Email'
+ ],
+
+ 'inputOptions' => [
+ 'name' => [
+ 'template' => '
{input}
'
+ ],
+ 'email' => [
+ 'template' => '
{input}
'
+ ],
+ 'message' => [
+ 'type' => 'textarea',
+ 'options' => [],
+ 'template' => '
{input}
'
+ ],
+ ],
+ 'buttonTemplate' => '
{button}
',
+ 'buttonOptions' => [],
+ 'buttonContent' => 'Send',
+ 'sendEmail' => false,
+ 'ajax' => true,
+ 'formId' => 'contact-form',
+ 'scenario' => 'feedback',
+ 'successCallback' => 'function (data) {
+ document.getElementById("contact-form").reset();
+ if (data.status == "success"){
+ document.getElementById("contact-form").reset();
+ success();
+ var data = $("#contact-form").data(\'yiiActiveForm\');
+ data.validated = false;
+ }
+ }',
+ ],
'comments' => [
'class' => 'artbox\core\forms\Module',
'activeRecord' => "common\models\Comment",
@@ -305,9 +354,6 @@
],
],
],
- 'seo' => [
- 'class' => SeoComponent::className(),
- ],
'errorHandler' => [
'errorAction' => 'site/error',
],
diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php
index 5c07822..022dedd 100755
--- a/frontend/controllers/SiteController.php
+++ b/frontend/controllers/SiteController.php
@@ -94,10 +94,12 @@
public function actionContact()
{
$contact = new Feedback();
+ $settings = Settings::getInstance();
return $this->render(
'contact',
[
'contact' => $contact,
+ 'settings' => $settings
]
);
}
diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php
index b30b5ad..9976587 100755
--- a/frontend/views/layouts/main.php
+++ b/frontend/views/layouts/main.php
@@ -24,6 +24,7 @@
use frontend\widgets\LanguageWidget;
use frontend\widgets\Nav;
use yii\db\ActiveQuery;
+ use yii\helpers\Html;
use yii\web\View;
AppAsset::register($this);
@@ -58,31 +59,42 @@
'content' => $seo->desc,
]
);
+
+
+ $this->registerMetaTag(
+ [
+ 'name' => 'robots',
+ 'content' => $seo->robots,
+ // 'content' => 'noindex,nofollow',
+ ]
+ );
$module = \Yii::$app->getModule('feedback');
?>
beginPage() ?>
-
-
+
+
-
=$seo->title?>
-
+
+
+ = Html::csrfMetaTags() ?>
+
=Html::encode($seo->title)?>
head() ?>
beginBody() ?>
-
-
-
-
-
-
-
-
-
-
+