Commit 3d59117d authored by Ruslan Karimov's avatar Ruslan Karimov

#2425. Доработка вывода подзаголовков

parent a8395929
......@@ -111,8 +111,6 @@ class CaseContent extends CoContent
]);
}
public function afterSave($insert, $changedAttributes)
{
parent::afterSave($insert, $changedAttributes);
......
......@@ -110,11 +110,13 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
$lang_id = $content->lang->id; ?>
<div class="tab-pane fade <?=($c==1?'active in':'')?>" id="lang-<?=$content->lang->url;?>">
<?= $form->field($content, '['.$lang_id.']name')->textInput(['maxlength' => 250])->hint('Название страницы не будет отображаться пользователям сайта и служит исключительно для служебного пользования в Панель управления.'); ?>
<?= $form->field($content, '['.$lang_id.']name')->textInput(['maxlength' => 250])->hint('Название страницы не будет отображаться пользователям сайта и служит исключительно для служебного пользования в Панель управления.')->label('Название') ?>
<?= $form->field($content, '['.$lang_id.']title')->textInput(['maxlength' => 250])->hint('Заголовок страницы виден пользователю сайта и как правило оформляется в тег &lt;h1&gt;. Если дизайном страницы не предусмотрен вывод заголовка, то он не будет выводиться даже если был введен в данное поле.'); ?>
<?= $form->field($content, '['.$lang_id.']title')->textInput(['maxlength' => 250])->hint('Заголовок страницы виден пользователю сайта и как правило оформляется в тег &lt;h1&gt;. Если дизайном страницы не предусмотрен вывод заголовка, то он не будет выводиться даже если был введен в данное поле.')->label('Заголовок') ?>
<?= $form->field($content, '['.$lang_id.']text')->textArea(); ?>
<?= $form->field($content, '['.$lang_id.']subtitle')->textInput(['maxlength' => 250])->hint('Описание отображается под заголовоком на общей странице со списком решений')->label('Подзаголовок') ?>
<?= $form->field($content, '['.$lang_id.']text')->textArea()->label('Текст') ?>
<?= MetaTagsWidget::widget([
'model' => $model->meta[$lang_id],
......
<?php
use yii\db\Migration;
class m181121_122416_add_subtitle_field extends Migration
{
public function up()
{
$this->addColumn('co_content_lang', 'subtitle', $this->string()->comment('Подзаголовок'));
}
public function down()
{
$this->dropColumn('co_content_lang', 'subtitle');
}
}
......@@ -17,6 +17,7 @@ use common\modules\content\models\CoBlocks;
* @property string $name
* @property string $title
* @property string $text
* @property string $subtitle
*
* @property CoContent $content
* @property Languages $lang
......@@ -40,7 +41,7 @@ class CoContentLang extends \common\components\ActiveRecordModel
[['content_id', 'lang_id', 'name', 'title'], 'required'],
[['content_id', 'lang_id'], 'integer'],
[['text'], 'string'],
[['name', 'title'], 'string', 'max' => 250],
[['name', 'title', 'subtitle'], 'string', 'max' => 250],
[['content_id'], 'exist', 'skipOnError' => true, 'targetClass' => CoContent::className(), 'targetAttribute' => ['content_id' => 'id']],
[['lang_id'], 'exist', 'skipOnError' => true, 'targetClass' => Languages::className(), 'targetAttribute' => ['lang_id' => 'id']],
];
......
......@@ -20,9 +20,14 @@ $models = CaseContent::find()
<?php foreach ($models as $model) : ?>
<?php if(!$model->previewType || $model->previewType->type == CasesPreviewType::PREVIEW_SQUARE): ?>
<div class="col-md-6 col-xs-6 col-sm-12">
<a href="<?=Url::to(['/'.$model->url])?>" class="keys_block_small">
<a href="<?=Url::to([$model->url], true)?>" class="keys_block_small">
<img src="<?=$model->preview?>" height="338" width="455">
<div class="keys_small_title" <?php if($model->custom==CoContent::CUSTOM_WHITE){?>style="color:#fff;"<?php }?>><?=$model->lang->title?></div>
<div class="keys_small_title" <?php if($model->custom==CoContent::CUSTOM_WHITE){?>style="color:#fff;"<?php }?>>
<?=$model->lang->title?>
<div class="case_subtitle">
<?=$model->lang->subtitle?>
</div>
</div>
<div class="keys_small_foot">
<div class="keys_small_btn_more">
<span><?=Yii::t('case', 'Read more')?></span>
......@@ -33,12 +38,17 @@ $models = CaseContent::find()
</div>
<?php elseif($model->previewType->type == CasesPreviewType::PREVIEW_RECTANGLE): ?>
<div class="col-md-12 col-xs-12 col-sm-12">
<a href="<?=Url::to(['/'.$model->url])?>" class="keys_block_small big">
<a href="<?=Url::to([$model->url], true)?>" class="keys_block_small big">
<img class="img_lg" src="<?=$model->preview?>" height="338" width="940">
<?php if($model->preview_mob):?>
<img class="img_sm" src="<?=$model->preview_mob?>" height="338" width="455">
<?php endif; ?>
<div class="keys_small_title" <?php if($model->custom==CoContent::CUSTOM_WHITE){?>style="color:#fff;"<?php }?>><?=$model->lang->title?></div>
<div class="keys_small_title" <?php if($model->custom==CoContent::CUSTOM_WHITE){?>style="color:#fff;"<?php }?>>
<?=$model->lang->title?>
<div class="case_subtitle">
<?=$model->lang->subtitle?>
</div>
</div>
<div class="keys_small_foot">
<div class="keys_small_btn_more">
<span><?=Yii::t('case', 'Read more')?></span>
......
......@@ -13685,6 +13685,11 @@ a.appl_btn {
.appl_par.appl_par--without_logo {
background: url(../images/appl_par_w_o_logo.png) no-repeat center center;
}
.case_subtitle {
font-size: 18px;
font-weight: normal;
}
@media only screen and (min-width: 768px) and (max-width: 970px) {
.appl_par {
background-size: cover;
......
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