FEATURE: add template for blog

This commit is contained in:
Michal Kváček
2016-10-04 00:42:20 +02:00
parent de02944d0d
commit 52b0ec7c72
7 changed files with 177 additions and 65 deletions
@@ -3,18 +3,67 @@
@include(\App\Helpers\Template::name('metaInformation'))
@section('content')
<h1 class="text-center uppercase m-b-25">{{$page->title}}</h1>
<div class="row">
{!! $page->content !!}
<div class="row article-list-item">
<aside class="column text-right large-1">
<div class="date">
<span class="date day big">@customDate('j', $page->created_at)</span>
<br>
<span class="date uppercase month">@monthName($page->created_at)</span>
</div>
<div class="m-t-25 author">
<img class="gravatar" src="@gravatar($page->author->email, 50)" alt="">
<br />
<small>{{$page->author->name}}</small>
@forelse($page->comments as $comment)
{{$comment->author}}: {{$comment->content}}
@empty
<div class="callout info">Nic tu neni.</div>
@endforelse
</div>
</aside>
<div class="column large-11">
<h1>{{$page->title}}</h1>
<article class="text-justify">
{!! $page->content !!}
</article>
</div>
</div>
<div class="row m-t-50">
<h3>Komentáře</h3>
@foreach($page->comments as $comment)
<img src="@gravatar($comment->author->email)" alt=""> {{$comment->author->name}}: {{$comment->content}}
@endforeach
@if(session('success'))
<div class="callout succes">
Komentář úspěšně uložen.
</div>
@endif
<form method="post" action="{{route('comments.new', ['id' => $page->id])}}">
{!! csrf_field() !!}
@if($loggedUser)
<img src="@gravatar($loggedUser->email)" alt=""> {{$loggedUser->name}}
@else
<div class="row">
<div class="column medium-6">
<input type="text" name="name" required placeholder="Jméno">
</div>
<div class="column medium-6">
<input type="email" name="email" required placeholder="E-mail">
</div>
</div>
@endif
<div class="row">
<div class="column medium-12">
<textarea name="message" required>{{old('message')}}</textarea>
<button type="submit" class="button success">Uložit</button>
</div>
</div>
</form>
</div>
@@ -10,6 +10,41 @@
</div>
@foreach($articles as $article)
<h2><a href="{{route('page.content', ['url' => $article->url])}}">{{$article->title}}</a></h2>
<div class="column large-6 article-list-item">
<div class="row">
<aside class="column text-right large-3">
<div class="date">
<span class="date day big">@customDate('j', $article->created_at)</span>
<br>
<span class="date uppercase month">@monthName($article->created_at)</span>
</div>
<div class="m-t-25 author">
{{--<small>{{str_limit($article->author->name, 15)}}</small>--}}
<img class="gravatar" src="@gravatar($article->author->email, 35)" alt="">
</div>
</aside>
<header>
<h5>
<a href="{{route('page.content', ['url' => $article->url])}}">
{{$article->title}}
</a>
</h5>
</header>
<article class="p-0 column text-justify large-9">
{{str_limit($article->meta_description, 250)}}
<a href="{{route('page.content', ['url' => $article->url])}}">více</a>
</article>
<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>
</div>
</div>
{{-- <h2><a href="{{route('page.content', ['url' => $article->url])}}">{{$article->title}}</a></h2>--}}
@endforeach
@endsection
@@ -104,7 +104,7 @@
@yield('content')
<footer class="hide-for-large">
<footer id="footer" class="hide-for-large">
<ul class="social-icons menu">
@if (!empty(setting('facebookProfile')))
<li>