Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
514df8b3
Commit
514df8b3
authored
Feb 08, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#996 - Выбор цвета заголовка
parent
fce17cf5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
3 deletions
+34
-3
common/modules/content/models/CoContent.php
common/modules/content/models/CoContent.php
+11
-2
common/modules/content/views/content-admin/_form.php
common/modules/content/views/content-admin/_form.php
+4
-0
console/migrations/m160208_123717_add_column_co_content.php
console/migrations/m160208_123717_add_column_co_content.php
+18
-0
frontend/views/layouts/block/cases.php
frontend/views/layouts/block/cases.php
+1
-1
No files found.
common/modules/content/models/CoContent.php
View file @
514df8b3
...
@@ -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'
),
...
...
common/modules/content/views/content-admin/_form.php
View file @
514df8b3
...
@@ -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
);
...
...
console/migrations/m160208_123717_add_column_co_content.php
0 → 100644
View file @
514df8b3
<?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'
);
}
}
frontend/views/layouts/block/cases.php
View file @
514df8b3
...
@@ -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> -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment