Commit 0fd849642972394d357144340060799761130fe1
1 parent
a0821e65
test
Showing
2 changed files
with
51 additions
and
24 deletions
Show diff stats
frontend/views/company/_vacancy_list_view.php
1 | 1 | <?php |
2 | -use frontend\helpers\TextHelper; | |
3 | -use yii\bootstrap\Html; | |
4 | -use yii\helpers\Url; | |
5 | -use yii\i18n\Formatter; | |
2 | + use frontend\helpers\TextHelper; | |
3 | + use yii\bootstrap\Html; | |
4 | + use yii\helpers\Url; | |
5 | + use yii\helpers\StringHelper; | |
6 | 6 | |
7 | 7 | ?> |
8 | 8 | |
9 | 9 | <div class="performer-vacant-reclam-bl"> |
10 | - <?= Html::a($model->name, Url::toRoute( ['company/vacancy-view', 'company_id' => $model->user_id,'link' => $model->link]), ['class' => 'performer-vacant-reclam-bl-title']) ?> | |
11 | - <div class="performer-vacant-reclam-bl-title-two"> <?= $model->city ?> <?= \Yii::$app->formatter->asDatetime($model->date_add, 'Y-MM-dd') ?> <?=$model->salary ?> <?=$model->salaryCurrency->label ?> </div> | |
10 | + <?= Html::a($model->name, Url::toRoute([ | |
11 | + 'company/vacancy-view', | |
12 | + 'company_id' => $model->user_id, | |
13 | + 'link' => $model->link, | |
14 | + ]), [ 'class' => 'performer-vacant-reclam-bl-title' ]) ?> | |
15 | + <div class="performer-vacant-reclam-bl-title-two"> | |
16 | + <?= $model->city ?> | |
17 | + <?= \Yii::$app->formatter->asDatetime($model->date_add, 'Y-MM-dd') ?> | |
18 | + <?php | |
19 | + if(!empty( $model->salary )) { | |
20 | + ?> | |
21 | + <?= $model->salary ?> | |
22 | + <?= $model->salaryCurrency->label ?> | |
23 | + <?php | |
24 | + } | |
25 | + ?> | |
26 | + </div> | |
12 | 27 | <div class="performer-vacant-reclam-bl-content"> |
13 | - <span><?= TextHelper::truncateHtmlText($model->description, 200, '...') ?></span> | |
14 | - <?= Html::a('<img src="/images/performar_vacancy/arrow-post.png" alt=""/>', ['vacancy-view', 'company_id' => $model->user_id,'vacancy_id' => $model->vacancy_id], ['class' => 'performer-vacant-reclam-bl-content-read']) ?> | |
28 | + <span> | |
29 | + <?= StringHelper::truncateWords($model->description, 50, '...', false) ?> | |
30 | + <?php //TextHelper::truncateHtmlText($model->description, 200, '...') ?> | |
31 | + </span> | |
32 | + <?= Html::a('<img src="/images/performar_vacancy/arrow-post.png" alt=""/>', [ | |
33 | + 'company/vacancy-view', | |
34 | + 'company_id' => $model->user_id, | |
35 | + 'link' => $model->link, | |
36 | + ], [ 'class' => 'performer-vacant-reclam-bl-content-read' ]) ?> | |
15 | 37 | |
16 | 38 | </div> |
17 | 39 | </div> |
18 | 40 | \ No newline at end of file | ... | ... |
frontend/views/company/vacancy-view.php
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @var $this yii\web\View | |
4 | - * @var User $company | |
3 | + * @var $this yii\web\View | |
4 | + * @var User $company | |
5 | 5 | * @var Vacancy $vacancy |
6 | 6 | */ |
7 | 7 | |
... | ... | @@ -10,12 +10,15 @@ |
10 | 10 | use yii\helpers\ArrayHelper; |
11 | 11 | use yii\helpers\Html; |
12 | 12 | |
13 | - $this->params[ 'company'] = $company; | |
14 | -$this->title = 'My Yii Application'; | |
13 | + $this->params[ 'company' ] = $company; | |
14 | + $this->title = 'My Yii Application'; | |
15 | 15 | ?> |
16 | 16 | <div class="performer-vacancy-list style"> |
17 | 17 | <?php |
18 | - echo Html::a('к списку вакансий', ['vacancy-list', 'company_id' => $company->id]); | |
18 | + echo Html::a('к списку вакансий', [ | |
19 | + 'vacancy-list', | |
20 | + 'company_id' => $company->id, | |
21 | + ]); | |
19 | 22 | ?> |
20 | 23 | </div> |
21 | 24 | <div class="performer-vacancy-blocks-desk-wr style"> |
... | ... | @@ -24,24 +27,26 @@ $this->title = 'My Yii Application'; |
24 | 27 | <div class="performance-vacancy-page-options style"> |
25 | 28 | <ul> |
26 | 29 | <?php |
27 | - if(!empty($vacancy->user_name)) { | |
28 | - echo "<li><span>Контактное лицо:</span><p>{$vacancy->user_name}</p></li>"; | |
29 | - } | |
30 | + if(!empty( $vacancy->user_name )) { | |
31 | + echo "<li><span>Контактное лицо:</span><p>{$vacancy->user_name}</p></li>"; | |
32 | + } | |
33 | + if(!empty( $vacancy->phone )) { | |
34 | + echo "<li><span>Телефон:</span><p>{$vacancy->phone}</p></li>"; | |
35 | + } | |
30 | 36 | ?> |
31 | - <li><span>Телефон:</span><p>XXX XXX-XX-XX</p></li> | |
32 | 37 | <?php |
33 | - if(!empty($vacancy->city)) { | |
38 | + if(!empty( $vacancy->city )) { | |
34 | 39 | echo "<li><span>Город:</span><p>{$vacancy->city}</p></li>"; |
35 | 40 | } |
36 | 41 | ?> |
37 | 42 | <?php |
38 | - if(!empty($vacancy->employments)) { | |
39 | - echo "<li><span>Вид занятости:</span><p>".implode(', ', ArrayHelper::getColumn($vacancy->employments, 'name'))."</p></li>"; | |
43 | + if(!empty( $vacancy->employments )) { | |
44 | + echo "<li><span>Вид занятости:</span><p>" . implode(', ', ArrayHelper::getColumn($vacancy->employments, 'name')) . "</p></li>"; | |
40 | 45 | } |
41 | 46 | ?> |
42 | 47 | <?php |
43 | - if(!empty($vacancy->requirements)) { | |
44 | - echo "<li><span>Требования:</span><p>".implode(', ', ArrayHelper::getColumn($vacancy->requirements, 'requirements'))."</p></li>"; | |
48 | + if(!empty( $vacancy->requirements )) { | |
49 | + echo "<li><span>Требования:</span><p>" . implode(', ', ArrayHelper::getColumn($vacancy->requirements, 'requirements')) . "</p></li>"; | |
45 | 50 | } |
46 | 51 | ?> |
47 | 52 | </ul> |
... | ... | @@ -49,7 +54,7 @@ $this->title = 'My Yii Application'; |
49 | 54 | <div class="performance-vacancy-description style">Описание вакансии</div> |
50 | 55 | <div class="performance-vacancy-desc-txt style"> |
51 | 56 | <?php |
52 | - echo $vacancy->description; | |
57 | + echo $vacancy->description; | |
53 | 58 | ?> |
54 | 59 | </div> |
55 | 60 | <div class="performance-vacancy-desc-form style"> |
... | ... | @@ -67,7 +72,7 @@ $this->title = 'My Yii Application'; |
67 | 72 | |
68 | 73 | <div class="performance-vacancy-similar-blocks-wr style"> |
69 | 74 | <a href="#" class="performer-vacant-reclam-bl-title">Разнорабочий (в Бровары)</a> |
70 | - <div class="performer-vacant-reclam-bl-title-two">Наш Дом. Киев. </div> | |
75 | + <div class="performer-vacant-reclam-bl-title-two">Наш Дом. Киев.</div> | |
71 | 76 | </div> |
72 | 77 | |
73 | 78 | <div class="performance-vacancy-similar-blocks-wr style"> | ... | ... |