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
d911bcd6
Commit
d911bcd6
authored
Mar 16, 2016
by
Шакарим Сапа
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
a6f0711e
d4f6ae9c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
137 additions
and
6 deletions
+137
-6
common/modules/content/controllers/PageController.php
common/modules/content/controllers/PageController.php
+4
-1
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
common/modules/content/views/page/view.php
common/modules/content/views/page/view.php
+19
-3
console/migrations/m160316_114638_upgrade_content.php
console/migrations/m160316_114638_upgrade_content.php
+17
-0
frontend/web/css/custom.css
frontend/web/css/custom.css
+82
-0
No files found.
common/modules/content/controllers/PageController.php
View file @
d911bcd6
...
@@ -41,7 +41,10 @@ class PageController extends \common\components\BaseController
...
@@ -41,7 +41,10 @@ class PageController extends \common\components\BaseController
$this
->
meta_description
=
$model
->
metaTag
->
description
;
$this
->
meta_description
=
$model
->
metaTag
->
description
;
$this
->
meta_keywords
=
$model
->
metaTag
->
keywords
;
$this
->
meta_keywords
=
$model
->
metaTag
->
keywords
;
return
$this
->
render
(
'view'
,
[
'content'
=>
$content
]);
return
$this
->
render
(
'view'
,
[
'content'
=>
$content
,
'model'
=>
$model
]);
}
}
}
}
common/modules/content/models/CoContent.php
View file @
d911bcd6
...
@@ -32,6 +32,9 @@ class CoContent extends \common\components\ActiveRecordModel
...
@@ -32,6 +32,9 @@ class CoContent extends \common\components\ActiveRecordModel
const
CUSTOM_DARK
=
'dark'
;
const
CUSTOM_DARK
=
'dark'
;
const
CUSTOM_WHITE
=
'white'
;
const
CUSTOM_WHITE
=
'white'
;
const
TYPE_SIMPLE
=
0
;
const
TYPE_LANDING
=
1
;
public
$copyLangs
;
public
$copyLangs
;
public
static
$cutom_list
=
[
public
static
$cutom_list
=
[
...
@@ -39,6 +42,11 @@ class CoContent extends \common\components\ActiveRecordModel
...
@@ -39,6 +42,11 @@ class CoContent extends \common\components\ActiveRecordModel
self
::
CUSTOM_WHITE
=>
'Светлый'
,
self
::
CUSTOM_WHITE
=>
'Светлый'
,
];
];
public
static
$type_titles
=
[
self
::
TYPE_SIMPLE
=>
'Простой'
,
self
::
TYPE_LANDING
=>
'Лендинг'
,
];
/**
/**
* @inheritdoc
* @inheritdoc
*/
*/
...
@@ -107,9 +115,9 @@ class CoContent extends \common\components\ActiveRecordModel
...
@@ -107,9 +115,9 @@ class CoContent extends \common\components\ActiveRecordModel
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'active'
],
'integer'
],
[[
'active'
,
'type'
],
'integer'
],
[[
'file'
],
'file'
,
'skipOnEmpty'
=>
true
,
'extensions'
=>
'png, jpg, jpeg, gif'
],
[[
'file'
],
'file'
,
'skipOnEmpty'
=>
true
,
'extensions'
=>
'png, jpg, jpeg, gif'
],
[[
'url'
],
'required'
],
[[
'url'
,
'type'
],
'required'
],
[[
'url'
],
'string'
,
'max'
=>
250
],
[[
'url'
],
'string'
,
'max'
=>
250
],
[[
'category_id'
,
'priority'
,
'custom'
],
'safe'
],
[[
'category_id'
,
'priority'
,
'custom'
],
'safe'
],
[[
'priority'
],
'double'
]
[[
'priority'
],
'double'
]
...
@@ -123,6 +131,7 @@ class CoContent extends \common\components\ActiveRecordModel
...
@@ -123,6 +131,7 @@ class CoContent extends \common\components\ActiveRecordModel
{
{
return
[
return
[
'id'
=>
Yii
::
t
(
'content'
,
'ID'
),
'id'
=>
Yii
::
t
(
'content'
,
'ID'
),
'type'
=>
'Тип страницы'
,
'category_id'
=>
Yii
::
t
(
'content'
,
'Category ID'
),
'category_id'
=>
Yii
::
t
(
'content'
,
'Category ID'
),
'url'
=>
Yii
::
t
(
'content'
,
'Url'
),
'url'
=>
Yii
::
t
(
'content'
,
'Url'
),
'name'
=>
Yii
::
t
(
'content'
,
'Name'
),
'name'
=>
Yii
::
t
(
'content'
,
'Name'
),
...
...
common/modules/content/views/content-admin/_form.php
View file @
d911bcd6
...
@@ -45,6 +45,10 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
...
@@ -45,6 +45,10 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
'class'
=>
'form-control'
,
'class'
=>
'form-control'
,
])
?>
])
?>
<?=
$form
->
field
(
$model
,
'type'
)
->
dropDownList
(
CoContent
::
$type_titles
,
[
'class'
=>
'form-control'
,
])
?>
<?php
if
(
$model
->
preview
)
<?php
if
(
$model
->
preview
)
{
{
echo
Html
::
img
(
\Yii
::
$app
->
params
[
'frontUrl'
]
.
$model
->
preview
);
echo
Html
::
img
(
\Yii
::
$app
->
params
[
'frontUrl'
]
.
$model
->
preview
);
...
...
common/modules/content/views/page/view.php
View file @
d911bcd6
<?php
<?php
/* @var $this yii\web\View */
echo
$content
;
use
common\modules\content\models\CoContent
;
?>
?>
<?php
if
(
$model
->
type
==
CoContent
::
TYPE_SIMPLE
)
:
?>
<section
class=
"simple-section
<?=
(
$model
->
custom
==
CoContent
::
CUSTOM_DARK
?
'dark'
:
''
)
?>
"
>
<div
class=
"container"
>
<?php
endif
;
?>
<?=
$content
;
?>
<?php
if
(
$model
->
type
==
CoContent
::
TYPE_SIMPLE
)
:
?>
</div>
</section>
<?=
$this
->
render
(
'@app/views/layouts/footer'
)
?>
<?php
endif
;
?>
\ No newline at end of file
console/migrations/m160316_114638_upgrade_content.php
0 → 100644
View file @
d911bcd6
<?php
use
yii\db\Schema
;
use
yii\db\Migration
;
class
m160316_114638_upgrade_content
extends
Migration
{
public
function
up
()
{
$this
->
addColumn
(
'co_content'
,
'type'
,
Schema
::
TYPE_INTEGER
.
'(1) NOT NULL DEFAULT 1'
);
}
public
function
down
()
{
$this
->
dropColumn
(
'co_content'
,
'type'
);
}
}
frontend/web/css/custom.css
View file @
d911bcd6
...
@@ -2654,4 +2654,86 @@ width: 95%;
...
@@ -2654,4 +2654,86 @@ width: 95%;
padding-bottom
:
20px
;
padding-bottom
:
20px
;
}
}
}
.simple-section
{
background
:
white
;
color
:
#2d323a
;
padding-top
:
30px
;
padding-bottom
:
30px
;
}
.simple-section
p
{
font-size
:
17px
;
line-height
:
26px
;
color
:
#2d323a
;
}
.simple-section
em
{
font-style
:
italic
;
}
.simple-section
h1
,
.simple-section
h2
,
.simple-section
h3
,
.simple-section
h4
,
.simple-section
h5
,
.simple-section
h6
{
color
:
#444
;
font-family
:
"RobotoBold"
;
margin
:
30px
0
36px
;
text-align
:
left
;
}
.simple-section
h1
{
font-size
:
31px
;
}
.simple-section
h2
{
font-size
:
28px
;
}
.simple-section
h3
{
font-size
:
25px
;
}
.simple-section
h4
{
font-size
:
22px
;
}
.simple-section
h5
{
font-size
:
19px
;
}
.simple-section
h6
{
font-size
:
16px
;
}
.simple-section.dark
{
background
:
url(../images/no_found_bg.jpg)
repeat-y
center
center
;
background-size
:
cover
;
-moz-background-size
:
cover
;
-webkit-background-size
:
cover
;
-o-background-size
:
cover
;
}
.simple-section
ul
{
list-style
:
none
!important
;
margin-top
:
14px
!important
;
}
.simple-section
ul
li
{
background
:
url(../images/how_rosneft_list.png)
no-repeat
left
6px
;
padding-left
:
27px
!important
;
margin-bottom
:
14px
!important
;
font-size
:
21px
;
color
:
#2d323a
;
font-family
:
"RobotoBold"
;
}
.simple-section
ol
{
margin-top
:
14px
!important
;
padding-left
:
47px
!important
;
}
.simple-section
ol
li
{
margin-bottom
:
14px
!important
;
font-size
:
21px
;
color
:
#2d323a
;
font-family
:
"RobotoBold"
;
}
}
\ No newline at end of file
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