FEATURE: hide comments when article does not allow them
This commit is contained in:
@@ -101,6 +101,11 @@ class ArticleList extends Handler
|
||||
$articles = $articles->orderBy('created_at', 'DESC')
|
||||
->paginate(20);
|
||||
|
||||
// decode module settings
|
||||
foreach ($articles as $article) {
|
||||
$article->module_settings = json_decode($article->module_settings);
|
||||
}
|
||||
|
||||
return Controller::VisitorsView($content->template, [
|
||||
'page' => $content,
|
||||
'articles' => $articles,
|
||||
|
||||
+17
-45
@@ -1844,28 +1844,6 @@ h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 40em) {
|
||||
|
||||
h1 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.9375rem;
|
||||
}
|
||||
h4 {
|
||||
font-size: 1.5625rem;
|
||||
}
|
||||
h5 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
a:hover,a:focus {
|
||||
color: #779000;
|
||||
text-decoration: underline;
|
||||
@@ -7689,29 +7667,6 @@ article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,secti
|
||||
}
|
||||
|
||||
|
||||
@media screen and (min-width: 40em) {
|
||||
|
||||
h1 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
h3 {
|
||||
font-size: 1.9375rem;
|
||||
}
|
||||
h4 {
|
||||
font-size: 1.5625rem;
|
||||
}
|
||||
h5 {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
h6 {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media screen and (min-width: 40em) {
|
||||
|
||||
.medium-text-left {
|
||||
@@ -9305,3 +9260,20 @@ article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,secti
|
||||
padding: 0;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
article h1 {
|
||||
font-size: 2em;
|
||||
}
|
||||
article h2 {
|
||||
margin-top: 20px;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
article h3 {
|
||||
margin-top: 20px;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.comment aside {
|
||||
line-height: 1;
|
||||
}
|
||||
@@ -17,22 +17,26 @@
|
||||
<small>{{$page->author->name}}</small>
|
||||
</div>
|
||||
|
||||
@if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0)
|
||||
<div class="m-t-25 text-center">
|
||||
<a href="#comments"><i class="fa fa-comments"></i> {{$page->comments->count()}}</a>
|
||||
</div>
|
||||
@endif
|
||||
</aside>
|
||||
<div class="column large-11">
|
||||
<article class="text-justify">
|
||||
<h1>{{$page->title}}</h1>
|
||||
|
||||
<article class="text-justify">
|
||||
{!! $page->content !!}
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
@if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0)
|
||||
<div class="row m-t-50">
|
||||
<a name="comments"></a>
|
||||
|
||||
<h3>Komentáře</h3>
|
||||
|
||||
<h2>Komentáře</h2>
|
||||
@foreach($page->comments as $comment)
|
||||
|
||||
<div class="row comment">
|
||||
@@ -96,7 +100,7 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@endsection
|
||||
@@ -37,11 +37,13 @@
|
||||
<a href="{{route('page.content', ['url' => $article->url])}}">více</a>
|
||||
</article>
|
||||
|
||||
@if(isset($article->module_settings->allowComments) && $article->module_settings->allowComments != 0)
|
||||
<footer class="text-right">
|
||||
<a href="{{route('page.content', ['url' => $article->url])}}#comments">
|
||||
<i class="fa fa-fw fa-comments"></i> {{$article->comments->count()}}
|
||||
</a>
|
||||
</footer>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user