FEATURE: move blog module into own repository

This commit is contained in:
Michal Kváček
2017-08-22 14:07:21 +02:00
commit 02bd68543e
49 changed files with 1319 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
"allowComments" => "Povolit komentáře?",
"new" => "Napsat",
"overview" => "Všechny články",
];
+22
View File
@@ -0,0 +1,22 @@
<?php
return [
"approve" => "Schválit komentář a zobrazovat ho u článku",
"approved" => "Komentář úspěšně schválen",
"commentedArticle" => "Komentovaný článek",
"createdAt" => "Vloženo :date",
"deleted" => "Komentář smazán",
"events" => [
"descriptions" => [
"commentApproved" => "Schválen komentář od autora :authro (:email) s následujícím obsahem: :content",
"commentCreated" => "Přidán komentář od autora :author (e-mail :e-mail) s následujícím obsahem: :content",
"commentDeleted" => "Smazán komentář od autora :author (:email) s následujícím obsahem: :content",
],
"names" => [
"commentApproved" => "Komentář schválen",
"commentCreated" => "Komentář úspěšně přidán.",
"commentDeleted" => "Smazán komentář",
],
],
"noComments" => "Nejsou dostupné žádné komentáře",
"unknownArticle" => "Neznámý článek",
];
+12
View File
@@ -0,0 +1,12 @@
<?php
return [
"allArticles" => "Všechny články",
"blog" => "Blog",
"comments" => "Komentáře",
"commentsOverview" => "Všechny komentáře",
"description" => "Základní submodul pro blog. Tento modul umožňuje psát články.",
"editArticle" => "Upravuji článek",
"name" => "Články",
"newArticle" => "Napsat nový článek",
"templatePath" => "Články",
];
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
'allowComments' => 'Allow comments?',
'new' => 'Write new',
'overview' => 'All articles'
];
+22
View File
@@ -0,0 +1,22 @@
<?php
return [
'createdAt' => 'Created at :date',
'commentedArticle' => 'Article',
'approve' => 'Approve comment',
'approved' => 'Comment successfully approved',
'deleted' => 'Comment deleted',
'unknownArticle' => 'Unknown article',
'noComments' => 'No comments available',
'events' => [
'names' => [
'commentCreated' => 'Added comment',
'commentApproved' => 'Approved comment',
'commentDeleted' => 'Deleted comment',
],
'descriptions' => [
'commentCreated' => 'Added comment from author :author with e-mail :email and following content: :content',
'commentApproved' => 'Approved comment from author :author with e-mail :email and following content: :content',
'commentDeleted' => 'Deleted comment from author :author with e-mail :email and following content: :content',
],
]
];
+12
View File
@@ -0,0 +1,12 @@
<?php
return [
'name' => 'Articles',
'description' => 'Base submodule for blog',
'comments' => 'Comments',
'commentsOverview' => 'All comments',
'blog' => 'Blog',
'allArticles' => 'All articles',
'newArticle' => 'Write new article',
'editArticle' => 'Editing article',
'templatePath' => 'Articles',
];
+6
View File
@@ -0,0 +1,6 @@
<?php
return [
"allowComments" => "Povoliť komentáre?",
"new" => " Napísať nový",
"overview" => "Všetky články",
];
+8
View File
@@ -0,0 +1,8 @@
<?php
return [
"approve" => "Schváliť komentár",
"approved" => "Komentár úspešne schválený.",
"commentedArticle" => "Článok",
"createdAt" => "Vytvorené: :date",
"deleted" => "Komentár zmazaný.",
];
+9
View File
@@ -0,0 +1,9 @@
<?php
return [
"allArticles" => "Všetky články",
"blog" => "Blog",
"comments" => "Komentáre",
"commentsOverview" => "Všetky komentáre",
"description" => "Základný submodul pre blog",
"name" => "Články",
];
+56
View File
@@ -0,0 +1,56 @@
@extends('admin.layoutWithNavigation')
@section('pageHeading', trans('article::module.comments'))
@section('content')
@if (count($comments))
@foreach($comments as $comment)
<div class="card @if(!$comment->approved) card-warning @else card-default @endif">
<div class="card-header">
<div class="header-block">
<p class="title">
<img src="@gravatar($comment->email, 25)" class="img-rounded" alt="">
{{$comment->name}} ({{$comment->email}})
</p>
</div>
</div>
<div class="card-block">
<p>
{{$comment->content}}
</p>
</div>
<div class="card-footer">
@lang('article::comments.createdAt', ['date' => \App\CMS\Helpers\Date::date($comment->created_at)])
|
@lang('article::comments.commentedArticle'):
@if(!is_null($comment->article))
<a href="{{route('page.content', ['url' => $comment->article->url])}}" target="_blank">
{{$comment->article->title}}
</a>
@else
@lang('article::comments.unknownArticle')
@endif
<div class="pull-right">
@if (!$comment->approved)
<a href="{{route('comments.approve', ['id' => $comment->id])}}"
class="btn btn-sm btn-success" title="@lang('article::comments.approve')"
data-toggle="tooltip"><i class="fa fa-fw fa-check"></i></a>
@endif
<a href="{{route('comments.delete', ['id' => $comment->id])}}"
class="btn btn-sm confirm btn-warning"><i class="fa fa-fw fa-trash"></i></a>
</div>
</div>
</div>
@endforeach
@else
<div class="alert alert-info">
@lang('article::comments.noComments')
</div>
@endif
@endsection
+89
View File
@@ -0,0 +1,89 @@
<div class="row">
<div class="col-lg-6">
<input type="text" name="title" required class="form-control slug-source"
placeholder="@lang('admin/contents.field_title')"
value="{{old('title', $page->title)}}" />
@include('admin.snippets.hasError', ['field' => 'title'])
</div>
<div class="col-lg-4">
<input type="text" name="url" required class="form-control slug-target"
placeholder="@lang('admin/contents.field_url')"
value="{{old('url', $page->url)}}" />
@include('admin.snippets.hasError', ['field' => 'url'])
</div>
<div class="col-lg-2 text-center">
<label>
<input class="checkbox" value="1" id="lockUrl"
@if(old('lockUrl') || ($page->id > 0 && \Illuminate\Support\Str::slug($page->title) != $page->url)) checked
@endif name="lockUrl" type="checkbox">
<span>@lang('admin/contents.lockUrl')</span>
</label>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<select class="form-control" name="status">
@foreach($contentStatuses as $status => $translation)
<option value="{{$status}}" @if(old('status', $page->status) == $status) selected @endif>
{{$translation}}
</option>
@endforeach
</select>
@include('admin.snippets.hasError', ['field' => 'status'])
</div>
<div class="col-lg-4">
<select class="form-control" name="parentId">
<option value="">@lang('admin/contents.noParentPage')</option>
@foreach($rootPages as $rootPage)
<option value="{{$rootPage->id}}"
@if(old('parentId', $page->parentId) == $rootPage->id) selected @endif>
{{$rootPage->title}}
</option>
@endforeach
</select>
@include('admin.snippets.hasError', ['field' => 'parentPage'])
</div>
<div class="col-lg-2 text-center">
<label>
<input class="checkbox" value="1"
@if(old('allowComments', isset($page->moduleSettings->allowComments) ? $page->moduleSettings->allowComments : true)) checked
@endif name="allowComments" type="checkbox">
<span>@lang('article::article.allowComments')</span>
</label>
</div>
@if($module->support_categories && count($categories))
<div class="col-lg-12">
<select class="form-control" name="categoryId">
<option value="">@lang('admin/contents.noCategory')</option>
@foreach($categories as $category)
<option value="{{$category->id}}"
@if($category->id == old('categoryId', $page->categoryId)) selected @endif>
{{str_repeat(' - ', $category->real_depth)}} {{$category->name}}
</option>
@endforeach
</select>
</div>
@endif
</div>
<div class="row">
<div class="col-lg-12">
<textarea name="pageContent" id="pageContent" class="wysiwyg-editor">
{{old('pageContent', $page->pageContent)}}
</textarea>
</div>
</div>