Commit 6748c345ccb5a51ce09a6c064148024143ce44d5
1 parent
6fab04aa
-Forms almost ready
Showing
8 changed files
with
515 additions
and
169 deletions
Show diff stats
frontend/assets/AppAsset.php
... | ... | @@ -15,11 +15,11 @@ |
15 | 15 | 'css/site.css', |
16 | 16 | 'css/animate.css', |
17 | 17 | 'css/style.css', |
18 | - 'css/custom.css', | |
19 | 18 | 'css/style.default.css', |
20 | 19 | 'css/owl.carousel.css', |
21 | 20 | 'css/owl.theme.css', |
22 | 21 | '//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,500,700,800', |
22 | + 'css/custom.css', | |
23 | 23 | ]; |
24 | 24 | public $js = [ |
25 | 25 | 'js/jquery.cookie.js', |
... | ... | @@ -28,6 +28,7 @@ |
28 | 28 | 'js/jquery.parallax-1.1.3.js', |
29 | 29 | 'js/front.js', |
30 | 30 | 'js/owl.carousel.min.js', |
31 | + 'js/script.js', | |
31 | 32 | ]; |
32 | 33 | public $depends = [ |
33 | 34 | 'yii\web\YiiAsset', | ... | ... |
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&sensor=false', | |
19 | + 'js/gmaps.js', | |
20 | + 'js/gmaps.init.js', | |
21 | + ]; | |
22 | + public $depends = [ | |
23 | + 'frontend\assets\AppAsset', | |
24 | + ]; | |
25 | + } | |
0 | 26 | \ No newline at end of file | ... | ... |
frontend/controllers/SiteController.php
1 | 1 | <?php |
2 | 2 | namespace frontend\controllers; |
3 | 3 | |
4 | +use artbox\core\models\Feedback; | |
4 | 5 | use common\models\Settings; |
5 | 6 | use Yii; |
6 | 7 | use yii\base\InvalidParamException; |
7 | 8 | use yii\web\BadRequestHttpException; |
8 | 9 | use yii\web\Controller; |
9 | 10 | use yii\filters\VerbFilter; |
10 | -use yii\filters\AccessControl; | |
11 | 11 | use common\models\LoginForm; |
12 | 12 | use frontend\models\PasswordResetRequestForm; |
13 | 13 | use frontend\models\ResetPasswordForm; |
14 | 14 | use frontend\models\SignupForm; |
15 | -use frontend\models\ContactForm; | |
15 | +use yii\web\Response; | |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Site 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 | 50 | * Displays homepage. |
36 | 51 | * |
... | ... | @@ -40,7 +55,7 @@ class SiteController extends Controller |
40 | 55 | { |
41 | 56 | return $this->render('index'); |
42 | 57 | } |
43 | - | |
58 | + | |
44 | 59 | /** |
45 | 60 | * Logs in a user. |
46 | 61 | * |
... | ... | @@ -51,7 +66,7 @@ class SiteController extends Controller |
51 | 66 | if (!Yii::$app->user->isGuest) { |
52 | 67 | return $this->goHome(); |
53 | 68 | } |
54 | - | |
69 | + | |
55 | 70 | $model = new LoginForm(); |
56 | 71 | if ($model->load(Yii::$app->request->post()) && $model->login()) { |
57 | 72 | return $this->goBack(); |
... | ... | @@ -61,7 +76,7 @@ class SiteController extends Controller |
61 | 76 | ]); |
62 | 77 | } |
63 | 78 | } |
64 | - | |
79 | + | |
65 | 80 | /** |
66 | 81 | * Logs out the current user. |
67 | 82 | * |
... | ... | @@ -70,10 +85,10 @@ class SiteController extends Controller |
70 | 85 | public function actionLogout() |
71 | 86 | { |
72 | 87 | Yii::$app->user->logout(); |
73 | - | |
88 | + | |
74 | 89 | return $this->goHome(); |
75 | 90 | } |
76 | - | |
91 | + | |
77 | 92 | /** |
78 | 93 | * Displays contact page. |
79 | 94 | * |
... | ... | @@ -81,22 +96,15 @@ class SiteController extends Controller |
81 | 96 | */ |
82 | 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 | 109 | * Displays about page. |
102 | 110 | * |
... | ... | @@ -106,7 +114,7 @@ class SiteController extends Controller |
106 | 114 | { |
107 | 115 | return $this->render('about'); |
108 | 116 | } |
109 | - | |
117 | + | |
110 | 118 | /** |
111 | 119 | * Signs user up. |
112 | 120 | * |
... | ... | @@ -122,12 +130,12 @@ class SiteController extends Controller |
122 | 130 | } |
123 | 131 | } |
124 | 132 | } |
125 | - | |
133 | + | |
126 | 134 | return $this->render('signup', [ |
127 | 135 | 'model' => $model, |
128 | 136 | ]); |
129 | 137 | } |
130 | - | |
138 | + | |
131 | 139 | /** |
132 | 140 | * Requests password reset. |
133 | 141 | * |
... | ... | @@ -139,18 +147,18 @@ class SiteController extends Controller |
139 | 147 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
140 | 148 | if ($model->sendEmail()) { |
141 | 149 | Yii::$app->session->setFlash('success', 'Check your email for further instructions.'); |
142 | - | |
150 | + | |
143 | 151 | return $this->goHome(); |
144 | 152 | } else { |
145 | 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 | 157 | return $this->render('requestPasswordResetToken', [ |
150 | 158 | 'model' => $model, |
151 | 159 | ]); |
152 | 160 | } |
153 | - | |
161 | + | |
154 | 162 | /** |
155 | 163 | * Resets password. |
156 | 164 | * |
... | ... | @@ -165,18 +173,23 @@ class SiteController extends Controller |
165 | 173 | } catch (InvalidParamException $e) { |
166 | 174 | throw new BadRequestHttpException($e->getMessage()); |
167 | 175 | } |
168 | - | |
176 | + | |
169 | 177 | if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) { |
170 | 178 | Yii::$app->session->setFlash('success', 'New password saved.'); |
171 | - | |
179 | + | |
172 | 180 | return $this->goHome(); |
173 | 181 | } |
174 | - | |
182 | + | |
175 | 183 | return $this->render('resetPassword', [ |
176 | 184 | 'model' => $model, |
177 | 185 | ]); |
178 | 186 | } |
179 | 187 | |
188 | + /** | |
189 | + * Action to view robots.txt file dinamycli | |
190 | + * | |
191 | + * @return string | |
192 | + */ | |
180 | 193 | public function actionRobots() |
181 | 194 | { |
182 | 195 | $response = \Yii::$app->response; |
... | ... | @@ -192,4 +205,25 @@ class SiteController extends Controller |
192 | 205 | $response->headers->set('Content-Type', 'text/plain'); |
193 | 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 | 7 | */ |
8 | 8 | |
9 | 9 | use artbox\core\components\SeoComponent; |
10 | + use artbox\core\models\Feedback; | |
10 | 11 | use artbox\core\models\User; |
11 | 12 | use frontend\assets\AppAsset; |
13 | + use yii\bootstrap\ActiveForm; | |
12 | 14 | use yii\bootstrap\Nav; |
13 | 15 | use yii\helpers\Html; |
14 | 16 | use yii\web\View; |
17 | + use yii\widgets\Breadcrumbs; | |
15 | 18 | |
16 | 19 | AppAsset::register($this); |
17 | 20 | $user = \Yii::$app->user->identity; |
18 | 21 | $seo = Yii::$app->get('seo'); |
22 | + $feedback = new Feedback(); | |
19 | 23 | ?> |
20 | 24 | |
21 | 25 | <?php $this->beginPage() ?> |
... | ... | @@ -61,16 +65,16 @@ _________________________________________________________ --> |
61 | 65 | </div> |
62 | 66 | </div> |
63 | 67 | <!-- *** TOP END *** --> |
64 | - | |
68 | + | |
65 | 69 | <!-- *** NAVBAR *** |
66 | 70 | _________________________________________________________ --> |
67 | 71 | <div class="navbar-affixed-top" data-spy="affix" data-offset-top="200"> |
68 | - | |
72 | + | |
69 | 73 | <div class="navbar navbar-default yamm" role="navigation" id="navbar"> |
70 | - | |
74 | + | |
71 | 75 | <div class="container"> |
72 | 76 | <div class="navbar-header"> |
73 | - | |
77 | + | |
74 | 78 | <a class="navbar-brand home" href="index.html"> |
75 | 79 | <img src="/img/logo.png" alt="Universal logo" class="hidden-xs hidden-sm"> |
76 | 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 @@ _________________________________________________________ --> |
82 | 86 | </button> |
83 | 87 | </div> |
84 | 88 | </div> |
85 | - | |
89 | + | |
86 | 90 | <div class="navbar-collapse collapse" id="navigation"> |
87 | 91 | <?php |
88 | 92 | echo Nav::widget( |
... | ... | @@ -93,8 +97,8 @@ _________________________________________________________ --> |
93 | 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 | 104 | 'label' => 'Login', |
... | ... | @@ -108,10 +112,10 @@ _________________________________________________________ --> |
108 | 112 | ); |
109 | 113 | ?> |
110 | 114 | </div> |
111 | - | |
112 | - | |
115 | + | |
116 | + | |
113 | 117 | <div class="collapse clearfix" id="search"> |
114 | - | |
118 | + | |
115 | 119 | <form class="navbar-form" role="search"> |
116 | 120 | <div class="input-group"> |
117 | 121 | <input type="text" class="form-control" placeholder="Search"> |
... | ... | @@ -122,114 +126,175 @@ _________________________________________________________ --> |
122 | 126 | </span> |
123 | 127 | </div> |
124 | 128 | </form> |
125 | - | |
129 | + | |
126 | 130 | </div> |
127 | 131 | <!--/.nav-collapse --> |
128 | - | |
132 | + | |
129 | 133 | </div> |
130 | - | |
131 | - | |
134 | + | |
135 | + | |
132 | 136 | </div> |
133 | 137 | <!-- /#navbar --> |
134 | - | |
138 | + | |
135 | 139 | </div> |
136 | - | |
140 | + | |
137 | 141 | <!-- *** NAVBAR END *** --> |
138 | - | |
142 | + | |
139 | 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 | 151 | <div class="modal-content"> |
148 | 152 | <div class="modal-header"> |
149 | - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
150 | - <h4 class="modal-title" id="Login">Customer login</h4> | |
153 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | |
154 | + <h3 class="modal-title" id="Login">Feedback</h3> | |
151 | 155 | </div> |
152 | 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 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 | 189 | </p> |
171 | - | |
190 | + | |
191 | + <?php ActiveForm::end(); ?> | |
192 | + | |
172 | 193 | </div> |
173 | 194 | </div> |
174 | 195 | </div> |
175 | 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">×</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 | 244 | <?= $content ?> |
180 | - | |
181 | - | |
245 | + | |
246 | + | |
182 | 247 | <!-- *** GET IT *** |
183 | 248 | _________________________________________________________ --> |
184 | - | |
249 | + | |
185 | 250 | <div id="get-it"> |
186 | 251 | <div class="container"> |
187 | 252 | <div class="col-md-8 col-sm-12"> |
188 | 253 | <h3>Do you want cool website like this one?</h3> |
189 | 254 | </div> |
190 | 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 | 257 | </div> |
193 | 258 | </div> |
194 | 259 | </div> |
195 | - | |
196 | - | |
260 | + | |
261 | + | |
197 | 262 | <!-- *** GET IT END *** --> |
198 | - | |
263 | + | |
199 | 264 | <!-- *** FOOTER *** |
200 | 265 | _________________________________________________________ --> |
201 | - | |
266 | + | |
202 | 267 | <footer id="footer"> |
203 | 268 | <div class="container"> |
204 | 269 | <div class="col-md-6 col-sm-12"> |
205 | 270 | <h4>About us</h4> |
206 | - | |
271 | + | |
207 | 272 | <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> |
208 | - | |
273 | + | |
209 | 274 | <hr> |
210 | - | |
275 | + | |
211 | 276 | <h4>Join our monthly newsletter</h4> |
212 | - | |
277 | + | |
213 | 278 | <form> |
214 | 279 | <div class="input-group"> |
215 | - | |
280 | + | |
216 | 281 | <input type="text" class="form-control"> |
217 | - | |
282 | + | |
218 | 283 | <span class="input-group-btn"> |
219 | 284 | |
220 | 285 | <button class="btn btn-default" type="button"><i class="fa fa-send"></i></button> |
221 | 286 | |
222 | 287 | </span> |
223 | - | |
288 | + | |
224 | 289 | </div> |
225 | 290 | <!-- /input-group --> |
226 | 291 | </form> |
227 | - | |
292 | + | |
228 | 293 | <hr class="hidden-md hidden-lg hidden-sm"> |
229 | - | |
294 | + | |
230 | 295 | </div> |
231 | 296 | <!-- /.col-md-3 --> |
232 | - | |
297 | + | |
233 | 298 | <!-- <div class="col-md-3 col-sm-6">--> |
234 | 299 | <!-- --> |
235 | 300 | <!-- <h4>Blog</h4>--> |
... | ... | @@ -273,11 +338,11 @@ _________________________________________________________ --> |
273 | 338 | <!-- --> |
274 | 339 | <!-- </div>--> |
275 | 340 | <!-- /.col-md-3 --> |
276 | - | |
341 | + | |
277 | 342 | <div class="col-md-4 col-sm-12 col-md-offset-2"> |
278 | - | |
343 | + | |
279 | 344 | <h4>Contact</h4> |
280 | - | |
345 | + | |
281 | 346 | <p><strong>Universal Ltd.</strong> |
282 | 347 | <br>13/25 New Avenue |
283 | 348 | <br>Newtown upon River |
... | ... | @@ -286,15 +351,15 @@ _________________________________________________________ --> |
286 | 351 | <br> |
287 | 352 | <strong>Great Britain</strong> |
288 | 353 | </p> |
289 | - | |
354 | + | |
290 | 355 | <a href="contact.html" class="btn btn-small btn-template-main">Go to contact page</a> |
291 | - | |
356 | + | |
292 | 357 | <hr class="hidden-md hidden-lg hidden-sm"> |
293 | - | |
358 | + | |
294 | 359 | </div> |
295 | 360 | <!-- /.col-md-3 --> |
296 | - | |
297 | - | |
361 | + | |
362 | + | |
298 | 363 | <!-- <div class="col-md-3 col-sm-6">--> |
299 | 364 | <!-- --> |
300 | 365 | <!-- <h4>Photostream</h4>--> |
... | ... | @@ -338,12 +403,12 @@ _________________________________________________________ --> |
338 | 403 | <!-- /.container --> |
339 | 404 | </footer> |
340 | 405 | <!-- /#footer --> |
341 | - | |
406 | + | |
342 | 407 | <!-- *** FOOTER END *** --> |
343 | - | |
408 | + | |
344 | 409 | <!-- *** COPYRIGHT *** |
345 | 410 | _________________________________________________________ --> |
346 | - | |
411 | + | |
347 | 412 | <div id="copyright"> |
348 | 413 | <div class="container"> |
349 | 414 | <div class="col-md-12"> |
... | ... | @@ -352,15 +417,15 @@ _________________________________________________________ --> |
352 | 417 | <a href="https://remoteplease.com">Remote Please</a> |
353 | 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 | 419 | </p> |
355 | - | |
420 | + | |
356 | 421 | </div> |
357 | 422 | </div> |
358 | 423 | </div> |
359 | 424 | <!-- /#copyright --> |
360 | - | |
361 | - <!-- *** COPYRIGHT END *** --> | |
362 | - | |
363 | 425 | |
426 | + <!-- *** COPYRIGHT END *** --> | |
427 | + | |
428 | + | |
364 | 429 | </div> |
365 | 430 | <!-- /#all --> |
366 | 431 | <?php $this->endBody() ?> | ... | ... |
frontend/views/page/view.php
... | ... | @@ -14,24 +14,6 @@ |
14 | 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 | 17 | <div id="content"> |
36 | 18 | <div class="container"> |
37 | 19 | ... | ... |
frontend/views/site/contact.php
1 | 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 | 146 | <?php ActiveForm::end(); ?> |
147 | + | |
148 | + | |
42 | 149 | </div> |
43 | - </div> | |
44 | - | |
150 | + </div> | |
151 | + <!-- /.row --> | |
152 | + | |
153 | + </section> | |
154 | + | |
155 | + | |
156 | + </div> | |
157 | + <!-- /#contact.container --> | |
45 | 158 | </div> |
159 | +<!-- /#content --> | |
160 | + | |
161 | +<div id="map"> | |
162 | + | |
163 | +</div> | |
46 | 164 | \ No newline at end of file | ... | ... |
frontend/web/css/custom.css
1 | -/* your styles go here */ | |
2 | 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 | 89 | \ No newline at end of file | ... | ... |
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 | 36 | \ No newline at end of file | ... | ... |