Commit 147ec2fb7c1be60fa8d2988e328112471b0e44bb
1 parent
18b65d7d
add speakers part
Showing
12 changed files
with
253 additions
and
101 deletions
Show diff stats
backend/controllers/SpeakerController.php
| @@ -75,6 +75,10 @@ | @@ -75,6 +75,10 @@ | ||
| 75 | 'name' => 'body', | 75 | 'name' => 'body', |
| 76 | 'type' => Form::WYSIWYG, | 76 | 'type' => Form::WYSIWYG, |
| 77 | ], | 77 | ], |
| 78 | + [ | ||
| 79 | + 'name' => 'text1', | ||
| 80 | + 'type' => Form::WYSIWYG, | ||
| 81 | + ], | ||
| 78 | ], | 82 | ], |
| 79 | 'fields' => [ | 83 | 'fields' => [ |
| 80 | [ | 84 | [ |
| @@ -136,6 +140,10 @@ | @@ -136,6 +140,10 @@ | ||
| 136 | 'name' => 'position', | 140 | 'name' => 'position', |
| 137 | 'type' => Form::TEXTAREA, | 141 | 'type' => Form::TEXTAREA, |
| 138 | ], | 142 | ], |
| 143 | + [ | ||
| 144 | + 'name' => 'text1', | ||
| 145 | + 'type' => Form::WYSIWYG, | ||
| 146 | + ], | ||
| 139 | [ | 147 | [ |
| 140 | 'name' => 'organization', | 148 | 'name' => 'organization', |
| 141 | 'type' => Form::TEXTAREA, | 149 | 'type' => Form::TEXTAREA, |
common/models/speaker/Speaker.php
| @@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||
| 17 | * @property integer $sort | 17 | * @property integer $sort |
| 18 | * @property boolean $status | 18 | * @property boolean $status |
| 19 | * @property Image $image | 19 | * @property Image $image |
| 20 | + * @property string $text1 | ||
| 20 | * @method ActiveQuery hasDefaultVariationRelation(); | 21 | * @method ActiveQuery hasDefaultVariationRelation(); |
| 21 | */ | 22 | */ |
| 22 | class Speaker extends ActiveRecord | 23 | class Speaker extends ActiveRecord |
| @@ -31,6 +32,7 @@ | @@ -31,6 +32,7 @@ | ||
| 31 | ], | 32 | ], |
| 32 | 'integer', | 33 | 'integer', |
| 33 | ], | 34 | ], |
| 35 | + | ||
| 34 | [ | 36 | [ |
| 35 | [ | 37 | [ |
| 36 | 'status', | 38 | 'status', |
| @@ -107,9 +109,10 @@ | @@ -107,9 +109,10 @@ | ||
| 107 | public function attributeLabels() | 109 | public function attributeLabels() |
| 108 | { | 110 | { |
| 109 | return [ | 111 | return [ |
| 110 | - 'sort' => \Yii::t('core', 'Sort'), | ||
| 111 | - 'status' => \Yii::t('core', 'Status'), | ||
| 112 | - 'image_id' => \Yii::t('core', 'Image'), | 112 | + 'sort' => \Yii::t('core', 'Sort'), |
| 113 | + 'status' => \Yii::t('core', 'Status'), | ||
| 114 | + 'image_id' => \Yii::t('core', 'Image'), | ||
| 115 | + | ||
| 113 | ]; | 116 | ]; |
| 114 | } | 117 | } |
| 115 | } | 118 | } |
| 116 | \ No newline at end of file | 119 | \ No newline at end of file |
common/models/speaker/SpeakerLang.php
| @@ -32,6 +32,7 @@ | @@ -32,6 +32,7 @@ | ||
| 32 | 'name', | 32 | 'name', |
| 33 | 'organization', | 33 | 'organization', |
| 34 | 'position', | 34 | 'position', |
| 35 | + 'text1' | ||
| 35 | ], | 36 | ], |
| 36 | 'string', | 37 | 'string', |
| 37 | ], | 38 | ], |
| @@ -56,6 +57,9 @@ | @@ -56,6 +57,9 @@ | ||
| 56 | 'name' => \Yii::t('app', 'Speaker Name'), | 57 | 'name' => \Yii::t('app', 'Speaker Name'), |
| 57 | 'organization' => \Yii::t('app', 'Organization'), | 58 | 'organization' => \Yii::t('app', 'Organization'), |
| 58 | 'position' => \Yii::t('app', 'Position'), | 59 | 'position' => \Yii::t('app', 'Position'), |
| 60 | + 'text1' => \Yii::t('app','text1'), | ||
| 61 | + | ||
| 62 | + | ||
| 59 | ]; | 63 | ]; |
| 60 | } | 64 | } |
| 61 | } | 65 | } |
| 62 | \ No newline at end of file | 66 | \ No newline at end of file |
console/migrations/m181022_120253_speaker_lang_add_column_text1.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +use yii\db\Migration; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * Class m181022_120253_speaker_lang_add_column_text1 | ||
| 7 | + */ | ||
| 8 | +class m181022_120253_speaker_lang_add_column_text1 extends Migration | ||
| 9 | +{ | ||
| 10 | + public function up() | ||
| 11 | + { | ||
| 12 | + $this->addColumn( | ||
| 13 | + 'speaker_lang', | ||
| 14 | + 'text1', | ||
| 15 | + $this->text() | ||
| 16 | + ); | ||
| 17 | + | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + public function down() | ||
| 21 | + { | ||
| 22 | + | ||
| 23 | + $this->dropColumn('speaker_lang','text1'); | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | +} |
frontend/components/UrlManager.php
| @@ -79,7 +79,9 @@ | @@ -79,7 +79,9 @@ | ||
| 79 | ] | 79 | ] |
| 80 | ) | 80 | ) |
| 81 | ->one(); | 81 | ->one(); |
| 82 | + | ||
| 82 | $links[ $this->languages->getCurrent()->id ] = $request->url; | 83 | $links[ $this->languages->getCurrent()->id ] = $request->url; |
| 84 | + | ||
| 83 | if ($alias !== NULL) { | 85 | if ($alias !== NULL) { |
| 84 | 86 | ||
| 85 | $other = Alias::find() | 87 | $other = Alias::find() |
| @@ -97,10 +99,12 @@ | @@ -97,10 +99,12 @@ | ||
| 97 | /** | 99 | /** |
| 98 | * @var Alias $item | 100 | * @var Alias $item |
| 99 | */ | 101 | */ |
| 102 | + | ||
| 100 | if ($item->language->default) { | 103 | if ($item->language->default) { |
| 101 | if ($this->hideDefaultLanguagePrefix) { | 104 | if ($this->hideDefaultLanguagePrefix) { |
| 102 | $links[ $item->language->id ] = '/' . $item->value; | 105 | $links[ $item->language->id ] = '/' . $item->value; |
| 103 | } else { | 106 | } else { |
| 107 | + | ||
| 104 | $links[ $item->language->id ] = '/' . $item->language->url . '/' . $item->value; | 108 | $links[ $item->language->id ] = '/' . $item->language->url . '/' . $item->value; |
| 105 | } | 109 | } |
| 106 | } | 110 | } |
| @@ -126,15 +130,21 @@ | @@ -126,15 +130,21 @@ | ||
| 126 | $params, | 130 | $params, |
| 127 | ]; | 131 | ]; |
| 128 | } | 132 | } |
| 133 | + $langs = ['/ru/','/ua/','/fr/','/en/']; | ||
| 129 | foreach ($this->languages->getActive() as $key => $lang) { | 134 | foreach ($this->languages->getActive() as $key => $lang) { |
| 130 | - if ($this->hideDefaultLanguagePrefix and $lang->default) { | ||
| 131 | - $links[ $lang->id ] = '/' . $request->pathInfo; | 135 | + $url12 = str_replace($langs,'',$request->url); |
| 136 | + if ($this->hideDefaultLanguagePrefix and $lang->default) { | ||
| 137 | + | ||
| 138 | + $links[ $lang->id ] = '/' . $url12; | ||
| 132 | } else { | 139 | } else { |
| 133 | - $links[ $lang->id ] = '/' . $key . '/' . $request->pathInfo; | 140 | + $links[ $lang->id ] = '/' . $key . '/' . $url12; |
| 134 | } | 141 | } |
| 135 | 142 | ||
| 136 | } | 143 | } |
| 137 | $langLink = \Yii::$app->get('langLinks'); | 144 | $langLink = \Yii::$app->get('langLinks'); |
| 145 | + $links = array_map(function ($links){ | ||
| 146 | + return str_replace('//','/',$links); | ||
| 147 | + },$links); | ||
| 138 | $langLink->setLinks($links); | 148 | $langLink->setLinks($links); |
| 139 | return parent::parseRequest($request); | 149 | return parent::parseRequest($request); |
| 140 | } | 150 | } |
frontend/controllers/SiteController.php
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
| 12 | use yii\swiftmailer\Mailer; | 12 | use yii\swiftmailer\Mailer; |
| 13 | use yii\web\BadRequestHttpException; | 13 | use yii\web\BadRequestHttpException; |
| 14 | use yii\web\Controller; | 14 | use yii\web\Controller; |
| 15 | + use yii\web\NotFoundHttpException; | ||
| 15 | use yii\web\Response; | 16 | use yii\web\Response; |
| 16 | use yii\web\UploadedFile; | 17 | use yii\web\UploadedFile; |
| 17 | 18 | ||
| @@ -101,8 +102,33 @@ | @@ -101,8 +102,33 @@ | ||
| 101 | 102 | ||
| 102 | 103 | ||
| 103 | 104 | ||
| 104 | - public function actionSpeakers(){ | ||
| 105 | - return $this->render('speakers'); | 105 | + public function actionSpeakers($id){ |
| 106 | + | ||
| 107 | + | ||
| 108 | + $currentSpeaker = Speaker::findOne($id); | ||
| 109 | + if($currentSpeaker == null){ | ||
| 110 | + throw new NotFoundHttpException(); | ||
| 111 | + } | ||
| 112 | + $speakers = Speaker::find() | ||
| 113 | + ->with( | ||
| 114 | + [ | ||
| 115 | + 'language', | ||
| 116 | + 'image', | ||
| 117 | + ] | ||
| 118 | + ) | ||
| 119 | + ->where([ 'status' => true ]) | ||
| 120 | + ->orderBy('sort') | ||
| 121 | + ->all(); | ||
| 122 | + $partners = Logo::find() | ||
| 123 | + ->all(); | ||
| 124 | + return $this->render( | ||
| 125 | + 'speakers', | ||
| 126 | + [ | ||
| 127 | + 'speakers' => $speakers, | ||
| 128 | + 'partners' => $partners, | ||
| 129 | + 'currentSpeaker' => $currentSpeaker, | ||
| 130 | + ] | ||
| 131 | + ); | ||
| 106 | } | 132 | } |
| 107 | 133 | ||
| 108 | 134 |
frontend/views/site/index.php
| @@ -7,6 +7,23 @@ | @@ -7,6 +7,23 @@ | ||
| 7 | use artbox\core\helpers\ImageHelper; | 7 | use artbox\core\helpers\ImageHelper; |
| 8 | use artbox\core\helpers\Url; | 8 | use artbox\core\helpers\Url; |
| 9 | use frontend\assets\SliderAsset; | 9 | use frontend\assets\SliderAsset; |
| 10 | + use frontend\widgets\SpeakersWidget; | ||
| 11 | + | ||
| 12 | + | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + | ||
| 25 | + | ||
| 26 | + | ||
| 10 | $currentLang=\artbox\core\models\Language::getCurrent()->url; | 27 | $currentLang=\artbox\core\models\Language::getCurrent()->url; |
| 11 | SliderAsset::register($this); | 28 | SliderAsset::register($this); |
| 12 | ?> | 29 | ?> |
| @@ -53,45 +70,11 @@ | @@ -53,45 +70,11 @@ | ||
| 53 | </div> | 70 | </div> |
| 54 | </div> | 71 | </div> |
| 55 | </section> | 72 | </section> |
| 56 | -<?php if (!empty($speakers)){?> | ||
| 57 | -<section class="section-speakers"> | ||
| 58 | - <div class="container"> | ||
| 59 | - <div class="row"> | ||
| 60 | - <div class="col-xs-12"><div class="speakers-title"> | ||
| 61 | - <?=\Yii::t('app', 'Speakers')?></div></div> | ||
| 62 | - </div> | ||
| 63 | - | ||
| 64 | - <div class="row"> | ||
| 65 | - <div class="col-xs-12 col-sm-12"> | ||
| 66 | - <div class="slider-home sliders row owl-carousel"> | ||
| 67 | - <?php foreach ($speakers as $speaker){?> | ||
| 68 | - <div class="col-xs-12 col-sm-4 col-md-3 items-home-col"> | ||
| 69 | - <div class="items-home"> | ||
| 70 | - <div class="items-home-img"> | ||
| 71 | - <!--263x210--> | ||
| 72 | - <span><img src="<?=ImageHelper::set($speaker->image->getPath()) | ||
| 73 | - ->cropResize(263, 210) | ||
| 74 | - ->render()?>" alt=""> | ||
| 75 | - </span> | ||
| 76 | - </div> | ||
| 77 | - <div class="items-home-name"><?=$speaker->language->name?></div> | ||
| 78 | - <div class="items-home-job"><?=$speaker->language->position?></div> | ||
| 79 | - <div class="items-home-country-wr"> | ||
| 80 | - <div class="items-home-country"> | ||
| 81 | - <span> | ||
| 82 | - <?=$speaker->language->organization?> | ||
| 83 | - </span> | ||
| 84 | - </div> | ||
| 85 | - </div> | ||
| 86 | - </div> | ||
| 87 | - </div> | ||
| 88 | - <?php } ?> | ||
| 89 | - </div> | ||
| 90 | - </div> | ||
| 91 | - </div> | ||
| 92 | - </div> | ||
| 93 | -</section> | ||
| 94 | -<?php } ?> | 73 | +<?php if (!empty($speakers)){ |
| 74 | + echo SpeakersWidget::widget([ | ||
| 75 | + 'speakers' => $speakers, | ||
| 76 | + ]); | ||
| 77 | +} ?> | ||
| 95 | 78 | ||
| 96 | 79 | ||
| 97 | 80 | ||
| @@ -185,13 +168,13 @@ | @@ -185,13 +168,13 @@ | ||
| 185 | </div> | 168 | </div> |
| 186 | </div> | 169 | </div> |
| 187 | 170 | ||
| 188 | - <div class="partners-wr col-xs-3 col-sm-2"> | 171 | + <!-- <div class="partners-wr col-xs-3 col-sm-2"> |
| 189 | <div> | 172 | <div> |
| 190 | <span> | 173 | <span> |
| 191 | <img src="/images/partners/img-34.jpg" alt=""> | 174 | <img src="/images/partners/img-34.jpg" alt=""> |
| 192 | </span> | 175 | </span> |
| 193 | </div> | 176 | </div> |
| 194 | - </div> | 177 | + </div>--> |
| 195 | 178 | ||
| 196 | <div class="partners-wr col-xs-3 col-sm-2"> | 179 | <div class="partners-wr col-xs-3 col-sm-2"> |
| 197 | <div> | 180 | <div> |
frontend/views/site/speakers.php
| 1 | -<section class="section-breadcrumb"> | 1 | +<?php |
| 2 | +/** | ||
| 3 | + * @var $this yii\web\View | ||
| 4 | + * @var $speakers \common\models\speaker\Speaker[] | ||
| 5 | + * @var $parthners \common\models\Logo[] | ||
| 6 | + * @var $currentSpeaker \common\models\speaker\Speaker | ||
| 7 | + */ | ||
| 8 | + | ||
| 9 | + | ||
| 10 | + | ||
| 11 | + | ||
| 12 | +use artbox\core\helpers\ImageHelper; | ||
| 13 | +use artbox\core\helpers\Url; | ||
| 14 | +use frontend\assets\SliderAsset; | ||
| 15 | +use frontend\widgets\SpeakersWidget; | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + | ||
| 19 | +$this->params[ 'breadcrumbs' ][] = \Yii::t('app','Speakers'); | ||
| 20 | +$this->params[ 'breadcrumbs' ][] = $currentSpeaker->language->name; | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + | ||
| 25 | +?> | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + | ||
| 29 | +<!--<section class="section-breadcrumb"> | ||
| 2 | <div class="container"> | 30 | <div class="container"> |
| 3 | <div class="row"> | 31 | <div class="row"> |
| 4 | <div class="col-xs-12 col-sm-12 breadcrumb-wrapp"> | 32 | <div class="col-xs-12 col-sm-12 breadcrumb-wrapp"> |
| 5 | <ul class="breadcrumb"> | 33 | <ul class="breadcrumb"> |
| 6 | <li><a href="/">Главная</a></li> | 34 | <li><a href="/">Главная</a></li> |
| 7 | <li><a href="/">Спікери</a></li> | 35 | <li><a href="/">Спікери</a></li> |
| 8 | - <li class="active">Наталія Бойко</li> | 36 | + <li class="active"><?/*=$currentSpeaker->language->name*/?></li> |
| 9 | </ul> | 37 | </ul> |
| 10 | </div> | 38 | </div> |
| 11 | </div> | 39 | </div> |
| 12 | </div> | 40 | </div> |
| 13 | -</section> | 41 | +</section>--> |
| 14 | 42 | ||
| 15 | <section class="section-speakers-page"> | 43 | <section class="section-speakers-page"> |
| 16 | <div class="container"> | 44 | <div class="container"> |
| 17 | <div class="row"> | 45 | <div class="row"> |
| 18 | <div class="col-xs-12 col-sm-4 col-md-3 speakers-page-img"> | 46 | <div class="col-xs-12 col-sm-4 col-md-3 speakers-page-img"> |
| 19 | - <img src="/images/speakers/speakers-3-page.jpg" alt=""> | 47 | + <img src="<?=ImageHelper::set($currentSpeaker->image->getPath()) |
| 48 | + ->render()?>" alt=""> | ||
| 20 | </div> | 49 | </div> |
| 21 | <div class="col-xs-12 col-sm-8 col-md-9"> | 50 | <div class="col-xs-12 col-sm-8 col-md-9"> |
| 22 | - <div class="speakers-page-name">Наталія Бойко</div> | ||
| 23 | - <div class="speakers-page-specialty">Заступник міністра енергетики і вугільної промисловості</div> | ||
| 24 | - <div class="speakers-page-country">Україна</div> | 51 | + <div class="speakers-page-name"><?=$currentSpeaker->language->name?></div> |
| 52 | + <div class="speakers-page-specialty"><?=$currentSpeaker->language->position?></div> | ||
| 53 | + <div class="speakers-page-country"><?=$currentSpeaker->language->organization?></div> | ||
| 25 | <div class="speakers-page-txt"> | 54 | <div class="speakers-page-txt"> |
| 26 | - <p>Кабінет Міністрів України утворив Організаційний комітет з підготовки та проведення в Україні восени 2018 року 9-го Міжнародного форуму з енергетики для сталого розвитку. Його очолив Віце-прем’єр-міністр України Володимир Кістіон. Відповідне рішення прийнято 13 грудня на засіданні Уряду.</p> | ||
| 27 | - <p>Форум проходитиме під егідою Європейської Економічної Комісії Організації Об’єднаних Націй.</p> | ||
| 28 | - <p>Міжнародні форуми з енергетики в інтересах сталого розвитку є щорічними заходами, що організовуються п’ятьма Регіональними комісіями ООН з 2010 року. Такі заходи є важливим елементом для поліпшення розуміння сталої енергетики та дієвою платформою для широкого політичного діалогу з метою досягнення Цілей сталого розвитку ООН у майбутньому.</p> | ||
| 29 | - <p>Кабінет Міністрів України утворив Організаційний комітет з підготовки та проведення в Україні восени 2018 року 9-го Міжнародного форуму з енергетики для сталого розвитку. Його очолив Віце-прем’єр-міністр України Володимир Кістіон. Відповідне рішення прийнято 13 грудня на засіданні Уряду.</p> | ||
| 30 | - <p>Форум проходитиме під егідою Європейської Економічної Комісії Організації Об’єднаних Націй.</p> | ||
| 31 | - <p>Міжнародні форуми з енергетики в інтересах сталого розвитку є щорічними заходами, що організовуються п’ятьма Регіональними комісіями ООН з 2010 року. Такі заходи є важливим елементом для поліпшення розуміння сталої енергетики та дієвою платформою для широкого політичного діалогу з метою досягнення Цілей сталого розвитку ООН у майбутньому.</p> | 55 | + <?=$currentSpeaker->language->text1?> |
| 32 | </div> | 56 | </div> |
| 33 | </div> | 57 | </div> |
| 34 | </div> | 58 | </div> |
| @@ -36,45 +60,15 @@ | @@ -36,45 +60,15 @@ | ||
| 36 | </section> | 60 | </section> |
| 37 | 61 | ||
| 38 | 62 | ||
| 39 | -<?php if (!empty($speakers)){?> | ||
| 40 | - <section class="section-speakers"> | ||
| 41 | - <div class="container"> | ||
| 42 | - <div class="row"> | ||
| 43 | - <div class="col-xs-12"><div class="speakers-title"> | ||
| 44 | - <?=\Yii::t('app', 'Speakers')?></div></div> | ||
| 45 | - </div> | ||
| 46 | 63 | ||
| 47 | - <div class="row"> | ||
| 48 | - <div class="col-xs-12 col-sm-12"> | ||
| 49 | - <div class="slider-home sliders row owl-carousel"> | ||
| 50 | - <?php foreach ($speakers as $speaker){?> | ||
| 51 | - <div class="col-xs-12 col-sm-4 col-md-3 items-home-col"> | ||
| 52 | - <div class="items-home"> | ||
| 53 | - <div class="items-home-img"> | ||
| 54 | - <!--263x210--> | ||
| 55 | - <span><img src="<?=ImageHelper::set($speaker->image->getPath()) | ||
| 56 | - ->cropResize(263, 210) | ||
| 57 | - ->render()?>" alt=""> | ||
| 58 | - </span> | ||
| 59 | - </div> | ||
| 60 | - <div class="items-home-name"><?=$speaker->language->name?></div> | ||
| 61 | - <div class="items-home-job"><?=$speaker->language->position?></div> | ||
| 62 | - <div class="items-home-country-wr"> | ||
| 63 | - <div class="items-home-country"> | ||
| 64 | - <span> | ||
| 65 | - <?=$speaker->language->organization?> | ||
| 66 | - </span> | ||
| 67 | - </div> | ||
| 68 | - </div> | ||
| 69 | - </div> | ||
| 70 | - </div> | ||
| 71 | - <?php } ?> | ||
| 72 | - </div> | ||
| 73 | - </div> | ||
| 74 | - </div> | ||
| 75 | - </div> | ||
| 76 | - </section> | ||
| 77 | -<?php } ?> | 64 | +<?php if (!empty($speakers)){ |
| 65 | + echo SpeakersWidget::widget([ | ||
| 66 | + 'speakers' => $speakers | ||
| 67 | + ]); | ||
| 68 | +} ?> | ||
| 69 | + | ||
| 70 | + | ||
| 71 | + | ||
| 78 | <section class="section-partners"> | 72 | <section class="section-partners"> |
| 79 | <div class="container"> | 73 | <div class="container"> |
| 80 | <div class="row" style="margin-top: -20px;"> | 74 | <div class="row" style="margin-top: -20px;"> |
| @@ -34,10 +34,13 @@ $(document).ready(function () { | @@ -34,10 +34,13 @@ $(document).ready(function () { | ||
| 34 | items: 4, | 34 | items: 4, |
| 35 | slideBy: 1, | 35 | slideBy: 1, |
| 36 | 36 | ||
| 37 | + | ||
| 37 | } | 38 | } |
| 38 | }, | 39 | }, |
| 40 | + dotsEach:1, | ||
| 39 | smartSpeed:250, | 41 | smartSpeed:250, |
| 40 | nav:true, | 42 | nav:true, |
| 43 | + autoplay:true, | ||
| 41 | navText:[], | 44 | navText:[], |
| 42 | loop:true, | 45 | loop:true, |
| 43 | 46 |
frontend/widgets/LangLinks.php
| @@ -31,15 +31,18 @@ | @@ -31,15 +31,18 @@ | ||
| 31 | { | 31 | { |
| 32 | $items = []; | 32 | $items = []; |
| 33 | $langs = Language::getActive(); | 33 | $langs = Language::getActive(); |
| 34 | - | 34 | + |
| 35 | foreach ($langs as $key => $item) { | 35 | foreach ($langs as $key => $item) { |
| 36 | + | ||
| 36 | if ($item->id == Language::getCurrent()->id) { | 37 | if ($item->id == Language::getCurrent()->id) { |
| 37 | $items[ $key ] = Html::tag('li', Html::a(($this->mobile ? $item->short : $item->name), '', ['class' => 'active'])); | 38 | $items[ $key ] = Html::tag('li', Html::a(($this->mobile ? $item->short : $item->name), '', ['class' => 'active'])); |
| 38 | } else { | 39 | } else { |
| 40 | + | ||
| 39 | $items[ $key ] = Html::tag('li', Html::a(($this->mobile ? $item->short : $item->name), $this->links[ $key ])); | 41 | $items[ $key ] = Html::tag('li', Html::a(($this->mobile ? $item->short : $item->name), $this->links[ $key ])); |
| 40 | } | 42 | } |
| 41 | 43 | ||
| 42 | } | 44 | } |
| 45 | + | ||
| 43 | if ($this->mobile){ | 46 | if ($this->mobile){ |
| 44 | return $this->render('links_mobile', [ 'links' => $items ]); | 47 | return $this->render('links_mobile', [ 'links' => $items ]); |
| 45 | } | 48 | } |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * Виджет, который выводит grid карточки спикеров | ||
| 4 | + */ | ||
| 5 | +namespace frontend\widgets; | ||
| 6 | + | ||
| 7 | + | ||
| 8 | +use yii\base\Widget; | ||
| 9 | + | ||
| 10 | + | ||
| 11 | + | ||
| 12 | + | ||
| 13 | +class SpeakersWidget extends Widget{ | ||
| 14 | + | ||
| 15 | + public $speakers; | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + public function init() | ||
| 19 | + { | ||
| 20 | + parent::init(); | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + | ||
| 24 | + public function run() | ||
| 25 | + { | ||
| 26 | + | ||
| 27 | + return $this->render('_speakers',[ | ||
| 28 | + 'speakerList' =>$this->speakers | ||
| 29 | + ]); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + | ||
| 33 | +} | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @var $speakerList \common\models\speaker\Speaker[] | ||
| 4 | + * | ||
| 5 | + */ | ||
| 6 | +use artbox\core\helpers\ImageHelper; | ||
| 7 | +use artbox\core\helpers\Url; | ||
| 8 | +?> | ||
| 9 | + | ||
| 10 | + | ||
| 11 | + <section class="section-speakers"> | ||
| 12 | + <div class="container"> | ||
| 13 | + <div class="row"> | ||
| 14 | + <div class="col-xs-12"><div class="speakers-title"> | ||
| 15 | + <?=\Yii::t('app', 'Speakers')?></div></div> | ||
| 16 | +</div> | ||
| 17 | + | ||
| 18 | +<div class="row"> | ||
| 19 | + <div class="col-xs-12 col-sm-12"> | ||
| 20 | + <div class="slider-home sliders row owl-carousel"> | ||
| 21 | + | ||
| 22 | + <?php foreach ($speakerList as $speaker){?> | ||
| 23 | + <div class="col-xs-12 col-sm-4 col-md-3 items-home-col"> | ||
| 24 | + <div class="items-home"> | ||
| 25 | + <div class="items-home-img"> | ||
| 26 | + <!--263x210--> | ||
| 27 | + <span><img src="<?=ImageHelper::set($speaker->image->getPath()) | ||
| 28 | + ->cropResize(263, 210) | ||
| 29 | + ->render()?>" alt=""> | ||
| 30 | + </span> | ||
| 31 | + </div> | ||
| 32 | + <div class="items-home-name"> | ||
| 33 | + <?=\yii\helpers\Html::a($speaker->language->name, | ||
| 34 | + Url::to(['site/speakers', | ||
| 35 | + 'id'=>$speaker->id | ||
| 36 | + ]) | ||
| 37 | + )?> | ||
| 38 | + </div> | ||
| 39 | + <div class="items-home-job"><?=$speaker->language->position?></div> | ||
| 40 | + <div class="items-home-country-wr"> | ||
| 41 | + <div class="items-home-country"> | ||
| 42 | + <span> | ||
| 43 | + <?=$speaker->language->organization?> | ||
| 44 | + </span> | ||
| 45 | + </div> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + <?php } ?> | ||
| 50 | + </div> | ||
| 51 | + </div> | ||
| 52 | +</div> | ||
| 53 | +</div> | ||
| 54 | +</section> | ||
| 0 | \ No newline at end of file | 55 | \ No newline at end of file |