Commit 71ad29c4d2449bae325689a8f727488c90e96f3e

Authored by Yarik
1 parent c4b9c0bd

test

common/modules/comment/widgets/views/form-project-comment.php
... ... @@ -14,7 +14,7 @@
14 14 <div class="new-portf-add-comm style">
15 15 <div class="box-wr">
16 16 <div class="box-all">
17   - <div class="tender-add-answer-title"><?= Yii::t('add', 'add_answer') ?></div>
  17 + <div class="tender-add-answer-title"><?= Yii::t('app', 'add_answer') ?></div>
18 18 <div class="form-tender-answer style">
19 19 <?php
20 20 $form = ActiveForm::begin([ 'options' => [ 'class' => 'resformsfile MultiFile-intercepted', 'enctype' => 'multipart/form-data' ] ]);
... ...
frontend/controllers/TenderController.php
... ... @@ -26,6 +26,7 @@
26 26 use common\models\Page;
27 27 use frontend\models\Option;
28 28 use common\models\Social;
  29 + use yii\web\NotFoundHttpException;
29 30  
30 31 /**
31 32 * Site controller
... ... @@ -87,6 +88,8 @@
87 88 $model = Project::findOne($tender_id);
88 89 if(!empty($model)) {
89 90 $model->updateCounters(['view_count' => 1]);
  91 + } else {
  92 + throw new NotFoundHttpException(Yii::t('app', 'project_not_found'));
90 93 }
91 94  
92 95 return $this->render('view', [
... ...
frontend/messages/ru/app.php
... ... @@ -157,5 +157,6 @@
157 157 'add_field' => 'Добавить поле',
158 158 'add_more' => 'Добавить еще',
159 159 'hidden_project' => 'Снять с тендера',
  160 + 'project_not_found' => 'Данный проект не найден',
160 161  
161 162 ];
162 163 \ No newline at end of file
... ...
frontend/views/site/index.php
1 1 <?php
2   -
3   - use common\models\Project;
4   - use common\modules\fileloader\widgets\FileloaderWidget;
5 2 use \yii\helpers\Html;
6 3 use \common\models\Specialization;
7   - use yii\widgets\ActiveForm;
8 4  
9 5 /**
10 6 * @var $this yii\web\View
... ...