#1004 - Добавить кейсы

parent 21a3db2a
...@@ -33,7 +33,7 @@ class PageController extends \common\components\BaseController ...@@ -33,7 +33,7 @@ class PageController extends \common\components\BaseController
$model = CoContent::findOne(['url' => $page]); $model = CoContent::findOne(['url' => $page]);
} }
$content = $model->lang->content; $content = $model->lang->getFinishedContent();
$this->meta_title = $model->metaTag->title . ' - ' . \Yii::$app->params['name']; $this->meta_title = $model->metaTag->title . ' - ' . \Yii::$app->params['name'];
$this->meta_description = $model->metaTag->description; $this->meta_description = $model->metaTag->description;
$this->meta_keywords = $model->metaTag->keywords; $this->meta_keywords = $model->metaTag->keywords;
......
...@@ -94,8 +94,8 @@ class CoBlocks extends \common\components\ActiveRecordModel ...@@ -94,8 +94,8 @@ class CoBlocks extends \common\components\ActiveRecordModel
return $model->lang->text; return $model->lang->text;
} }
public static function printStaticBlock($block, $addPath = false) public static function printStaticBlock($block, $params = [])
{ {
return Yii::$app->getView()->render( '@app/views/layouts/block/' . $block . '.php'); return Yii::$app->getView()->render( '@app/views/layouts/block/' . $block . '.php', $params);
} }
} }
...@@ -92,9 +92,17 @@ class CoContentLang extends \common\components\ActiveRecordModel ...@@ -92,9 +92,17 @@ class CoContentLang extends \common\components\ActiveRecordModel
} }
/** /**
* @return html * @return \yii\db\ActiveQuery
*/ */
public function getContent() public function getContent()
{
return $this->hasOne(CoContent::className(), ['id' => 'content_id']);
}
/**
* @return html
*/
public function getFinishedContent()
{ {
$content = $this->text; $content = $this->text;
$content = \common\components\AppManager::prepareWidget($content); $content = \common\components\AppManager::prepareWidget($content);
...@@ -118,17 +126,19 @@ class CoContentLang extends \common\components\ActiveRecordModel ...@@ -118,17 +126,19 @@ class CoContentLang extends \common\components\ActiveRecordModel
} }
$arrWhatReplaceNext[] = '[about-reviews]'; $arrWhatReplaceNext[] = '[about-reviews]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('about-reviews', true); $arrReplaceNext[] = CoBlocks::printStaticBlock('about-reviews');
$arrWhatReplaceNext[] = '[reviews]'; $arrWhatReplaceNext[] = '[reviews]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('reviews', true); $arrReplaceNext[] = CoBlocks::printStaticBlock('reviews');
$arrWhatReplaceNext[] = '[content-phone]'; $arrWhatReplaceNext[] = '[content-phone]';
$arrReplaceNext[] = \common\models\Settings::getValue('content-phone'); $arrReplaceNext[] = \common\models\Settings::getValue('content-phone');
$arrWhatReplaceNext[] = '[cases]'; $arrWhatReplaceNext[] = '[cases]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('cases', true); $arrReplaceNext[] = CoBlocks::printStaticBlock('cases');
$arrWhatReplaceNext[] = '[projects]'; $arrWhatReplaceNext[] = '[projects]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('projects', true); $arrReplaceNext[] = CoBlocks::printStaticBlock('projects');
$arrWhatReplaceNext[] = '[case-subscribe]'; $arrWhatReplaceNext[] = '[case-subscribe]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('case-subscribe', true); $arrReplaceNext[] = CoBlocks::printStaticBlock('case-subscribe');
$arrWhatReplaceNext[] = '[case-more]';
$arrReplaceNext[] = CoBlocks::printStaticBlock('case-more', ['model' => $this->content]);
$arrWhatReplaceNext[] = '[footer]'; $arrWhatReplaceNext[] = '[footer]';
$arrReplaceNext[] = \Yii::$app->getView()->render('@app/views/layouts/footer'); $arrReplaceNext[] = \Yii::$app->getView()->render('@app/views/layouts/footer');
$arrWhatReplaceNext[] = '[footer-index]'; $arrWhatReplaceNext[] = '[footer-index]';
......
...@@ -4,6 +4,6 @@ use \yii\helpers\Html; ...@@ -4,6 +4,6 @@ use \yii\helpers\Html;
?> ?>
<div class="col-sm-5 col-md-4"> <div class="col-sm-5 col-md-4">
<?php echo \common\modules\content\models\CoBlocks::printStaticBlock( 'faq-form', true);?> <?php echo \common\modules\content\models\CoBlocks::printStaticBlock( 'faq-form' );?>
</div><!-- /col-sm-5 col-md-4 --> </div><!-- /col-sm-5 col-md-4 -->
\ No newline at end of file
...@@ -107,7 +107,7 @@ class SiteController extends BaseController ...@@ -107,7 +107,7 @@ class SiteController extends BaseController
{ {
$model = \common\modules\content\models\CoContent::findOne(['url' => 'site/error']); $model = \common\modules\content\models\CoContent::findOne(['url' => 'site/error']);
$content = $model->lang->content; $content = $model->lang->getFinishedContent();
$this->meta_title = $model->metaTag->title . ' - ' . \Yii::$app->params['name']; $this->meta_title = $model->metaTag->title . ' - ' . \Yii::$app->params['name'];
$this->meta_description = $model->metaTag->description; $this->meta_description = $model->metaTag->description;
$this->meta_keywords = $model->metaTag->keywords; $this->meta_keywords = $model->metaTag->keywords;
......
<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use yii\helpers\Url;
use common\modules\content\models\CoContent;
use common\modules\bids\models\Bid;
$more = CoContent::find()
->where([
'category_id' => 4,
'active' => true
])
->andWhere(['!=', 'id', $model->id])
->orderBy('RAND()')
->one();
?>
<section class="short_keys_sect">
<div class="container">
<div class="row">
<div class="col-md-12 col-xs-12 col-sm-12">
<h2 class="short_keys_title">Посмотрите еще один<br/> короткий кейс</h2>
</div>
</div>
<div class="row">
<?php if($more) : ?>
<div class="col-md-6 col-xs-6 col-sm-12">
<div class="short_keys_block">
<img src="<?=$model->preview?>" height="338" width="455">
<a href="<?=Url::to([$more->url]);?>" style="color:<?if($model->custom==CoContent::CUSTOM_WHITE){?>#fff<?}else{?>#2d3642<?}?>;" class="short_keys_title_link"><?=$more->lang->title?></a>
<div class="short_keys_foot">
<a href="<?=Url::to([$more->url]);?>" class="short_keys_btn_more"><span>Подробнее</span></a>
<!-- <a href="#" class="short_keys_tags"># Big data</a> -->
</div>
</div>
</div>
<?php endif; ?>
<div class="col-md-6 col-xs-6 col-sm-12">
<div class="subsc_block">
<h2 class="subsc_block_title">Подписаться на обновление</h2>
<div class="subsc_block_txt">Нам будет приятно, если вы захотите подписаться на обновление наших проектов</div>
<?php
$model = new Bid;
$model->scenario = Bid::SCENARIO_SUBSCRIBE;
$form = ActiveForm::begin([
'action' => '/',
'options' => [
'class' => 'subsc_form bids-form',
],
]); ?>
<?php echo Html::hiddenInput('scenario', $model->scenario, ['class' => 'not_clear']); ?>
<?php echo Html::hiddenInput('Bid[form]', Bid::FORM_SUBSCRIBE, ['class' => 'not_clear']); ?>
<?php echo $form->field($model, 'email', [
'template' => '<div class="row"><div class="col-sm-4">{input}</div></div>',
'errorOptions' => []
])->textInput([
'placeholder' => 'E-mail*'
]); ?>
<?php echo Html::submitButton('Подписаться', ['class' => 'save-button']); ?>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
</section>
\ No newline at end of file
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
margin: 0; margin: 0;
} }
.has-error input { .has-error input {
background: #fff url(../images/icon-fail.png) no-repeat 96% center; background: #fff url(../images/icon-fail.png) no-repeat 96% center !important;
border: 1px solid #E9A2A2; border: 1px solid #E9A2A2 !important;
} }
/* EAuth widget */ /* EAuth widget */
.eauth-list .eauth-service-id-vk .eauth-service-link:before { .eauth-list .eauth-service-id-vk .eauth-service-link:before {
...@@ -57,3 +57,18 @@ a.login_form_link, a.login_form_popup_link, a.reg_popup_link, a.reg_form_link{ ...@@ -57,3 +57,18 @@ a.login_form_link, a.login_form_popup_link, a.reg_popup_link, a.reg_form_link{
.sh_ft .popup_text, .reg_form .popup_text{ .sh_ft .popup_text, .reg_form .popup_text{
margin-top: 10px; margin-top: 10px;
} }
.subsc_form input {
display: block;
width: 273px;
height: 49px;
background: #FDFDFD;
border: 1px solid #E9E9E9;
padding: 0 10px;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-o-border-radius: 10px;
-ms-border-radius: 10px;
font-size: 16px;
color: #83999e;
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment