Commit 6748c345ccb5a51ce09a6c064148024143ce44d5

Authored by Alexey Boroda
1 parent 6fab04aa

-Forms almost ready

frontend/assets/AppAsset.php
@@ -15,11 +15,11 @@ @@ -15,11 +15,11 @@
15 'css/site.css', 15 'css/site.css',
16 'css/animate.css', 16 'css/animate.css',
17 'css/style.css', 17 'css/style.css',
18 - 'css/custom.css',  
19 'css/style.default.css', 18 'css/style.default.css',
20 'css/owl.carousel.css', 19 'css/owl.carousel.css',
21 'css/owl.theme.css', 20 'css/owl.theme.css',
22 '//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,700,800', 21 '//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,700,800',
  22 + 'css/custom.css',
23 ]; 23 ];
24 public $js = [ 24 public $js = [
25 'js/jquery.cookie.js', 25 'js/jquery.cookie.js',
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 'js/jquery.parallax-1.1.3.js', 28 'js/jquery.parallax-1.1.3.js',
29 'js/front.js', 29 'js/front.js',
30 'js/owl.carousel.min.js', 30 'js/owl.carousel.min.js',
  31 + 'js/script.js',
31 ]; 32 ];
32 public $depends = [ 33 public $depends = [
33 'yii\web\YiiAsset', 34 'yii\web\YiiAsset',
frontend/assets/MapAsset.php 0 → 100644
  1 +<?php
  2 +
  3 + namespace frontend\assets;
  4 +
  5 + use yii\web\AssetBundle;
  6 +
  7 + /**
  8 + * Class MapAsset
  9 + *
  10 + * @package frontend\assets
  11 + */
  12 + class MapAsset extends AssetBundle
  13 + {
  14 + public $basePath = '@webroot';
  15 + public $baseUrl = '@web';
  16 + public $css = [];
  17 + public $js = [
  18 + 'https://maps.googleapis.com/maps/api/js?v=3.exp&amp;sensor=false',
  19 + 'js/gmaps.js',
  20 + 'js/gmaps.init.js',
  21 + ];
  22 + public $depends = [
  23 + 'frontend\assets\AppAsset',
  24 + ];
  25 + }
0 \ No newline at end of file 26 \ No newline at end of file
frontend/controllers/SiteController.php
1 <?php 1 <?php
2 namespace frontend\controllers; 2 namespace frontend\controllers;
3 3
  4 +use artbox\core\models\Feedback;
4 use common\models\Settings; 5 use common\models\Settings;
5 use Yii; 6 use Yii;
6 use yii\base\InvalidParamException; 7 use yii\base\InvalidParamException;
7 use yii\web\BadRequestHttpException; 8 use yii\web\BadRequestHttpException;
8 use yii\web\Controller; 9 use yii\web\Controller;
9 use yii\filters\VerbFilter; 10 use yii\filters\VerbFilter;
10 -use yii\filters\AccessControl;  
11 use common\models\LoginForm; 11 use common\models\LoginForm;
12 use frontend\models\PasswordResetRequestForm; 12 use frontend\models\PasswordResetRequestForm;
13 use frontend\models\ResetPasswordForm; 13 use frontend\models\ResetPasswordForm;
14 use frontend\models\SignupForm; 14 use frontend\models\SignupForm;
15 -use frontend\models\ContactForm; 15 +use yii\web\Response;
16 16
17 /** 17 /**
18 * Site controller 18 * Site controller
@@ -30,7 +30,22 @@ class SiteController extends Controller @@ -30,7 +30,22 @@ class SiteController extends Controller
30 ], 30 ],
31 ]; 31 ];
32 } 32 }
33 - 33 +
  34 + /**
  35 + * @inheritdoc
  36 + */
  37 + public function behaviors()
  38 + {
  39 + return [
  40 + 'verbs' => [
  41 + 'class' => VerbFilter::className(),
  42 + 'actions' => [
  43 + 'feedback' => [ 'post' ],
  44 + ],
  45 + ],
  46 + ];
  47 + }
  48 +
34 /** 49 /**
35 * Displays homepage. 50 * Displays homepage.
36 * 51 *
@@ -40,7 +55,7 @@ class SiteController extends Controller @@ -40,7 +55,7 @@ class SiteController extends Controller
40 { 55 {
41 return $this->render('index'); 56 return $this->render('index');
42 } 57 }
43 - 58 +
44 /** 59 /**
45 * Logs in a user. 60 * Logs in a user.
46 * 61 *
@@ -51,7 +66,7 @@ class SiteController extends Controller @@ -51,7 +66,7 @@ class SiteController extends Controller
51 if (!Yii::$app->user->isGuest) { 66 if (!Yii::$app->user->isGuest) {
52 return $this->goHome(); 67 return $this->goHome();
53 } 68 }
54 - 69 +
55 $model = new LoginForm(); 70 $model = new LoginForm();
56 if ($model->load(Yii::$app->request->post()) && $model->login()) { 71 if ($model->load(Yii::$app->request->post()) && $model->login()) {
57 return $this->goBack(); 72 return $this->goBack();
@@ -61,7 +76,7 @@ class SiteController extends Controller @@ -61,7 +76,7 @@ class SiteController extends Controller
61 ]); 76 ]);
62 } 77 }
63 } 78 }
64 - 79 +
65 /** 80 /**
66 * Logs out the current user. 81 * Logs out the current user.
67 * 82 *
@@ -70,10 +85,10 @@ class SiteController extends Controller @@ -70,10 +85,10 @@ class SiteController extends Controller
70 public function actionLogout() 85 public function actionLogout()
71 { 86 {
72 Yii::$app->user->logout(); 87 Yii::$app->user->logout();
73 - 88 +
74 return $this->goHome(); 89 return $this->goHome();
75 } 90 }
76 - 91 +
77 /** 92 /**
78 * Displays contact page. 93 * Displays contact page.
79 * 94 *
@@ -81,22 +96,15 @@ class SiteController extends Controller @@ -81,22 +96,15 @@ class SiteController extends Controller
81 */ 96 */
82 public function actionContact() 97 public function actionContact()
83 { 98 {
84 - $model = new ContactForm();  
85 - if ($model->load(Yii::$app->request->post()) && $model->validate()) {  
86 - if ($model->sendEmail(Yii::$app->params['adminEmail'])) {  
87 - Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.');  
88 - } else {  
89 - Yii::$app->session->setFlash('error', 'There was an error sending your message.');  
90 - }  
91 -  
92 - return $this->refresh();  
93 - } else {  
94 - return $this->render('contact', [  
95 - 'model' => $model,  
96 - ]);  
97 - } 99 + $contact = new Feedback();
  100 + return $this->render(
  101 + 'contact',
  102 + [
  103 + 'contact' => $contact,
  104 + ]
  105 + );
98 } 106 }
99 - 107 +
100 /** 108 /**
101 * Displays about page. 109 * Displays about page.
102 * 110 *
@@ -106,7 +114,7 @@ class SiteController extends Controller @@ -106,7 +114,7 @@ class SiteController extends Controller
106 { 114 {
107 return $this->render('about'); 115 return $this->render('about');
108 } 116 }
109 - 117 +
110 /** 118 /**
111 * Signs user up. 119 * Signs user up.
112 * 120 *
@@ -122,12 +130,12 @@ class SiteController extends Controller @@ -122,12 +130,12 @@ class SiteController extends Controller
122 } 130 }
123 } 131 }
124 } 132 }
125 - 133 +
126 return $this->render('signup', [ 134 return $this->render('signup', [
127 'model' => $model, 135 'model' => $model,
128 ]); 136 ]);
129 } 137 }
130 - 138 +
131 /** 139 /**
132 * Requests password reset. 140 * Requests password reset.
133 * 141 *
@@ -139,18 +147,18 @@ class SiteController extends Controller @@ -139,18 +147,18 @@ class SiteController extends Controller
139 if ($model->load(Yii::$app->request->post()) && $model->validate()) { 147 if ($model->load(Yii::$app->request->post()) && $model->validate()) {
140 if ($model->sendEmail()) { 148 if ($model->sendEmail()) {
141 Yii::$app->session->setFlash('success', 'Check your email for further instructions.'); 149 Yii::$app->session->setFlash('success', 'Check your email for further instructions.');
142 - 150 +
143 return $this->goHome(); 151 return $this->goHome();
144 } else { 152 } else {
145 Yii::$app->session->setFlash('error', 'Sorry, we are unable to reset password for the provided email address.'); 153 Yii::$app->session->setFlash('error', 'Sorry, we are unable to reset password for the provided email address.');
146 } 154 }
147 } 155 }
148 - 156 +
149 return $this->render('requestPasswordResetToken', [ 157 return $this->render('requestPasswordResetToken', [
150 'model' => $model, 158 'model' => $model,
151 ]); 159 ]);
152 } 160 }
153 - 161 +
154 /** 162 /**
155 * Resets password. 163 * Resets password.
156 * 164 *
@@ -165,18 +173,23 @@ class SiteController extends Controller @@ -165,18 +173,23 @@ class SiteController extends Controller
165 } catch (InvalidParamException $e) { 173 } catch (InvalidParamException $e) {
166 throw new BadRequestHttpException($e->getMessage()); 174 throw new BadRequestHttpException($e->getMessage());
167 } 175 }
168 - 176 +
169 if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) { 177 if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) {
170 Yii::$app->session->setFlash('success', 'New password saved.'); 178 Yii::$app->session->setFlash('success', 'New password saved.');
171 - 179 +
172 return $this->goHome(); 180 return $this->goHome();
173 } 181 }
174 - 182 +
175 return $this->render('resetPassword', [ 183 return $this->render('resetPassword', [
176 'model' => $model, 184 'model' => $model,
177 ]); 185 ]);
178 } 186 }
179 187
  188 + /**
  189 + * Action to view robots.txt file dinamycli
  190 + *
  191 + * @return string
  192 + */
180 public function actionRobots() 193 public function actionRobots()
181 { 194 {
182 $response = \Yii::$app->response; 195 $response = \Yii::$app->response;
@@ -192,4 +205,25 @@ class SiteController extends Controller @@ -192,4 +205,25 @@ class SiteController extends Controller
192 $response->headers->set('Content-Type', 'text/plain'); 205 $response->headers->set('Content-Type', 'text/plain');
193 return $this->renderFile($meta[ 'uri' ]); 206 return $this->renderFile($meta[ 'uri' ]);
194 } 207 }
  208 +
  209 + public function actionFeedback()
  210 + {
  211 + Yii::$app->response->format = Response::FORMAT_JSON;
  212 + if (empty(Yii::$app->request->post())) {
  213 + throw new BadRequestHttpException();
  214 + } else {
  215 + $model = new Feedback();
  216 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  217 + return [
  218 + 'success' => true,
  219 + 'message' => 'Success message',
  220 + ];
  221 + } else {
  222 + return [
  223 + 'success' => false,
  224 + 'error' => $model->errors,
  225 + ];
  226 + }
  227 + }
  228 + }
195 } 229 }
frontend/views/layouts/main.php
@@ -7,15 +7,19 @@ @@ -7,15 +7,19 @@
7 */ 7 */
8 8
9 use artbox\core\components\SeoComponent; 9 use artbox\core\components\SeoComponent;
  10 + use artbox\core\models\Feedback;
10 use artbox\core\models\User; 11 use artbox\core\models\User;
11 use frontend\assets\AppAsset; 12 use frontend\assets\AppAsset;
  13 + use yii\bootstrap\ActiveForm;
12 use yii\bootstrap\Nav; 14 use yii\bootstrap\Nav;
13 use yii\helpers\Html; 15 use yii\helpers\Html;
14 use yii\web\View; 16 use yii\web\View;
  17 + use yii\widgets\Breadcrumbs;
15 18
16 AppAsset::register($this); 19 AppAsset::register($this);
17 $user = \Yii::$app->user->identity; 20 $user = \Yii::$app->user->identity;
18 $seo = Yii::$app->get('seo'); 21 $seo = Yii::$app->get('seo');
  22 + $feedback = new Feedback();
19 ?> 23 ?>
20 24
21 <?php $this->beginPage() ?> 25 <?php $this->beginPage() ?>
@@ -61,16 +65,16 @@ _________________________________________________________ --&gt; @@ -61,16 +65,16 @@ _________________________________________________________ --&gt;
61 </div> 65 </div>
62 </div> 66 </div>
63 <!-- *** TOP END *** --> 67 <!-- *** TOP END *** -->
64 - 68 +
65 <!-- *** NAVBAR *** 69 <!-- *** NAVBAR ***
66 _________________________________________________________ --> 70 _________________________________________________________ -->
67 <div class="navbar-affixed-top" data-spy="affix" data-offset-top="200"> 71 <div class="navbar-affixed-top" data-spy="affix" data-offset-top="200">
68 - 72 +
69 <div class="navbar navbar-default yamm" role="navigation" id="navbar"> 73 <div class="navbar navbar-default yamm" role="navigation" id="navbar">
70 - 74 +
71 <div class="container"> 75 <div class="container">
72 <div class="navbar-header"> 76 <div class="navbar-header">
73 - 77 +
74 <a class="navbar-brand home" href="index.html"> 78 <a class="navbar-brand home" href="index.html">
75 <img src="/img/logo.png" alt="Universal logo" class="hidden-xs hidden-sm"> 79 <img src="/img/logo.png" alt="Universal logo" class="hidden-xs hidden-sm">
76 <img src="/img/logo-small.png" alt="Universal logo" class="visible-xs visible-sm"><span class="sr-only">Universal - go to homepage</span> 80 <img src="/img/logo-small.png" alt="Universal logo" class="visible-xs visible-sm"><span class="sr-only">Universal - go to homepage</span>
@@ -82,7 +86,7 @@ _________________________________________________________ --&gt; @@ -82,7 +86,7 @@ _________________________________________________________ --&gt;
82 </button> 86 </button>
83 </div> 87 </div>
84 </div> 88 </div>
85 - 89 +
86 <div class="navbar-collapse collapse" id="navigation"> 90 <div class="navbar-collapse collapse" id="navigation">
87 <?php 91 <?php
88 echo Nav::widget( 92 echo Nav::widget(
@@ -93,8 +97,8 @@ _________________________________________________________ --&gt; @@ -93,8 +97,8 @@ _________________________________________________________ --&gt;
93 'url' => [ 'site/index' ], 97 'url' => [ 'site/index' ],
94 ], 98 ],
95 [ 99 [
96 - 'label' => 'Dropdown',  
97 - 'url' => [ '#' ], 100 + 'label' => 'Contatcs',
  101 + 'url' => [ 'site/contact' ],
98 ], 102 ],
99 [ 103 [
100 'label' => 'Login', 104 'label' => 'Login',
@@ -108,10 +112,10 @@ _________________________________________________________ --&gt; @@ -108,10 +112,10 @@ _________________________________________________________ --&gt;
108 ); 112 );
109 ?> 113 ?>
110 </div> 114 </div>
111 -  
112 - 115 +
  116 +
113 <div class="collapse clearfix" id="search"> 117 <div class="collapse clearfix" id="search">
114 - 118 +
115 <form class="navbar-form" role="search"> 119 <form class="navbar-form" role="search">
116 <div class="input-group"> 120 <div class="input-group">
117 <input type="text" class="form-control" placeholder="Search"> 121 <input type="text" class="form-control" placeholder="Search">
@@ -122,114 +126,175 @@ _________________________________________________________ --&gt; @@ -122,114 +126,175 @@ _________________________________________________________ --&gt;
122 </span> 126 </span>
123 </div> 127 </div>
124 </form> 128 </form>
125 - 129 +
126 </div> 130 </div>
127 <!--/.nav-collapse --> 131 <!--/.nav-collapse -->
128 - 132 +
129 </div> 133 </div>
130 -  
131 - 134 +
  135 +
132 </div> 136 </div>
133 <!-- /#navbar --> 137 <!-- /#navbar -->
134 - 138 +
135 </div> 139 </div>
136 - 140 +
137 <!-- *** NAVBAR END *** --> 141 <!-- *** NAVBAR END *** -->
138 - 142 +
139 </header> 143 </header>
140 -  
141 - <!-- *** LOGIN MODAL *** 144 +
  145 + <!-- *** FeedBack MODAL ***
142 _________________________________________________________ --> 146 _________________________________________________________ -->
143 -  
144 - <div class="modal fade" id="login-modal" tabindex="-1" role="dialog" aria-labelledby="Login" aria-hidden="true">  
145 - <div class="modal-dialog modal-sm">  
146 - 147 +
  148 + <div class="modal fade" id="feedback-modal" tabindex="-1" role="dialog" aria-labelledby="Login" aria-hidden="true">
  149 + <div class="modal-dialog">
  150 +
147 <div class="modal-content"> 151 <div class="modal-content">
148 <div class="modal-header"> 152 <div class="modal-header">
149 - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>  
150 - <h4 class="modal-title" id="Login">Customer login</h4> 153 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times</button>
  154 + <h3 class="modal-title" id="Login">Feedback</h3>
151 </div> 155 </div>
152 <div class="modal-body"> 156 <div class="modal-body">
153 - <form action="customer-orders.html" method="post">  
154 - <div class="form-group">  
155 - <input type="text" class="form-control" id="email_modal" placeholder="email">  
156 - </div>  
157 - <div class="form-group">  
158 - <input type="password" class="form-control" id="password_modal" placeholder="password">  
159 - </div>  
160 -  
161 - <p class="text-center">  
162 - <button class="btn btn-template-main"><i class="fa fa-sign-in"></i> Log in</button>  
163 - </p>  
164 -  
165 - </form>  
166 -  
167 - <p class="text-center text-muted">Not registered yet?</p>  
168 - <p class="text-center text-muted">  
169 - <a href="customer-register.html"><strong>Register now</strong></a>! It is easy and done in 1&nbsp;minute and gives you access to special discounts and much more! 157 +
  158 + <?php $form = ActiveForm::begin(
  159 + [
  160 + 'id' => 'feedback-form',
  161 + 'method' => 'POST',
  162 + 'action' => '/site/feedback',
  163 + ]
  164 + ); ?>
  165 +
  166 + <?= $form->field($feedback, 'name')
  167 + ->textInput(); ?>
  168 +
  169 + <?= $form->field($feedback, 'email')
  170 + ->textInput(); ?>
  171 +
  172 + <?= $form->field($feedback, 'phone')
  173 + ->textInput(); ?>
  174 +
  175 + <?= $form->field($feedback, 'message')
  176 + ->textarea(
  177 + [
  178 + 'rows' => 4,
  179 + ]
  180 + ); ?>
  181 +
  182 + <p class="text-center">
  183 + <?= Html::submitButton(
  184 + 'Send',
  185 + [
  186 + 'class' => 'send-form btn btn-lg btn-template-primary',
  187 + ]
  188 + ) ?>
170 </p> 189 </p>
171 - 190 +
  191 + <?php ActiveForm::end(); ?>
  192 +
172 </div> 193 </div>
173 </div> 194 </div>
174 </div> 195 </div>
175 </div> 196 </div>
176 -  
177 - <!-- *** LOGIN MODAL END *** --> 197 +
  198 + <!-- *** FeedBack MODAL END *** -->
  199 +
  200 + <!-- *** FeedBack MODAL ***
  201 +_________________________________________________________ -->
  202 +
  203 + <div class="modal fade" id="success-modal" tabindex="-1" role="dialog" aria-labelledby="Success" aria-hidden="true">
  204 + <div class="modal-dialog">
178 205
  206 + <div class="modal-content">
  207 + <div class="modal-header">
  208 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times</button>
  209 + <h3 class="modal-title" id="Success">Success</h3>
  210 + </div>
  211 + <div class="modal-body">
  212 +
  213 + <p>Thank for your reply, we will call you, maybe.</p>
  214 + <p class="text-center">
  215 + <button type="button" class="btn btn-template-primary" data-dismiss="modal">Close</button>
  216 + </p>
  217 + </div>
  218 + </div>
  219 + </div>
  220 + </div>
  221 +
  222 + <!-- *** FeedBack MODAL END *** -->
  223 +
  224 + <!-- *** Breadcrumbs *** -->
  225 + <div id="heading-breadcrumbs">
  226 + <div class="container">
  227 + <div class="row">
  228 + <div class="col-md-7">
  229 + <h1><?= $seo->h1 ?></h1>
  230 + </div>
  231 + <div class="col-md-5">
  232 + <?= Breadcrumbs::widget(
  233 + [
  234 + 'links' => isset($this->params[ 'breadcrumbs' ]) ? $this->params[ 'breadcrumbs' ] : [],
  235 + ]
  236 + ) ?>
  237 +
  238 + </div>
  239 + </div>
  240 + </div>
  241 + </div>
  242 + <!-- *** Breadcrumbs END *** -->
  243 +
179 <?= $content ?> 244 <?= $content ?>
180 -  
181 - 245 +
  246 +
182 <!-- *** GET IT *** 247 <!-- *** GET IT ***
183 _________________________________________________________ --> 248 _________________________________________________________ -->
184 - 249 +
185 <div id="get-it"> 250 <div id="get-it">
186 <div class="container"> 251 <div class="container">
187 <div class="col-md-8 col-sm-12"> 252 <div class="col-md-8 col-sm-12">
188 <h3>Do you want cool website like this one?</h3> 253 <h3>Do you want cool website like this one?</h3>
189 </div> 254 </div>
190 <div class="col-md-4 col-sm-12"> 255 <div class="col-md-4 col-sm-12">
191 - <a href="#" class="btn btn-template-transparent-primary">Buy this template now</a> 256 + <a href="#" class="btn btn-template-transparent-primary" data-toggle="modal" data-target="#feedback-modal">Contact us!</a>
192 </div> 257 </div>
193 </div> 258 </div>
194 </div> 259 </div>
195 -  
196 - 260 +
  261 +
197 <!-- *** GET IT END *** --> 262 <!-- *** GET IT END *** -->
198 - 263 +
199 <!-- *** FOOTER *** 264 <!-- *** FOOTER ***
200 _________________________________________________________ --> 265 _________________________________________________________ -->
201 - 266 +
202 <footer id="footer"> 267 <footer id="footer">
203 <div class="container"> 268 <div class="container">
204 <div class="col-md-6 col-sm-12"> 269 <div class="col-md-6 col-sm-12">
205 <h4>About us</h4> 270 <h4>About us</h4>
206 - 271 +
207 <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> 272 <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>
208 - 273 +
209 <hr> 274 <hr>
210 - 275 +
211 <h4>Join our monthly newsletter</h4> 276 <h4>Join our monthly newsletter</h4>
212 - 277 +
213 <form> 278 <form>
214 <div class="input-group"> 279 <div class="input-group">
215 - 280 +
216 <input type="text" class="form-control"> 281 <input type="text" class="form-control">
217 - 282 +
218 <span class="input-group-btn"> 283 <span class="input-group-btn">
219 284
220 <button class="btn btn-default" type="button"><i class="fa fa-send"></i></button> 285 <button class="btn btn-default" type="button"><i class="fa fa-send"></i></button>
221 286
222 </span> 287 </span>
223 - 288 +
224 </div> 289 </div>
225 <!-- /input-group --> 290 <!-- /input-group -->
226 </form> 291 </form>
227 - 292 +
228 <hr class="hidden-md hidden-lg hidden-sm"> 293 <hr class="hidden-md hidden-lg hidden-sm">
229 - 294 +
230 </div> 295 </div>
231 <!-- /.col-md-3 --> 296 <!-- /.col-md-3 -->
232 - 297 +
233 <!-- <div class="col-md-3 col-sm-6">--> 298 <!-- <div class="col-md-3 col-sm-6">-->
234 <!-- --> 299 <!-- -->
235 <!-- <h4>Blog</h4>--> 300 <!-- <h4>Blog</h4>-->
@@ -273,11 +338,11 @@ _________________________________________________________ --&gt; @@ -273,11 +338,11 @@ _________________________________________________________ --&gt;
273 <!-- --> 338 <!-- -->
274 <!-- </div>--> 339 <!-- </div>-->
275 <!-- /.col-md-3 --> 340 <!-- /.col-md-3 -->
276 - 341 +
277 <div class="col-md-4 col-sm-12 col-md-offset-2"> 342 <div class="col-md-4 col-sm-12 col-md-offset-2">
278 - 343 +
279 <h4>Contact</h4> 344 <h4>Contact</h4>
280 - 345 +
281 <p><strong>Universal Ltd.</strong> 346 <p><strong>Universal Ltd.</strong>
282 <br>13/25 New Avenue 347 <br>13/25 New Avenue
283 <br>Newtown upon River 348 <br>Newtown upon River
@@ -286,15 +351,15 @@ _________________________________________________________ --&gt; @@ -286,15 +351,15 @@ _________________________________________________________ --&gt;
286 <br> 351 <br>
287 <strong>Great Britain</strong> 352 <strong>Great Britain</strong>
288 </p> 353 </p>
289 - 354 +
290 <a href="contact.html" class="btn btn-small btn-template-main">Go to contact page</a> 355 <a href="contact.html" class="btn btn-small btn-template-main">Go to contact page</a>
291 - 356 +
292 <hr class="hidden-md hidden-lg hidden-sm"> 357 <hr class="hidden-md hidden-lg hidden-sm">
293 - 358 +
294 </div> 359 </div>
295 <!-- /.col-md-3 --> 360 <!-- /.col-md-3 -->
296 -  
297 - 361 +
  362 +
298 <!-- <div class="col-md-3 col-sm-6">--> 363 <!-- <div class="col-md-3 col-sm-6">-->
299 <!-- --> 364 <!-- -->
300 <!-- <h4>Photostream</h4>--> 365 <!-- <h4>Photostream</h4>-->
@@ -338,12 +403,12 @@ _________________________________________________________ --&gt; @@ -338,12 +403,12 @@ _________________________________________________________ --&gt;
338 <!-- /.container --> 403 <!-- /.container -->
339 </footer> 404 </footer>
340 <!-- /#footer --> 405 <!-- /#footer -->
341 - 406 +
342 <!-- *** FOOTER END *** --> 407 <!-- *** FOOTER END *** -->
343 - 408 +
344 <!-- *** COPYRIGHT *** 409 <!-- *** COPYRIGHT ***
345 _________________________________________________________ --> 410 _________________________________________________________ -->
346 - 411 +
347 <div id="copyright"> 412 <div id="copyright">
348 <div class="container"> 413 <div class="container">
349 <div class="col-md-12"> 414 <div class="col-md-12">
@@ -352,15 +417,15 @@ _________________________________________________________ --&gt; @@ -352,15 +417,15 @@ _________________________________________________________ --&gt;
352 <a href="https://remoteplease.com">Remote Please</a> 417 <a href="https://remoteplease.com">Remote Please</a>
353 <!-- Not removing these links is part of the license conditions of the template. Thanks for understanding :) If you want to use the template without the attribution links, you can do so after supporting further themes development at https://bootstrapious.com/donate --> 418 <!-- Not removing these links is part of the license conditions of the template. Thanks for understanding :) If you want to use the template without the attribution links, you can do so after supporting further themes development at https://bootstrapious.com/donate -->
354 </p> 419 </p>
355 - 420 +
356 </div> 421 </div>
357 </div> 422 </div>
358 </div> 423 </div>
359 <!-- /#copyright --> 424 <!-- /#copyright -->
360 -  
361 - <!-- *** COPYRIGHT END *** -->  
362 -  
363 425
  426 + <!-- *** COPYRIGHT END *** -->
  427 +
  428 +
364 </div> 429 </div>
365 <!-- /#all --> 430 <!-- /#all -->
366 <?php $this->endBody() ?> 431 <?php $this->endBody() ?>
frontend/views/page/view.php
@@ -14,24 +14,6 @@ @@ -14,24 +14,6 @@
14 $seo = \Yii::$app->get('seo'); 14 $seo = \Yii::$app->get('seo');
15 ?> 15 ?>
16 16
17 -<div id="heading-breadcrumbs">  
18 - <div class="container">  
19 - <div class="row">  
20 - <div class="col-md-7">  
21 - <h1><?= $seo->h1 ?></h1>  
22 - </div>  
23 - <div class="col-md-5">  
24 - <ul class="breadcrumb">  
25 - <li><a href="index.html">Home</a>  
26 - </li>  
27 - <li>Text page</li>  
28 - </ul>  
29 -  
30 - </div>  
31 - </div>  
32 - </div>  
33 -</div>  
34 -  
35 <div id="content"> 17 <div id="content">
36 <div class="container"> 18 <div class="container">
37 19
frontend/views/site/contact.php
1 <?php 1 <?php
2 -  
3 -/* @var $this yii\web\View */  
4 -/* @var $form yii\bootstrap\ActiveForm */  
5 -/* @var $model \frontend\models\ContactForm */  
6 -  
7 -use yii\helpers\Html;  
8 -use yii\bootstrap\ActiveForm;  
9 -use yii\captcha\Captcha;  
10 -  
11 -$this->title = 'Contact';  
12 -$this->params['breadcrumbs'][] = $this->title; 2 +
  3 + /**
  4 + * @var View $this
  5 + * @var Feedback $contact
  6 + */
  7 +
  8 + use artbox\core\models\Feedback;
  9 + use frontend\assets\MapAsset;
  10 + use yii\helpers\Html;
  11 + use yii\bootstrap\ActiveForm;
  12 + use yii\web\View;
  13 +
  14 + MapAsset::register($this);
  15 +
  16 + $this->title = 'Contact';
  17 + $this->params[ 'breadcrumbs' ][] = $this->title;
13 ?> 18 ?>
14 -<div class="site-contact">  
15 - <h1><?= Html::encode($this->title) ?></h1>  
16 -  
17 - <p>  
18 - If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.  
19 - </p>  
20 -  
21 - <div class="row">  
22 - <div class="col-lg-5">  
23 - <?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>  
24 -  
25 - <?= $form->field($model, 'name')->textInput(['autofocus' => true]) ?>  
26 -  
27 - <?= $form->field($model, 'email') ?>  
28 -  
29 - <?= $form->field($model, 'subject') ?>  
30 -  
31 - <?= $form->field($model, 'body')->textarea(['rows' => 6]) ?>  
32 -  
33 - <?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [  
34 - 'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',  
35 - ]) ?>  
36 -  
37 - <div class="form-group">  
38 - <?= Html::submitButton('Submit', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>  
39 - </div>  
40 19
  20 +<div id="content">
  21 + <div class="container" id="contact">
  22 +
  23 + <section>
  24 +
  25 + <div class="row">
  26 + <div class="col-md-12">
  27 + <section>
  28 + <div class="heading">
  29 + <h2>We are here to help you</h2>
  30 + </div>
  31 +
  32 + <p class="lead">Are you curious about something? Do you have some kind of problem with our products? As am hastily invited settled at limited civilly fortune me. Really spring in extent an by. Judge but built gay party world. Of so am
  33 + he remember although required. Bachelor unpacked be advanced at. Confined in declared marianne is vicinity.</p>
  34 + <p>Please feel free to contact us, our customer service center is working for you 24/7.</p>
  35 + </section>
  36 + </div>
  37 + </div>
  38 +
  39 + </section>
  40 +
  41 + <section>
  42 +
  43 + <div class="row">
  44 + <div class="col-md-4">
  45 + <div class="box-simple">
  46 + <div class="icon">
  47 + <i class="fa fa-map-marker"></i>
  48 + </div>
  49 + <h3>Address</h3>
  50 + <p>13/25 New Avenue
  51 + <br>New Heaven, 45Y 73J
  52 + <br>England, <strong>Great Britain</strong>
  53 + </p>
  54 + </div>
  55 + <!-- /.box-simple -->
  56 + </div>
  57 +
  58 +
  59 + <div class="col-md-4">
  60 +
  61 + <div class="box-simple">
  62 + <div class="icon">
  63 + <i class="fa fa-phone"></i>
  64 + </div>
  65 + <h3>Call center</h3>
  66 + <p class="text-muted">This number is toll free if calling from Great Britain otherwise we advise you to use the electronic form of communication.</p>
  67 + <p><strong>+33 555 444 333</strong>
  68 + </p>
  69 + </div>
  70 + <!-- /.box-simple -->
  71 +
  72 + </div>
  73 +
  74 + <div class="col-md-4">
  75 +
  76 + <div class="box-simple">
  77 + <div class="icon">
  78 + <i class="fa fa-envelope"></i>
  79 + </div>
  80 + <h3>Electronic support</h3>
  81 + <p class="text-muted">Please feel free to write an email to us or to use our electronic ticketing system.</p>
  82 + <ul class="list-style-none">
  83 + <li><strong><a href="mailto:">info@fakeemail.com</a></strong>
  84 + </li>
  85 + <li><strong><a href="#">Ticketio</a></strong> - our ticketing support platform</li>
  86 + </ul>
  87 + </div>
  88 + <!-- /.box-simple -->
  89 + </div>
  90 + </div>
  91 +
  92 + </section>
  93 +
  94 + <section>
  95 +
  96 + <div class="row text-center">
  97 +
  98 + <div class="col-md-12">
  99 + <div class="heading">
  100 + <h2>Contact form</h2>
  101 + </div>
  102 + </div>
  103 +
  104 + <div class="col-md-8 col-md-offset-2">
  105 + <?php $form = ActiveForm::begin(
  106 + [
  107 + 'id' => 'contact-form',
  108 + 'method' => 'POST',
  109 + 'action' => '/site/feedback',
  110 + ]
  111 + ); ?>
  112 + <div class="row">
  113 + <div class="col-sm-12">
  114 + <?= $form->field($contact, 'name')
  115 + ->textInput(); ?>
  116 + </div>
  117 +
  118 + <div class="col-sm-6">
  119 + <?= $form->field($contact, 'email')
  120 + ->textInput(); ?>
  121 + </div>
  122 + <div class="col-sm-6">
  123 + <?= $form->field($contact, 'phone')
  124 + ->textInput(); ?>
  125 + </div>
  126 + <div class="col-sm-12">
  127 + <?= $form->field($contact, 'message')
  128 + ->textarea(
  129 + [
  130 + 'rows' => 3,
  131 + ]
  132 + ); ?>
  133 + </div>
  134 +
  135 + <div class="col-sm-12 text-center">
  136 + <?= Html::submitButton(
  137 + '<i class="fa fa-envelope-o"></i> Send message',
  138 + [
  139 + 'class' => 'btn btn-template-main',
  140 + ]
  141 + ) ?>
  142 +
  143 + </div>
  144 + </div>
  145 + <!-- /.row -->
41 <?php ActiveForm::end(); ?> 146 <?php ActiveForm::end(); ?>
  147 +
  148 +
42 </div> 149 </div>
43 - </div>  
44 - 150 + </div>
  151 + <!-- /.row -->
  152 +
  153 + </section>
  154 +
  155 +
  156 + </div>
  157 + <!-- /#contact.container -->
45 </div> 158 </div>
  159 +<!-- /#content -->
  160 +
  161 +<div id="map">
  162 +
  163 +</div>
46 \ No newline at end of file 164 \ No newline at end of file
frontend/web/css/custom.css
1 -/* your styles go here */  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +/* your styles go here */
  3 +/* CSS used here will be applied after bootstrap.css */
  4 +.modal-header-success {
  5 + color: #fff;
  6 + padding: 9px 15px;
  7 + border-bottom: 1px solid #eee;
  8 + background-color: #5cb85c;
  9 + -webkit-border-top-left-radius: 5px;
  10 + -webkit-border-top-right-radius: 5px;
  11 + -moz-border-radius-topleft: 5px;
  12 + -moz-border-radius-topright: 5px;
  13 + border-top-left-radius: 5px;
  14 + border-top-right-radius: 5px;
  15 +}
  16 +
  17 +.modal-header-warning {
  18 + color: #fff;
  19 + padding: 9px 15px;
  20 + border-bottom: 1px solid #eee;
  21 + background-color: #f0ad4e;
  22 + -webkit-border-top-left-radius: 5px;
  23 + -webkit-border-top-right-radius: 5px;
  24 + -moz-border-radius-topleft: 5px;
  25 + -moz-border-radius-topright: 5px;
  26 + border-top-left-radius: 5px;
  27 + border-top-right-radius: 5px;
  28 +}
  29 +
  30 +.modal-header-danger {
  31 + color: #fff;
  32 + padding: 9px 15px;
  33 + border-bottom: 1px solid #eee;
  34 + background-color: #d9534f;
  35 + -webkit-border-top-left-radius: 5px;
  36 + -webkit-border-top-right-radius: 5px;
  37 + -moz-border-radius-topleft: 5px;
  38 + -moz-border-radius-topright: 5px;
  39 + border-top-left-radius: 5px;
  40 + border-top-right-radius: 5px;
  41 +}
  42 +
  43 +.modal-header-info {
  44 + color: #fff;
  45 + padding: 9px 15px;
  46 + border-bottom: 1px solid #eee;
  47 + background-color: #5bc0de;
  48 + -webkit-border-top-left-radius: 5px;
  49 + -webkit-border-top-right-radius: 5px;
  50 + -moz-border-radius-topleft: 5px;
  51 + -moz-border-radius-topright: 5px;
  52 + border-top-left-radius: 5px;
  53 + border-top-right-radius: 5px;
  54 +}
  55 +
  56 +.modal-header-primary {
  57 + color: #fff;
  58 + padding: 9px 15px;
  59 + border-bottom: 1px solid #eee;
  60 + background-color: #428bca;
  61 + -webkit-border-top-left-radius: 5px;
  62 + -webkit-border-top-right-radius: 5px;
  63 + -moz-border-radius-topleft: 5px;
  64 + -moz-border-radius-topright: 5px;
  65 + border-top-left-radius: 5px;
  66 + border-top-right-radius: 5px;
  67 +}
  68 +
  69 +.modal-header-theme {
  70 + color: #fff;
  71 + padding: 9px 15px;
  72 + border-bottom: 1px solid #eee;
  73 + background-color: #38a7bb;
  74 + -webkit-border-top-left-radius: 5px;
  75 + -webkit-border-top-right-radius: 5px;
  76 + -moz-border-radius-topleft: 5px;
  77 + -moz-border-radius-topright: 5px;
  78 + border-top-left-radius: 5px;
  79 + border-top-right-radius: 5px;
  80 +}
  81 +
  82 +.has-success .form-control {
  83 + border-color: #d6e9c6;
  84 +}
  85 +
  86 +.has-error .form-control {
  87 + border-color: #ebccd1;
  88 +}
3 \ No newline at end of file 89 \ No newline at end of file
frontend/web/js/script.js 0 → 100644
  1 +$(
  2 + function() {
  3 + $(document)
  4 + .on(
  5 + 'beforeSubmit', '#feedback-form', function(e) {
  6 + var f = this;
  7 + var form = $(this);
  8 + var formData = form.serialize();
  9 + $.ajax(
  10 + {
  11 + url: form.attr("action"),
  12 + type: form.attr("method"),
  13 + data: formData,
  14 + success: function(data) {
  15 + f.reset();
  16 + $('#feedback-modal')
  17 + .modal('hide');
  18 + $('#success-modal')
  19 + .modal('show');
  20 + },
  21 + error: function() {
  22 + $('#feedback-modal')
  23 + .modal('hide');
  24 + }
  25 + }
  26 + );
  27 + }
  28 + )
  29 + .on(
  30 + 'submit', '#feedback-form', function(e) {
  31 + e.preventDefault();
  32 + }
  33 + );
  34 + }
  35 +);
0 \ No newline at end of file 36 \ No newline at end of file