Commit 01c503c7 authored by Shakarim Sapa's avatar Shakarim Sapa

Merge remote-tracking branch 'origin/master'

parents 22b2f553 dbc8f04e
...@@ -29,10 +29,18 @@ use common\models\MetaTags; ...@@ -29,10 +29,18 @@ use common\models\MetaTags;
*/ */
class CoContent extends \common\components\ActiveRecordModel class CoContent extends \common\components\ActiveRecordModel
{ {
public $image; const CUSTOM_DARK = 'dark';
const CUSTOM_WHITE = 'white';
const PHOTO_FOLDER = '/uploads/content/'; const PHOTO_FOLDER = '/uploads/content/';
public $image;
public static $cutom_list = [
self::CUSTOM_DARK => 'Темный',
self::CUSTOM_WHITE => 'Светлый',
];
/** /**
* @inheritdoc * @inheritdoc
*/ */
...@@ -95,7 +103,7 @@ class CoContent extends \common\components\ActiveRecordModel ...@@ -95,7 +103,7 @@ class CoContent extends \common\components\ActiveRecordModel
[['image'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'], [['image'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'],
[['url'], 'required'], [['url'], 'required'],
[['url'], 'string', 'max' => 250], [['url'], 'string', 'max' => 250],
[['category_id', 'priority'], 'safe'], [['category_id', 'priority', 'custom'], 'safe'],
[['priority'], 'double'] [['priority'], 'double']
]; ];
} }
...@@ -111,6 +119,7 @@ class CoContent extends \common\components\ActiveRecordModel ...@@ -111,6 +119,7 @@ class CoContent extends \common\components\ActiveRecordModel
'url' => Yii::t('content', 'Url'), 'url' => Yii::t('content', 'Url'),
'name' => Yii::t('content', 'Name'), 'name' => Yii::t('content', 'Name'),
'image' => 'Превью', 'image' => 'Превью',
'custom' => 'Заголовок',
'priority' => 'Приоритет в Sitemap', 'priority' => 'Приоритет в Sitemap',
'title' => Yii::t('content', 'Title'), 'title' => Yii::t('content', 'Title'),
'text' => Yii::t('content', 'Content'), 'text' => Yii::t('content', 'Content'),
......
...@@ -72,6 +72,10 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all(); ...@@ -72,6 +72,10 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
<?= $form->field($model, 'priority')->textInput(['maxlength' => 3])->hint('По умолчанию: 0.8') ?> <?= $form->field($model, 'priority')->textInput(['maxlength' => 3])->hint('По умолчанию: 0.8') ?>
<?= $form->field($model, 'custom')->dropDownList(CoContent::$cutom_list, [
'class' => 'form-control',
]) ?>
<?php if($model->preview) <?php if($model->preview)
{ {
echo Html::img(\Yii::$app->params['frontUrl'] . CoContent::PHOTO_FOLDER . $model->preview); echo Html::img(\Yii::$app->params['frontUrl'] . CoContent::PHOTO_FOLDER . $model->preview);
......
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160208_123717_add_column_co_content extends Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
$this->addColumn('co_content', 'custom', Schema::TYPE_STRING . '(20) DEFAULT NULL');
}
public function safeDown()
{
$this->dropColumn('co_content', 'custom');
}
}
...@@ -14,7 +14,7 @@ $models = CoContent::find() ...@@ -14,7 +14,7 @@ $models = CoContent::find()
<div class="col-md-6 col-xs-6 col-sm-12"> <div class="col-md-6 col-xs-6 col-sm-12">
<div class="keys_block_small"> <div class="keys_block_small">
<img src="<?=CoContent::PHOTO_FOLDER . $model->preview?>" height="338" width="455"> <img src="<?=CoContent::PHOTO_FOLDER . $model->preview?>" height="338" width="455">
<div class="keys_small_title"><?=$model->lang->title?></div> <div class="keys_small_title" <?if($model->custom==CoContent::CUSTOM_WHITE){?>style="color:#fff;"<?}?>><?=$model->lang->title?></div>
<div class="keys_small_foot"> <div class="keys_small_foot">
<?=Html::a('<span>Подробнее</span>', ['/'.$model->url], ['class' => 'keys_small_btn_more'])?> <?=Html::a('<span>Подробнее</span>', ['/'.$model->url], ['class' => 'keys_small_btn_more'])?>
<!-- <a href="#" class="keys_small_tags"># Big data</a> --> <!-- <a href="#" class="keys_small_tags"># Big data</a> -->
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
border: 1px solid #E9A2A2; border: 1px solid #E9A2A2;
} }
/* EAuth widget */ /* EAuth widget */
.eauth-service-id-vk .eauth-service-link:before { .eauth-list .eauth-service-id-vk .eauth-service-link:before {
background-position: 0 -136px; background-position: 0 -136px;
} }
.eauth-service-id-google .eauth-service-link:before { .eauth-list .eauth-service-id-google .eauth-service-link:before {
background-position: 0 -34px; background-position: 0 -34px;
} }
.eauth-service { .eauth-service {
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
margin: 0 !important; margin: 0 !important;
margin-top: 10px !important; margin-top: 10px !important;
} }
.eauth-list .eauth-service-link:before, .eauth-service-link:after {
background: url("/images/auth.png") 0 0 no-repeat;
}
section .container ul:not([class]), section .container ul:not([class]),
section .container ul:not([class]) li, section .container ul:not([class]) li,
section .container ol:not([class]), section .container ol:not([class]),
......
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