Merge branch 'dev' into dobrotyzpece.cz

This commit is contained in:
Michal Kváček
2016-10-09 23:20:13 +02:00
5 changed files with 17 additions and 2 deletions
+1
View File
@@ -62,6 +62,7 @@ class Content extends Model
{
return Content::where('status', '!=', Content::STATUS_DRAFT)
->select('contents.*')
->with('author')
->join('modules', 'modules.handler', '=', 'contents.module_handler')
->where('language', LaravelLocalization::getCurrentLocale())
->where('modules.enabled', true);
@@ -27,6 +27,7 @@ class Article extends Handler implements ContentTitles
$content->comments = [];
if (isset($content->module_settings->allowComments) && $content->module_settings->allowComments) {
$content->comments = Comment::where('content_id', $content->id)
->with('author')
->where('approved', 1)
->orderBy('created_at')
->get();
@@ -70,7 +70,7 @@ class ArticleList extends Handler
->enabled()
) {
$category = Category::where('url', $categoryUrl)
->first();
->firstOrFail();
$subcategories = $category->getChildren()
->toArray();
@@ -17,6 +17,13 @@
<small>{{$page->author->name}}</small>
</div>
@if($page->category)
<div class="m-t-25 text-center">
<a href="./seznam-clanku?category={{$page->category->url}}"><i class="fa fa-tag"></i> {{$page->category->name}}</a>
</div>
@endif
@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>
@@ -37,8 +37,14 @@
<a href="{{route('page.content', ['url' => $article->url])}}">více</a>
</article>
@if(isset($article->module_settings->allowComments) && $article->module_settings->allowComments != 0)
@if(isset($article->module_settings->allowComments) && $article->module_settings->allowComments != 0 || $article->category)
<footer class="text-right">
@if($article->category)
<a href="./seznam-clanku?category={{$article->category->url}}"><i
class="fa fa-tag"></i> {{$article->category->name}}</a>
@endif
<a href="{{route('page.content', ['url' => $article->url])}}#comments">
<i class="fa fa-fw fa-comments"></i> {{$article->comments->count()}}
</a>