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

Merge remote-tracking branch 'origin/master'

parents 33201dc6 1787b0c1
......@@ -51,6 +51,11 @@ class SearchSession extends Session
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => [
'defaultOrder' => [
'created_at' => SORT_DESC
]
]
]);
$this->load($params);
......@@ -61,16 +66,20 @@ class SearchSession extends Session
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
$query->andFilterWhere([
'id' => $this->id,
'user_id' => $this->user_id,
'created_at' => $this->created_at,
SessionUrl::tableName() . '.url' => $this->blogUrl
'created_at' => $this->created_at
]);
$query->andFilterWhere(['like', 'PHPSESSID', $this->PHPSESSID])
......
......@@ -23,16 +23,18 @@ use yii\helpers\Url;
<?php foreach ($model->postTags as $tag) : ?>
<a href="<?=$tag->url;?>"># <?=$tag->name?></a>
<a href="<?=$tag->url;?>">#<?=$tag->name?></a>
<?php endforeach; ?>
</div>
<div class="article_short_txt">
<div class="preview-image">
<?php if($model->preview) :
echo Html::img($model->preview);
endif; ?>
</div>
<?=$model->lang->cutText(650)?>
</div>
......
......@@ -30,16 +30,18 @@ use yii\helpers\Url;
<?php foreach ($model->postTags as $tag) : ?>
<a href="<?=$tag->url;?>"># <?=$tag->name?></a>
<a href="<?=$tag->url;?>">#<?=$tag->name?></a>
<?php endforeach; ?>
</div>
<div class="article_short_txt">
<div class="preview-image">
<?php if($model->preview) :
echo Html::img($model->preview);
endif; ?>
</div>
<?=$model->lang->text?>
</div>
......
......@@ -128,4 +128,8 @@ FileUploadBundle::register($this);
</div>
</footer>
<div class="up-button-container">
<div class="up-button"></div>
</div>
<?php echo $this->render('block/callback'); ?>
\ No newline at end of file
......@@ -15,3 +15,7 @@
</div>
</div>
</footer>
<div class="up-button-container">
<div class="up-button"></div>
</div>
\ No newline at end of file
......@@ -31,4 +31,8 @@
</div>
</footer>
<div class="up-button-container">
<div class="up-button"></div>
</div>
<?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
.subsc_blog {
margin-top: 50px;
}
.language-markup {
pre code {
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 ------------------ */
......@@ -469,6 +497,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.gen_mail_top a.toggle_bottom {
margin-top: 50px;
}
.article_short_txt iframe {
width: 100%;
}
}
@media (max-width: 768px) {
......@@ -516,6 +547,9 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
.subsc_form input, .subsc_blog_form input {
width: 100%;
}
pre code {
font-size: 12px;
}
}
@media only screen and (max-width: 479px) and (min-width: 320px) {
......@@ -529,3 +563,12 @@ a.toggle_bottom:hover .icon-arrowDown2:after, a.toggle_bottom:active .icon-arrow
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() {
$(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() {
var a = $(this);
$("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