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
22131074
Commit
22131074
authored
Feb 05, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add priority in Content
parent
99ed8e7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
common/modules/content/models/CoContent.php
common/modules/content/models/CoContent.php
+3
-2
common/modules/content/views/content-admin/_form.php
common/modules/content/views/content-admin/_form.php
+2
-0
console/migrations/m160205_104801_add_column_co_content.php
console/migrations/m160205_104801_add_column_co_content.php
+18
-0
No files found.
common/modules/content/models/CoContent.php
View file @
22131074
...
...
@@ -71,7 +71,7 @@ class CoContent extends \common\components\ActiveRecordModel
'loc'
=>
Url
::
to
(
$model
->
url
,
true
),
'lastmod'
=>
date
(
'c'
,
$model
->
updated_at
),
'changefreq'
=>
SitemapBehavior
::
CHANGEFREQ_DAILY
,
'priority'
=>
0.8
'priority'
=>
$model
->
priority
];
}
],
...
...
@@ -95,7 +95,7 @@ class CoContent extends \common\components\ActiveRecordModel
[[
'image'
],
'file'
,
'skipOnEmpty'
=>
true
,
'extensions'
=>
'png, jpg, jpeg, gif'
],
[[
'url'
],
'required'
],
[[
'url'
],
'string'
,
'max'
=>
250
],
[[
'category_id'
],
'safe'
]
[[
'category_id'
,
'priority'
],
'safe'
]
];
}
...
...
@@ -110,6 +110,7 @@ class CoContent extends \common\components\ActiveRecordModel
'url'
=>
Yii
::
t
(
'content'
,
'Url'
),
'name'
=>
Yii
::
t
(
'content'
,
'Name'
),
'image'
=>
'Превью'
,
'priority'
=>
'Приоритет в Sitemap'
,
'title'
=>
Yii
::
t
(
'content'
,
'Title'
),
'text'
=>
Yii
::
t
(
'content'
,
'Content'
),
'active'
=>
Yii
::
t
(
'content'
,
'Active'
),
...
...
common/modules/content/views/content-admin/_form.php
View file @
22131074
...
...
@@ -70,6 +70,8 @@ $blocks = \common\modules\content\models\CoBlocks::find()->all();
'label'
=>
' '
],
false
);
?>
<?=
$form
->
field
(
$model
,
'priority'
)
->
textInput
([
'maxlength'
=>
3
])
->
hint
(
'По умолчанию: 0.8'
)
?>
<?php
if
(
$model
->
preview
)
{
echo
Html
::
img
(
\Yii
::
$app
->
params
[
'frontUrl'
]
.
CoContent
::
PHOTO_FOLDER
.
$model
->
preview
);
...
...
console/migrations/m160205_104801_add_column_co_content.php
0 → 100644
View file @
22131074
<?php
use
yii\db\Schema
;
use
yii\db\Migration
;
class
m160205_104801_add_column_co_content
extends
Migration
{
// Use safeUp/safeDown to run migration code within a transaction
public
function
safeUp
()
{
$this
->
addColumn
(
'co_content'
,
'priority'
,
"FLOAT( 3, 1 ) DEFAULT '0.8' AFTER url"
);
}
public
function
safeDown
()
{
$this
->
dropColumn
(
'co_content'
,
'priority'
);
}
}
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