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
be422623
Commit
be422623
authored
Feb 05, 2016
by
Shakarim Sapa
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
8d9d76a7
8cc6cb12
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
21 deletions
+45
-21
common/models/Settings.php
common/models/Settings.php
+1
-1
common/modules/content/models/CoContent.php
common/modules/content/models/CoContent.php
+6
-4
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
frontend/views/layouts/block/social.php
frontend/views/layouts/block/social.php
+12
-0
frontend/views/layouts/footer-index.php
frontend/views/layouts/footer-index.php
+3
-8
frontend/views/layouts/footer.php
frontend/views/layouts/footer.php
+3
-8
No files found.
common/models/Settings.php
View file @
be422623
...
...
@@ -36,7 +36,7 @@ class Settings extends \common\components\ActiveRecordModel
public
function
rules
()
{
return
[
[[
'module_id'
,
'code'
,
'name'
,
'value'
,
'element'
,
'description'
],
'required'
],
[[
'module_id'
,
'code'
,
'name'
,
/*'value',*/
'element'
,
/*'description'*/
],
'required'
],
[[
'value'
,
'element'
],
'string'
],
[[
'hidden'
],
'integer'
],
[[
'module_id'
,
'code'
],
'string'
,
'max'
=>
50
],
...
...
common/modules/content/models/CoContent.php
View file @
be422623
...
...
@@ -8,6 +8,7 @@ use himiklab\sitemap\behaviors\SitemapBehavior;
use
\yii\helpers\Url
;
use
common\modules\content\models\CoBlocks
;
use
common\modules\content\models\CoContentLang
;
use
common\modules\languages\models\Languages
;
use
common\models\MetaTags
;
...
...
@@ -62,16 +63,15 @@ class CoContent extends \common\components\ActiveRecordModel
'class'
=>
SitemapBehavior
::
className
(),
'scope'
=>
function
(
$model
)
{
/** @var \yii\db\ActiveQuery $model */
$model
->
select
([
'url'
,
'updated_at'
]);
$model
->
select
([
'url'
,
'updated_at'
,
'priority'
]);
// $model->andWhere(['is_deleted' => 0]);
},
'dataClosure'
=>
function
(
$model
)
{
/** @var self $model */
return
[
'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,8 @@ 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'
],
[[
'priority'
],
'double'
]
];
}
...
...
@@ -110,6 +111,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 @
be422623
...
...
@@ -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 @
be422623
<?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'
);
}
}
frontend/views/layouts/block/social.php
0 → 100644
View file @
be422623
<?php
use
common\models\Settings
;
?>
<ul
class=
"social_link"
>
<?php
$s
=
Settings
::
getValue
(
'social-link-vk'
);
if
(
$s
)
:
?>
<li><a
href=
"
<?=
$s
?>
"
class=
"soc_item"
><i
class=
"fa fa-vk"
></i></a></li>
<?
endif
;
?>
<?php
$s
=
Settings
::
getValue
(
'social-link-fb'
);
if
(
$s
)
:
?>
<li><a
href=
"
<?=
$s
?>
"
class=
"soc_item"
><i
class=
"fbicon"
></i></a></li>
<?
endif
;
?>
<?php
$s
=
Settings
::
getValue
(
'social-link-youtube'
);
if
(
$s
)
:
?>
<li><a
href=
"
<?=
$s
?>
"
class=
"soc_item"
><i
class=
"fa fa-youtube"
></i></a></li>
<?
endif
;
?>
<?php
$s
=
Settings
::
getValue
(
'social-link-instagram'
);
if
(
$s
)
:
?>
<li><a
href=
"
<?=
$s
?>
"
class=
"soc_item"
><i
class=
"fa fa-instagram"
></i></a></li>
<?
endif
;
?>
<?php
$s
=
Settings
::
getValue
(
'social-link-twitter'
);
if
(
$s
)
:
?>
<li><a
href=
"
<?=
$s
?>
"
class=
"soc_item"
><i
class=
"fa fa-twitter"
></i></a></li>
<?
endif
;
?>
<?php
$s
=
Settings
::
getValue
(
'social-link-google'
);
if
(
$s
)
:
?>
<li><a
href=
"
<?=
$s
?>
"
class=
"soc_item"
><i
class=
"gplusicon"
></i></a></li>
<?
endif
;
?>
</ul>
\ No newline at end of file
frontend/views/layouts/footer-index.php
View file @
be422623
...
...
@@ -100,14 +100,9 @@ use common\modules\bids\models\Bid;
</div>
</div>
<div
class=
"col-md-6 col-xs-6 col-sm-12"
>
<ul
class=
"social_link"
>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fa fa-vk"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fbicon"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fa fa-youtube"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fa fa-instagram"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fa fa-twitter"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"gplusicon"
></i></a></li>
</ul>
<?php
echo
$this
->
render
(
'block/social'
);
?>
</div>
<div
class=
"col-md-3 col-xs-3 col-sm-12"
>
<div
class=
"taskon"
><img
src=
"/images/taskon.png"
height=
"31"
width=
"100"
alt=
""
></div>
...
...
frontend/views/layouts/footer.php
View file @
be422623
...
...
@@ -18,14 +18,9 @@
</div>
</div>
<div
class=
"col-md-6 col-xs-6 col-sm-12"
>
<ul
class=
"social_link"
>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fa fa-vk"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fbicon"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fa fa-youtube"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fa fa-instagram"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"fa fa-twitter"
></i></a></li>
<li><a
href=
"#"
class=
"soc_item"
><i
class=
"gplusicon"
></i></a></li>
</ul>
<?php
echo
$this
->
render
(
'block/social'
);
?>
</div>
<div
class=
"col-md-3 col-xs-3 col-sm-12"
>
<div
class=
"taskon"
><img
src=
"/images/taskon.png"
height=
"31"
width=
"100"
alt=
""
></div>
...
...
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