Commit d0f3b99fc4107be9e08df36ae701f7492e3ed8f1

Authored by Yarik
1 parent 0aa459ef

test

common/models/Feedback.php
... ... @@ -54,7 +54,7 @@ class Feedback extends \yii\db\ActiveRecord
54 54 return [
55 55 [['name', 'answer', 'email'], 'required'],
56 56 [['email'], 'email'],
57   - [['phone'], 'match', 'pattern' => '^\+?(?:\d{0,3})?[\(\s]?\d{0,5}[\)\s]?\d{3}[-\s]?\d{2}[-\s]?\d{2}$'],
  57 + [['phone'], 'match', 'pattern' => '/^\+?(?:\d{0,3})?[\(\s]?\d{0,5}[\)\s]?\d{3}[-\s]?\d{2}[-\s]?\d{2}$/'],
58 58 [['name', 'phone', 'answer'], 'string', 'max' => 255],
59 59 ];
60 60 }
... ...
common/modules/comment/models/CommentProject.php
... ... @@ -342,6 +342,7 @@
342 342 return \Yii::$app->user->can(\common\modules\comment\Permissions::CREATE, [
343 343 'model' => $this->model,
344 344 'model_id' => $this->model_id,
  345 + 'comment_model' => $this->className(),
345 346 ]);
346 347 }
347 348 }
... ...
common/modules/comment/models/CommentProjectAnswer.php
... ... @@ -75,6 +75,23 @@
75 75 'model_id' => $this->model_id,
76 76 ],
77 77 ],
  78 + [
  79 + ['comment_pid'],
  80 + 'required',
  81 + 'when' => function($model, $attribute) {
  82 + /**
  83 + * @var CommentProjectAnswer $model
  84 + * @var string $attribute
  85 + */
  86 + if(!empty(\Yii::$app->user->id) && $model->isNewRecord && !empty($model->model) && !empty($model->model_id)) {
  87 + $project = Project::findOne($model->model_id);
  88 + if(!empty($project) && $project->user_id == \Yii::$app->user->id) {
  89 + return true;
  90 + }
  91 + }
  92 + return false;
  93 + }
  94 + ],
78 95 ];
79 96 }
80 97  
... ...
common/modules/comment/resources/comment.js
... ... @@ -187,11 +187,14 @@ $(function() {
187 187 $(document).on('click', '.artbox_comment_reply_answer', function(e) {
188 188 e.preventDefault();
189 189 var widget = $(this).parents('.artbox_comment_widget');
  190 + var form = $(widget).find('.artbox_comment_form');
  191 + $(form).removeClass('hidden');
190 192 $(widget).find('.artbox_comment_answer_label').text('Ответ');
191 193 });
192 194  
193 195 $(document).on('click', '.artbox_comment_reply_answer_block', function(e) {
194 196 var form = $(this).parents('.artbox_comment_form');
  197 + $(form).addClass('hidden');
195 198 $(form).find('.artbox_comment_answer_label').text('Вопрос');
196 199 });
197 200  
... ...
common/modules/comment/widgets/views/_question_comment_view.php
... ... @@ -21,8 +21,8 @@
21 21 ]);
22 22 }
23 23 ?>
24   - <div class="<?=((!empty($model->child))?'has-child':'')?>">
25   - <div class="header-cabinet-foto" style="background: none;"><?= Html::img((!empty( $model->user ) && !empty($model->user->userInfo->image) ) ? $model->user->minImg($model->user->userInfo->image, 48, 48) : '/images/ico-profile.png') ?></div>
  24 + <div class="<?= ( ( !empty( $model->child ) ) ? 'has-child' : '' ) ?>">
  25 + <div class="header-cabinet-foto" style="background: none;"><?= Html::img(( !empty( $model->user ) && !empty( $model->user->userInfo->image ) ) ? $model->user->minImg($model->user->userInfo->image, 48, 48) : '/images/ico-profile.png') ?></div>
26 26 <div style="width: 500px; float: left; margin-left: 12px;">
27 27 <div class="comments-name style <?= CommentWidget::$baseClass[ 'comment_author' ] ?>">
28 28 <a href="/"><?= $model->getAuthor(' (Гость)') ?></a>
... ... @@ -30,16 +30,17 @@
30 30 </div>
31 31  
32 32 <?php
33   - /* == STATUS PRO ==
34   - ?>
35   - <div class="comments-status"><span>Pro</span></div>
36   - <?php
37   - */
  33 + /* == STATUS PRO ==
  34 + ?>
  35 + <div class="comments-status"><span>Pro</span></div>
  36 + <?php
  37 + */
38 38 ?>
39 39 <div class="blog-post-date style">
40   - <span></span><p><?= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?></p>
  40 + <span></span>
  41 + <p><?= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?></p>
41 42 </div>
42   -<!-- <div class="comments-date style">--><?//= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?><!--</div>-->
  43 + <!-- <div class="comments-date style">--><? //= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?><!--</div>-->
43 44 </div>
44 45 <div class="comments-content">
45 46 <div class="style" style="font-weight: 700;">Вопрос</div>
... ... @@ -61,19 +62,25 @@
61 62 ]);
62 63 }
63 64 ?>
64   - <div class="buutons_comm style" style="margin-top: 15px">
65   - <?php
66   - if(!empty( $model->buttons[ 'delete' ] )) {
67   - echo Html::a(( $model->user_id != NULL && $model->user_id == \Yii::$app->user->id ) ? 'Удалить' : 'Пожаловаться ', $model->buttons[ 'delete' ], [ 'class' => 'artbox_comment_delete_answer' ]);
68   - }
69   - if(!empty( $model->buttons[ 'update' ] )) {
70   - echo Html::a('Редактировать', $model->buttons[ 'update' ], [ 'class' => 'artbox_comment_update_answer' ]);
71   - }
72   - if(!empty( $model->buttons[ 'reply' ] )) {
73   - echo Html::a('Ответить', $model->buttons[ 'reply' ], [ 'class' => CommentWidget::$baseClass[ 'comment_reply' ] . ' artbox_comment_reply_answer' ]);
74   - }
75   - ?>
76   - </div>
  65 + <?php
  66 + if(array_filter($model->buttons)) {
  67 + ?>
  68 + <div class="buutons_comm style" style="margin-top: 15px">
  69 + <?php
  70 + if(!empty( $model->buttons[ 'delete' ] )) {
  71 + echo Html::a(( $model->user_id != NULL && $model->user_id == \Yii::$app->user->id ) ? 'Удалить' : 'Пожаловаться ', $model->buttons[ 'delete' ], [ 'class' => 'artbox_comment_delete_answer' ]);
  72 + }
  73 + if(!empty( $model->buttons[ 'update' ] )) {
  74 + echo Html::a('Редактировать', $model->buttons[ 'update' ], [ 'class' => 'artbox_comment_update_answer' ]);
  75 + }
  76 + if(!empty( $model->buttons[ 'reply' ] )) {
  77 + echo Html::a('Ответить', $model->buttons[ 'reply' ], [ 'class' => CommentWidget::$baseClass[ 'comment_reply' ] . ' artbox_comment_reply_answer' ]);
  78 + }
  79 + ?>
  80 + </div>
  81 + <?php
  82 + }
  83 + ?>
77 84 </div>
78 85 <?php
79 86 /* == PROJECT INFO ==
... ...
common/modules/comment/widgets/views/form-comment-answer.php
... ... @@ -5,31 +5,43 @@
5 5 * @var \yii\data\ActiveDataProvider $dataProvider
6 6 * @var null|\common\modules\comment\models\Rating $rating
7 7 */
  8 + use common\models\Project;
8 9 use yii\widgets\ActiveForm;
9 10 use yii\helpers\Html;
10 11  
11 12 ?>
12   -<div class="tender-add-answer-title fix_tender_answer">Задать вопрос</div>
  13 +<?php
  14 + if(!empty( $model->model_id )) {
  15 + $project = Project::findOne($model->model_id);
  16 + }
  17 + if(!empty( $project ) && $project->user_id != \Yii::$app->user->id) {
  18 + ?>
  19 + <div class="tender-add-answer-title fix_tender_answer">Задать вопрос</div>
  20 + <?php
  21 + }
  22 +?>
13 23 <div class="new-portf-add-comm style tender_questions_" style="padding-top: 16px">
14 24  
15 25 <?php
16   - if(!empty(\Yii::$app->user->id)) {?>
17   - <div class="form-ico-ded-wr" style="width: 100%">
18   - <div class="header-cabinet-foto"><img src="<?php echo \Yii::$app->user->identity->userInfo->image; ?>" alt=""></div>
19   - <div class="form-value-ded-name"><?php echo \Yii::$app->user->identity->name; ?></div>
20   - </div>
  26 + if(!empty( \Yii::$app->user->id )) { ?>
  27 + <div class="form-ico-ded-wr" style="width: 100%">
  28 + <div class="header-cabinet-foto">
  29 + <img src="<?php echo \Yii::$app->user->identity->userInfo->image; ?>" alt="">
  30 + </div>
  31 + <div class="form-value-ded-name"><?php echo \Yii::$app->user->identity->name; ?></div>
  32 + </div>
21 33  
22 34  
23   - <?php
24   - }
25   - $form = ActiveForm::begin();
  35 + <?php
  36 + }
  37 + $form = ActiveForm::begin(['options' => ['data' => ['pjax' => true]]]);
26 38 if(!$model->isNewRecord) {
27 39 echo $form->field($model, 'comment_id')
28 40 ->hiddenInput()
29 41 ->label(false)
30 42 ->error(false);
31 43 }
32   - if(!empty($model->comment_pid)) {
  44 + if(!empty( $model->comment_pid )) {
33 45 echo $form->field($model, 'comment_pid')
34 46 ->hiddenInput()
35 47 ->label(false)
... ... @@ -68,7 +80,7 @@
68 80 'class' => 'custom-area-4',
69 81 ],
70 82 ])
71   - ->label($model->isNewRecord?'Вопрос':'Ответ', ['class' => 'artbox_comment_answer_label'])
  83 + ->label($model->isNewRecord ? 'Вопрос' : 'Ответ', [ 'class' => 'artbox_comment_answer_label' ])
72 84 ->textarea();
73 85 ?>
74 86 <div class="input-blocks-comm-button style">
... ...
common/modules/comment/widgets/views/form-project-comment.php
... ... @@ -17,7 +17,7 @@
17 17  
18 18 <div class="form-tender-answer _fix_errors_tender style">
19 19 <?php
20   - $form = ActiveForm::begin([ 'options' => [ 'class' => 'resformsfile MultiFile-intercepted', 'enctype' => 'multipart/form-data' ] ]);
  20 + $form = ActiveForm::begin([ 'options' => [ 'class' => 'resformsfile MultiFile-intercepted', 'enctype' => 'multipart/form-data', 'data' => ['pjax' => true] ] ]);
21 21 ?>
22 22 <div class="form-value-wr style">
23 23 <div class="form-ico-ded-wr">
... ...
frontend/views/tender/view.php
1 1 <?php
2 2  
3 3 /**
4   - * @var View $this
  4 + * @var View $this
5 5 * @var Project $model
6 6 */
7 7 use common\models\Project;
8 8 use common\modules\comment\models\Comment;
9 9 use kartik\rating\StarRating;
10 10 use \yii\helpers\Html;
11   -use yii\helpers\Url;
  11 + use yii\helpers\Url;
12 12 use yii\web\View;
13 13 use yii\widgets\DetailView;
  14 + use yii\widgets\Pjax;
14 15  
15   -$this->title = 'My Yii Application';
  16 + $this->title = 'My Yii Application';
16 17 ?>
17 18 <div class="section-box content">
18 19 <div class="section-box-tender">
... ... @@ -22,21 +23,24 @@ $this-&gt;title = &#39;My Yii Application&#39;;
22 23 <div class="box-all">
23 24 <div class="tender-contract-wr style">
24 25 <div class="tender-contract-left">
25   - <?php if(!empty($model->parent->name)):?>
26   - <div class="srch-prof-contract-button">ПОДРЯД</div>
27   - <div class="srch-prof-contract-txt">
28   - <span>Из заказа: </span><?= Html::a($model->parent->name, Url::toRoute(['tender/view', 'tender_id' =>$model->parent->project_id ])) ?>
29   - </div>
  26 + <?php if(!empty( $model->parent->name )): ?>
  27 + <div class="srch-prof-contract-button">ПОДРЯД</div>
  28 + <div class="srch-prof-contract-txt">
  29 + <span>Из заказа: </span><?= Html::a($model->parent->name, Url::toRoute([
  30 + 'tender/view',
  31 + 'tender_id' => $model->parent->project_id,
  32 + ])) ?>
  33 + </div>
30 34 <?php endif; ?>
31 35 </div>
32 36 <div class="tender-contract-right">
33   - <span>Бюджет: <?= $model->budget?> <?= $model->budgetCurrency->label?></span>
  37 + <span>Бюджет: <?= $model->budget ?> <?= $model->budgetCurrency->label ?></span>
34 38 <img src="/images/tender/ico-1.png" alt=""/>
35 39 </div>
36 40 </div>
37 41 <div class="tender-date style">
38 42 <div class="srch-prof-params srch-prof-params-clock">
39   - <img src="/images/ico-clock.png" alt=""><span><?= Yii::$app->formatter->asDatetime($model->date_end, 'dd.MM.Y')?></span>
  43 + <img src="/images/ico-clock.png" alt=""><span><?= Yii::$app->formatter->asDatetime($model->date_end, 'dd.MM.Y') ?></span>
40 44 </div>
41 45 </div>
42 46 </div>
... ... @@ -49,25 +53,30 @@ $this-&gt;title = &#39;My Yii Application&#39;;
49 53 <div class="section-box">
50 54 <div class="cabinet-message-read-autor-wr style">
51 55 <div class="cabinet-message-read-foto-wr">
52   - <div class="cabinet-message-read-foto"><img src="<?= ($model->user->userInfo->image)?:'' ?>" alt=""/></div>
  56 + <div class="cabinet-message-read-foto">
  57 + <img src="<?= ( $model->user->userInfo->image ) ? : '' ?>" alt=""/>
  58 + </div>
53 59 </div>
54 60 <div class="cab-mes-read-cont">
55 61 <div class="cab-mes-read-cont-title"><?= $model->user->owner->name ?></div>
56 62 <div class="cab-mes-read-cont-stars">
57 63 <?php
58 64 echo StarRating::widget([
59   - 'name' => 'rating_company',
60   - 'value' => $model->user->userInfo->rating,
61   - 'pluginOptions' => ['displayOnly' => true, 'size' => 'xxs']
  65 + 'name' => 'rating_company',
  66 + 'value' => $model->user->userInfo->rating,
  67 + 'pluginOptions' => [
  68 + 'displayOnly' => true,
  69 + 'size' => 'xxs',
  70 + ],
62 71 ]);
63 72 ?>
64 73 </div>
65   - <div class="cab-mes-read-cont-com"><?=count($model->user->comments)?> отзывов</div>
  74 + <div class="cab-mes-read-cont-com"><?= count($model->user->comments) ?> отзывов</div>
66 75 <div class="cab-mes-read-cont-soc">
67   - <?= Html::a(Html::img('/images/ico-fb.png'),"{$model->user->userInfo->social_fb}",['target'=>'_blank'])?>
68   - <?= Html::a(Html::img('/images/ico-tw.png'),"{$model->user->userInfo->social_t}", ['target'=>'_blank'])?>
69   - <?= Html::a(Html::img('/images/ico-in.png'),"{$model->user->userInfo->social_in}",['target'=>'_blank'])?>
70   - <?= Html::a(Html::img('/images/ico-vk.png'),"{$model->user->userInfo->social_vk}",['target'=>'_blank'])?>
  76 + <?= Html::a(Html::img('/images/ico-fb.png'), "{$model->user->userInfo->social_fb}", [ 'target' => '_blank' ]) ?>
  77 + <?= Html::a(Html::img('/images/ico-tw.png'), "{$model->user->userInfo->social_t}", [ 'target' => '_blank' ]) ?>
  78 + <?= Html::a(Html::img('/images/ico-in.png'), "{$model->user->userInfo->social_in}", [ 'target' => '_blank' ]) ?>
  79 + <?= Html::a(Html::img('/images/ico-vk.png'), "{$model->user->userInfo->social_vk}", [ 'target' => '_blank' ]) ?>
71 80 </div>
72 81 </div>
73 82 <?php
... ... @@ -97,75 +106,80 @@ $this-&gt;title = &#39;My Yii Application&#39;;
97 106 <div class="style">
98 107 <div class="profile-phone">
99 108 <img src="/images/sidebar-ico/ico-2.png" alt="">
100   - <span style="font-size: 13px" class="sidebar-views-txt">На сайте: </span><?= $model->user->liveTime?>
  109 + <span style="font-size: 13px" class="sidebar-views-txt">На сайте: </span><?= $model->user->liveTime ?>
101 110 </div>
102 111 </div>
103 112 </div>
104 113 </div>
105   -<!-- <div class="cab-mes-read-min-bl">-->
106   -<!-- <div class="profile-phone-site style">-->
107   -<!-- <div class="style">-->
108   -<!-- <div class="profile-phone" style="width: 175px">-->
109   -<!-- <img src="/images/sidebar-ico/ico-4.png" alt="">-->
110   -<!-- <span style="font-size: 13px" class="sidebar-views-txt">Последнее обновление:<br></span><p style="padding-left: 24px">1 ноября 2015</p>-->
111   -<!-- </div>-->
112   -<!-- </div>-->
113   -<!-- </div>-->
114   -<!-- </div>-->
  114 + <!-- <div class="cab-mes-read-min-bl">-->
  115 + <!-- <div class="profile-phone-site style">-->
  116 + <!-- <div class="style">-->
  117 + <!-- <div class="profile-phone" style="width: 175px">-->
  118 + <!-- <img src="/images/sidebar-ico/ico-4.png" alt="">-->
  119 + <!-- <span style="font-size: 13px" class="sidebar-views-txt">Последнее обновление:<br></span><p style="padding-left: 24px">1 ноября 2015</p>-->
  120 + <!-- </div>-->
  121 + <!-- </div>-->
  122 + <!-- </div>-->
  123 + <!-- </div>-->
115 124 <div class="cab-mes-read-min-bl" style="margin-top: 25px; width: 204px">
116 125 <div class="profile-phone-site style">
117 126 <div class="style">
118 127 <div class="profile-phone">
119 128 <img src="/images/sidebar-ico/ico-3.png" alt="">
120   - <span style="font-size: 13px; margin-left: 7px" class="sidebar-views-txt">Последний визит:<br></span><p style="padding-left: 25px"><?= $model->user->userInfo->lastVisit?></p>
  129 + <span style="font-size: 13px; margin-left: 7px" class="sidebar-views-txt">Последний визит:<br></span>
  130 + <p style="padding-left: 25px"><?= $model->user->userInfo->lastVisit ?></p>
121 131 </div>
122 132 </div>
123 133 </div>
124 134 </div>
125   - <?php if($model->user->type == 2):?>
126   - <div class="cab-mes-read-min-bl" style="margin-top: 25px">
127   - <div class="profile-phone-site style">
128   - <div class="style">
129   - <div class="profile-phone" style="width: 175px">
130   - <img src="/images/sidebar-ico/ico-5.png" alt="">
131   - <span style="font-size: 13px" class="sidebar-views-txt">Сотрудники: </span><?= $model->user->companyInfo->staff?>
  135 + <?php if($model->user->type == 2): ?>
  136 + <div class="cab-mes-read-min-bl" style="margin-top: 25px">
  137 + <div class="profile-phone-site style">
  138 + <div class="style">
  139 + <div class="profile-phone" style="width: 175px">
  140 + <img src="/images/sidebar-ico/ico-5.png" alt="">
  141 + <span style="font-size: 13px" class="sidebar-views-txt">Сотрудники: </span><?= $model->user->companyInfo->staff ?>
  142 + </div>
132 143 </div>
133 144 </div>
134 145 </div>
135   - </div>
136 146 <?php endif; ?>
137 147  
138 148 <div class="cab-mes-read-min-bl" style="margin-top: 25px; width: 204px">
139   - <?php foreach($model->user->phones as $phone ):?>
140   - <div class="profile-phone-site style">
141   - <div class="style">
142   - <div class="profile-phone">
143   - <img src="/images/ico-phone.png" alt="">
144   - <span style="margin-left: 3px"><?= $phone['phone'] ?></span>
  149 + <?php foreach($model->user->phones as $phone): ?>
  150 + <div class="profile-phone-site style">
  151 + <div class="style">
  152 + <div class="profile-phone">
  153 + <img src="/images/ico-phone.png" alt="">
  154 + <span style="margin-left: 3px"><?= $phone[ 'phone' ] ?></span>
  155 + </div>
145 156 </div>
146 157 </div>
147   - </div>
148   - <?php endforeach;?>
  158 + <?php endforeach; ?>
149 159 </div>
150 160 <div class="cab-mes-read-min-bl" style="margin-top: 25px">
151   - <?php foreach($model->user->site as $site ):?>
152   - <div class="profile-phone-site style">
153   - <div class="style">
154   - <div class="profile-site">
155   - <img src="/images/ico-site.png" alt="">
156   - <a href="<?= $site['site']?>" target="_blank">Сайт</a>
  161 + <?php foreach($model->user->site as $site): ?>
  162 + <div class="profile-phone-site style">
  163 + <div class="style">
  164 + <div class="profile-site">
  165 + <img src="/images/ico-site.png" alt="">
  166 + <a href="<?= $site[ 'site' ] ?>" target="_blank">Сайт</a>
  167 + </div>
157 168 </div>
158 169 </div>
159   - </div>
160   - <?php endforeach;?>
  170 + <?php endforeach; ?>
161 171 </div>
162 172 </div>
163 173 </div>
164 174  
165 175 </div>
166 176 <div class="section-box-tender-navi">
167   - <?php if(!empty($model->parent->name)):?>
168   - <span>Подряд</span><img src="/images/tender/ico-2.png" alt=""/><?= Html::a(Yii::t('app', 'Main project'), Url::toRoute(['tender/view', 'tender_id' =>$model->parent->project_id ])) ?>
  177 + <?php if(!empty( $model->parent->name )): ?>
  178 + <span>Подряд</span>
  179 + <img src="/images/tender/ico-2.png" alt=""/><?= Html::a(Yii::t('app', 'Main project'), Url::toRoute([
  180 + 'tender/view',
  181 + 'tender_id' => $model->parent->project_id,
  182 + ])) ?>
169 183 <?php endif; ?>
170 184 </div>
171 185 <div class="section-box-tender-info-wr">
... ... @@ -177,7 +191,7 @@ $this-&gt;title = &#39;My Yii Application&#39;;
177 191 <div class="section-box-tender-tags-wr">
178 192 <div class="section-box-tender-tags-title style">Специализации</div>
179 193 <div class="section-box-tender-tags style">
180   - <?php foreach($model->specializations as $specialization):?>
  194 + <?php foreach($model->specializations as $specialization): ?>
181 195 <span><a href="#"><?= $specialization->specialization_name ?></a>, </span>
182 196 <?php endforeach; ?>
183 197 </div>
... ... @@ -191,35 +205,30 @@ $this-&gt;title = &#39;My Yii Application&#39;;
191 205 <div class="shadow-map"></div>
192 206 <div id="map_cloud" style="display: none;">
193 207 <script type="text/javascript">
194   - function initialize() {
  208 + function initialize()
  209 + {
195 210 var start_position = new google.maps.LatLng('56', '30');
196 211 var settings = {
197   - zoom: 7,
198   - scrollwheel: false,
199   - center: start_position,
200   - mapTypeControl: false,
201   - mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
202   - navigationControl: false,
203   - navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
204   - scaleControl: false,
205   - streetViewControl: false,
206   - rotateControl: false,
207   - zoomControl:true,
208   - mapTypeId: google.maps.MapTypeId.ROADMAP};
  212 + zoom : 7, scrollwheel : false, center : start_position,
  213 + mapTypeControl : false,
  214 + mapTypeControlOptions : {style : google.maps.MapTypeControlStyle.DROPDOWN_MENU},
  215 + navigationControl : false,
  216 + navigationControlOptions : {style : google.maps.NavigationControlStyle.SMALL},
  217 + scaleControl : false, streetViewControl : false, rotateControl : false,
  218 + zoomControl : true, mapTypeId : google.maps.MapTypeId.ROADMAP
  219 + };
209 220 var map = new google.maps.Map(document.getElementById("map_canvas"), settings);
210 221  
211   - var image1 = new google.maps.MarkerImage('images/markers/marker-we-1.png',
212   - new google.maps.Size(21, 32),
213   - new google.maps.Point(0,0),
214   - new google.maps.Point(16, 35)
  222 + var image1 = new google.maps.MarkerImage(
  223 + 'images/markers/marker-we-1.png', new google.maps.Size(21, 32), new google.maps.Point(0, 0), new google.maps.Point(16, 35)
215 224 );
216 225  
217   - var marker = new google.maps.Marker({
218   - position: new google.maps.LatLng('56', '35.3'),
219   - map: map,
220   - title: 'Marker Title2',
221   - icon: image1
222   - });
  226 + var marker = new google.maps.Marker(
  227 + {
  228 + position : new google.maps.LatLng('56', '35.3'), map : map,
  229 + title : 'Marker Title2', icon : image1
  230 + }
  231 + );
223 232  
224 233 }
225 234 </script>
... ... @@ -238,13 +247,14 @@ $this-&gt;title = &#39;My Yii Application&#39;;
238 247 </div>
239 248 </div>
240 249  
241   - </div>
242   -
243   - <div class="tabs_views-wr">
244   - <div class="_tabs style">
245   - <div class="box-wr">
246   - <div class="box-all">
247   - <?php
  250 + </div>
  251 +
  252 + <div class="tabs_views-wr">
  253 + <div class="_tabs style">
  254 + <div class="box-wr">
  255 + <div class="box-all">
  256 + <?php
  257 + Pjax::begin();
248 258 echo \common\modules\comment\widgets\CommentWidget::widget([
249 259 'context' => $this,
250 260 'model' => $model::className(),
... ... @@ -257,7 +267,7 @@ $this-&gt;title = &#39;My Yii Application&#39;;
257 267 'status' => \common\modules\comment\models\CommentProject::STATUS_ACTIVE,
258 268 ],
259 269 'list_options' => [
260   - 'view' => 'list-project-comment',
  270 + 'view' => 'list-project-comment',
261 271 'class' => 'section box tender-offer-proj-wr',
262 272 ],
263 273 'form_options' => [
... ... @@ -269,20 +279,22 @@ $this-&gt;title = &#39;My Yii Application&#39;;
269 279 'tag' => false,
270 280 ],
271 281 ]);
272   - ?>
273   - </div>
  282 + Pjax::end();
  283 + ?>
274 284 </div>
275 285 </div>
276   - <div class="_tabs style">
277   - <div class="box-wr">
278   - <div class="box-all">
279   - <?php
  286 + </div>
  287 + <div class="_tabs style">
  288 + <div class="box-wr">
  289 + <div class="box-all">
  290 + <?php
  291 + Pjax::begin();
280 292 echo \common\modules\comment\widgets\CommentWidget::widget([
281   - 'context' => $this,
282   - 'model' => $model->className(),
283   - 'model_id' => $model->project_id,
284   - 'comment_class' => \common\modules\comment\models\CommentProjectAnswer::className(),
285   - 'class_options' => [
  293 + 'context' => $this,
  294 + 'model' => $model->className(),
  295 + 'model_id' => $model->project_id,
  296 + 'comment_class' => \common\modules\comment\models\CommentProjectAnswer::className(),
  297 + 'class_options' => [
286 298 'scenario' => is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST,
287 299 'user_id' => \Yii::$app->user->getId(),
288 300 'guestComment' => false,
... ... @@ -293,24 +305,25 @@ $this-&gt;title = &#39;My Yii Application&#39;;
293 305 'pageSize' => 2,
294 306 ],
295 307 ],
296   - 'success_options' => [
  308 + 'success_options' => [
297 309 'tag' => 'div',
298 310 'content' => 'Вопрос успешно создан и появится как только будет получен ответ',
299 311 'class' => 'test-class-success',
300 312 ],
301   - 'list_options' => [
  313 + 'list_options' => [
302 314 'view' => 'list-comment-question',
303 315 ],
304   - 'form_options' => [
305   - 'view' => 'form-comment-answer',
306   - 'tag' => 'span',
  316 + 'form_options' => [
  317 + 'view' => 'form-comment-answer',
  318 + 'tag' => 'span',
  319 + 'class' => ( ( $model->user_id == \Yii::$app->user->id ) ? 'hidden' : '' ),
307 320 ],
308   - 'options' => [
  321 + 'options' => [
309 322 'class' => 'proektant-comments-wr fix_te style',
310 323 ],
311 324 ]);
312   - ?>
313   - </div>
  325 + Pjax::end();
  326 + ?>
314 327 </div>
315 328 </div>
316 329 </div>
... ... @@ -320,64 +333,87 @@ $this-&gt;title = &#39;My Yii Application&#39;;
320 333  
321 334 </div>
322 335 <script>
323   - $(document).ready(function () {
324   - tabs_();
325   - inputNumber();
326   - tenderMark();
327   - function inputNumber() {
328   - $("#commentproject-budget_from, #commentproject-budget_to, #commentproject-term_from, #commentproject-term_to").keypress(function(e){return 8==e.which||e.which>47&&e.which<58?void 0:!1})
329   - }
  336 + $(document).ready(
  337 + function()
  338 + {
  339 + tabs_();
  340 + inputNumber();
  341 + tenderMark();
  342 + function inputNumber()
  343 + {
  344 + $("#commentproject-budget_from, #commentproject-budget_to, #commentproject-term_from, #commentproject-term_to")
  345 + .keypress(
  346 + function(e)
  347 + {
  348 + return 8 == e.which || e.which > 47 && e.which < 58 ? void 0 : !1
  349 + }
  350 + )
  351 + }
330 352  
331   - function tabs_() {
332   - $('.tabs_list').css('display','block')
333   - $('._tabs').css({display:'none'})
334   - $('._tabs:first-child').css({display:'block'})
335   - $('.tabs_list ul li').click(function () {
336   - $('.tabs_list ul li').removeClass('active')
337   - $(this).addClass('active')
338   - var index = $(this).index()
339   - var tabs = $('._tabs')
340   - tabs.css({display:'none'})
341   - $(tabs[index]).css({display:'block'})
342   - })
343   - }
344   - function tenderMark() {
345   - var markParrent = $('.project_owner_control')
346   - markParrent.addClass('_on')
347   - for(var i=0; i<markParrent.length;i++) {
348   - var markTxt = $(markParrent[i]).find('a.active')
349   - console.log(markTxt.text())
350   - $(markParrent[i]).find('p.new_mark_').html(markTxt.text())
351   - markTxt.css({display:'none'})
  353 + function tabs_()
  354 + {
  355 + $('.tabs_list').css('display', 'block')
  356 + $('._tabs').css({display : 'none'})
  357 + $('._tabs:first-child').css({display : 'block'})
  358 + $('.tabs_list ul li').click(
  359 + function()
  360 + {
  361 + $('.tabs_list ul li').removeClass('active')
  362 + $(this).addClass('active')
  363 + var index = $(this).index()
  364 + var tabs = $('._tabs')
  365 + tabs.css({display : 'none'})
  366 + $(tabs[index]).css({display : 'block'})
  367 + }
  368 + )
352 369 }
353 370  
  371 + function tenderMark()
  372 + {
  373 + var markParrent = $('.project_owner_control')
  374 + markParrent.addClass('_on')
  375 + for(var i = 0; i < markParrent.length; i++)
  376 + {
  377 + var markTxt = $(markParrent[i]).find('a.active')
  378 + console.log(markTxt.text())
  379 + $(markParrent[i]).find('p.new_mark_').html(markTxt.text())
  380 + markTxt.css({display : 'none'})
  381 + }
354 382  
  383 + markParrent.click(
  384 + function()
  385 + {
  386 + $(this).toggleClass('focus')
  387 + if($(this).hasClass('focus'))
  388 + {
  389 + $(this).addClass('shadow_')
  390 + var height = $(this).height()
  391 + var newHeight = ($(this).find('div').height()) + 2
  392 + $(this).css({height : (height + newHeight)})
  393 + markParrent.find('a').click(
  394 + function()
  395 + {
  396 + $(this).parent().prev().html($(this).text())
355 397  
356   - markParrent.click(function () {
357   - $(this).toggleClass('focus')
358   - if($(this).hasClass('focus')) {
359   - $(this).addClass('shadow_')
360   - var height = $(this).height()
361   - var newHeight = ($(this).find('div').height())+2
362   - $(this).css({height:(height+newHeight)})
363   - markParrent.find('a').click(function () {
364   - $(this).parent().prev().html($(this).text())
  398 + }
  399 + )
  400 + } else
  401 + {
  402 + $(this).removeClass('shadow_')
  403 + $(this).css({height : 29})
  404 + }
  405 + }
  406 + )
365 407  
366   - })
367   - } else {
368   - $(this).removeClass('shadow_')
369   - $(this).css({height:29})
370   - }
371   - })
  408 + }
372 409  
373 410 }
374   -
375   - })
  411 + )
376 412 </script>
377 413 <script>
378   - $('div.rating, div.rating-new').rating({
379   - fx: 'full',
380   - readOnly: 'true',
381   - url: 'rating.php'
382   - });
  414 + $('div.rating, div.rating-new').rating(
  415 + {
  416 + fx : 'full', readOnly : 'true', url : 'rating.php'
  417 + }
  418 + );
383 419 </script>
384 420 \ No newline at end of file
... ...