Commit d26f68b0 authored by Шакарим Сапа's avatar Шакарим Сапа

Merge remote-tracking branch 'origin/master'

parents 33201dc6 1787b0c1
...@@ -51,6 +51,11 @@ class SearchSession extends Session ...@@ -51,6 +51,11 @@ class SearchSession extends Session
$dataProvider = new ActiveDataProvider([ $dataProvider = new ActiveDataProvider([
'query' => $query, 'query' => $query,
'sort' => [
'defaultOrder' => [
'created_at' => SORT_DESC
]
]
]); ]);
$this->load($params); $this->load($params);
...@@ -61,16 +66,20 @@ class SearchSession extends Session ...@@ -61,16 +66,20 @@ class SearchSession extends Session
return $dataProvider; return $dataProvider;
} }
$query->joinWith('urls'); $query->select(['*', 'urls.time']);
$query->select(['*', new \yii\db\Expression("SUM(".SessionUrl::tableName().".updated_at - ".SessionUrl::tableName().".created_at) as time")]); $queryUrl = SessionUrl::find()
->select('session_id, url, SUM('.SessionUrl::tableName().'.updated_at - '.SessionUrl::tableName().'.created_at) as time')
->andWhere(['url' => $this->blogUrl])
->groupBy('session_id');
$query->leftJoin(['urls' => $queryUrl], 'urls.session_id = id');
// grid filtering conditions // grid filtering conditions
$query->andFilterWhere([ $query->andFilterWhere([
'id' => $this->id, 'id' => $this->id,
'user_id' => $this->user_id, 'user_id' => $this->user_id,
'created_at' => $this->created_at, 'created_at' => $this->created_at
SessionUrl::tableName() . '.url' => $this->blogUrl
]); ]);
$query->andFilterWhere(['like', 'PHPSESSID', $this->PHPSESSID]) $query->andFilterWhere(['like', 'PHPSESSID', $this->PHPSESSID])
......
...@@ -23,16 +23,18 @@ use yii\helpers\Url; ...@@ -23,16 +23,18 @@ use yii\helpers\Url;
<?php foreach ($model->postTags as $tag) : ?> <?php foreach ($model->postTags as $tag) : ?>
<a href="<?=$tag->url;?>"># <?=$tag->name?></a> <a href="<?=$tag->url;?>">#<?=$tag->name?></a>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<div class="article_short_txt"> <div class="article_short_txt">
<?php if($model->preview) : <div class="preview-image">
echo Html::img($model->preview); <?php if($model->preview) :
endif; ?> echo Html::img($model->preview);
endif; ?>
</div>
<?=$model->lang->cutText(650)?> <?=$model->lang->cutText(650)?>
</div> </div>
......
...@@ -30,16 +30,18 @@ use yii\helpers\Url; ...@@ -30,16 +30,18 @@ use yii\helpers\Url;
<?php foreach ($model->postTags as $tag) : ?> <?php foreach ($model->postTags as $tag) : ?>
<a href="<?=$tag->url;?>"># <?=$tag->name?></a> <a href="<?=$tag->url;?>">#<?=$tag->name?></a>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<div class="article_short_txt"> <div class="article_short_txt">
<?php if($model->preview) : <div class="preview-image">
echo Html::img($model->preview); <?php if($model->preview) :
endif; ?> echo Html::img($model->preview);
endif; ?>
</div>
<?=$model->lang->text?> <?=$model->lang->text?>
</div> </div>
......
...@@ -128,4 +128,8 @@ FileUploadBundle::register($this); ...@@ -128,4 +128,8 @@ FileUploadBundle::register($this);
</div> </div>
</footer> </footer>
<div class="up-button-container">
<div class="up-button"></div>
</div>
<?php echo $this->render('block/callback'); ?> <?php echo $this->render('block/callback'); ?>
\ No newline at end of file
...@@ -14,4 +14,8 @@ ...@@ -14,4 +14,8 @@
</div> </div>
</div> </div>
</div> </div>
</footer> </footer>
\ No newline at end of file
<div class="up-button-container">
<div class="up-button"></div>
</div>
\ No newline at end of file
...@@ -31,4 +31,8 @@ ...@@ -31,4 +31,8 @@
</div> </div>
</footer> </footer>
<div class="up-button-container">
<div class="up-button"></div>
</div>
<?php echo $this->render('block/callback'); ?> <?php echo $this->render('block/callback'); ?>
\ No newline at end of file
...@@ -266,9 +266,37 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow ...@@ -266,9 +266,37 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.subsc_blog { .subsc_blog {
margin-top: 50px; margin-top: 50px;
} }
.language-markup { pre code {
font-size: 14px; font-size: 14px;
} }
.article_short_txt ol li {
line-height: 30px;
}
.preview-image {
text-align: center;
}
.up-button {
background: url(../images/up-button.png) no-repeat left top;
width: 56px;
height: 72px;
position: absolute;
left: -80px;
top: 0;
cursor: pointer;
display: none;
}
.up-button:hover {
background-position: right top;
}
.up-button-container {
position: fixed;
width: 970px;
height: 0px;
bottom: 150px;
left: 50%;
margin-left: -485px;
z-index: 2;
}
/* ------------ BLOG MODAL ------------------ */ /* ------------ BLOG MODAL ------------------ */
...@@ -469,6 +497,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow ...@@ -469,6 +497,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.gen_mail_top a.toggle_bottom { .gen_mail_top a.toggle_bottom {
margin-top: 50px; margin-top: 50px;
} }
.article_short_txt iframe {
width: 100%;
}
} }
@media (max-width: 768px) { @media (max-width: 768px) {
...@@ -516,6 +547,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow ...@@ -516,6 +547,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.subsc_form input, .subsc_blog_form input { .subsc_form input, .subsc_blog_form input {
width: 100%; width: 100%;
} }
pre code {
font-size: 12px;
}
} }
@media only screen and (max-width: 479px) and (min-width: 320px) { @media only screen and (max-width: 479px) and (min-width: 320px) {
...@@ -528,4 +562,13 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow ...@@ -528,4 +562,13 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.calk_form .file-upload_block { .calk_form .file-upload_block {
display: none; display: none;
} }
}
@media only screen and (max-width: 479px) {
.article_short_view {
display: none;
}
.article_short_tags {
margin-top: 0;
}
} }
\ No newline at end of file
$(document).ready(function() { $(document).ready(function() {
$(window).scroll(function(){
if($(window).scrollTop() > 700)
{
$('.up-button').show();
}
else
{
$('.up-button').hide();
}
});
$('.up-button').click(function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
});
$("a.toggle_bottom").click(function() { $("a.toggle_bottom").click(function() {
var a = $(this); var a = $(this);
$("html, body").animate({ scrollTop: $(a.attr('href')).position().top - 50 }, "slow"); $("html, body").animate({ scrollTop: $(a.attr('href')).position().top - 50 }, "slow");
......
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