From ce82b67c470a206beb6cb77c7a855082ff40ab73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Tue, 4 Oct 2016 12:58:42 +0200 Subject: [PATCH] FEATURE: hide comments when article does not allow them --- .../Blog/ArticleList/Handlers/ArticleList.php | 5 + .../Binarity/Resources/assets/css/app.css | 62 +++------ .../modules/article/visitor/default.blade.php | 130 +++++++++--------- .../articlelist/visitor/default.blade.php | 16 ++- 4 files changed, 98 insertions(+), 115 deletions(-) diff --git a/modules/Blog/ArticleList/Handlers/ArticleList.php b/modules/Blog/ArticleList/Handlers/ArticleList.php index 11ea43c9..b1bfd0d8 100644 --- a/modules/Blog/ArticleList/Handlers/ArticleList.php +++ b/modules/Blog/ArticleList/Handlers/ArticleList.php @@ -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, diff --git a/templates/Binarity/Resources/assets/css/app.css b/templates/Binarity/Resources/assets/css/app.css index da947565..f3270e16 100644 --- a/templates/Binarity/Resources/assets/css/app.css +++ b/templates/Binarity/Resources/assets/css/app.css @@ -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 { @@ -9304,4 +9259,21 @@ article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,secti font-weight: bold; font-size: 120%; 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; } \ No newline at end of file diff --git a/templates/Binarity/Resources/views/modules/article/visitor/default.blade.php b/templates/Binarity/Resources/views/modules/article/visitor/default.blade.php index fddf8858..df4ec9b3 100644 --- a/templates/Binarity/Resources/views/modules/article/visitor/default.blade.php +++ b/templates/Binarity/Resources/views/modules/article/visitor/default.blade.php @@ -17,86 +17,90 @@ {{$page->author->name}} -
- {{$page->comments->count()}} -
+ @if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0) +
+ {{$page->comments->count()}} +
+ @endif
-

{{$page->title}}

-
+

{{$page->title}}

+ {!! $page->content !!}
-
- + @if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0) +
+ -

Komentáře

- @foreach($page->comments as $comment) -
- -
-
- -
{{$comment->author->name}}
-
-
- {{$comment->content}} -
-
-
-
- @endforeach +

Komentáře

+ @foreach($page->comments as $comment) - -
-
- @if($loggedUser) - - @endif -
-
- @if(session('success')) -
- Komentář úspěšně uložen. @if (!$loggedUser) Po schválení se zde objeví. @endif +
+ +
+
+ +
{{$comment->author->name}}
+
+
+ {{$comment->content}} +
- @endif +
+
+ @endforeach -
- {!! csrf_field() !!} - - @if(!$loggedUser) -
-
- -
-
- -
+ +
+
+ @if($loggedUser) + + @endif +
+
+ @if(session('success')) +
+ Komentář úspěšně uložen. @if (!$loggedUser) Po schválení se zde objeví. @endif
@endif -
-
- + + {!! csrf_field() !!} - + @if(!$loggedUser) +
+
+ +
+
+ +
+
+ @endif + +
+
+ + + +
-
- + +
+ @endif +
- - -
@endsection \ No newline at end of file diff --git a/templates/Binarity/Resources/views/modules/articlelist/visitor/default.blade.php b/templates/Binarity/Resources/views/modules/articlelist/visitor/default.blade.php index 6de1c415..17b9595a 100644 --- a/templates/Binarity/Resources/views/modules/articlelist/visitor/default.blade.php +++ b/templates/Binarity/Resources/views/modules/articlelist/visitor/default.blade.php @@ -6,7 +6,7 @@ {{--

{{$page->title}}

--}} {{--
--}} - {{--{!! $page->content !!}--}} + {{--{!! $page->content !!}--}} {{--
--}} @foreach($articles as $article) @@ -14,7 +14,7 @@