Merge branch 'binarity.cz' of binarity.cz:/opt/git/internal/cms/minicms into binarity.cz

This commit is contained in:
Michal Kváček
2016-10-10 21:42:03 +02:00
4 changed files with 54 additions and 16 deletions
+8 -2
View File
@@ -2,6 +2,9 @@
namespace App\Helpers; namespace App\Helpers;
use App\Models\Module; use App\Models\Module;
use DebugBar\Bridge\MonologCollector;
use Illuminate\Database\QueryException;
use Monolog\Logger;
class CurrentTemplate class CurrentTemplate
{ {
@@ -10,16 +13,19 @@ class CurrentTemplate
/** /**
* Getter for currently set template * Getter for currently set template
*
* @return Module * @return Module
* @throws \ErrorException
*/ */
public static function get() public static function get()
{ {
if (!self::$initialized) { if (!self::$initialized) {
try {
self::$template = Module::where('is_template', true) self::$template = Module::where('is_template', true)
->where('enabled', true) ->where('enabled', true)
->first(); ->first();
} catch (QueryException $e) {
throw new \ErrorException('DB not migrated, please, do so!');
}
if (self::$template) { if (self::$template) {
self::$template->module_settings = json_decode(self::$template->module_settings); self::$template->module_settings = json_decode(self::$template->module_settings);
} }
+38 -4
View File
@@ -5355,9 +5355,15 @@ table.hover tr:nth-of-type(even):hover {
.m-0 { .m-0 {
margin: 0 !important; margin: 0 !important;
} }
.m-t-5 {
margin-top: 5px;
}
.m-t-25 { .m-t-25 {
margin-top: 25px; margin-top: 25px;
} }
.m-t-35 {
margin-top: 35px;
}
.m-t-50 { .m-t-50 {
margin-top: 50px; margin-top: 50px;
} }
@@ -9237,13 +9243,24 @@ article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,secti
.article-list-item .date.big { .article-list-item .date.big {
font-size: 4em; font-size: 5em;
line-height: 1em; line-height: 1em;
font-weight: 500;
color: #414042;
}
.article-list-item .date.month {
top: -15px;
position: relative;
right: 3px;
color: #414042;
} }
.gravatar { .gravatar {
border-radius: 50%; border-radius: 50%;
} }
.author .gravatar {
width: 40px;
}
.article-list-item .author { .article-list-item .author {
line-height: 1; line-height: 1;
@@ -9262,18 +9279,35 @@ article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,secti
} }
article h1 { article h1 {
font-size: 2em; font-size: 1.9em;
font-weight: 700;
} }
article h2 { article h2 {
margin-top: 20px; margin-top: 20px;
font-size: 1.5em; font-size: 1.35em;
color: #414042;
} }
article h3 { article h3 {
margin-top: 20px; margin-top: 20px;
font-size: 1.2em; font-size: 1.15em;
color: #414042;
}
.off-canvas-content .article-list-item div {
color: #414042;
} }
.comment aside { .comment aside {
line-height: 1; line-height: 1;
} }
.comments-form textarea {
margin-bottom: 3px;
}
.comments-form .gravatar {
width: 50px;
float: right;
padding: 0;
margin: 0;
}
@@ -8,12 +8,10 @@
<aside class="column text-right large-1"> <aside class="column text-right large-1">
<div class="date"> <div class="date">
<span class="date day big">@customDate('j', $page->published_from ?: $page->created_at)</span> <span class="date day big">@customDate('j', $page->published_from ?: $page->created_at)</span>
<br>
<span class="date uppercase month">@monthName($page->published_from ?: $page->created_at)</span> <span class="date uppercase month">@monthName($page->published_from ?: $page->created_at)</span>
</div> </div>
<div class="m-t-25 author"> <div class="m-t-25 author">
<img class="gravatar" src="@gravatar($page->author->email, 50)" alt=""> <img class="gravatar" src="@gravatar($page->author->email, 50)" alt="">
<br />
<small>{{$page->author->name}}</small> <small>{{$page->author->name}}</small>
</div> </div>
@@ -25,8 +23,8 @@
@if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0) @if(isset($page->module_settings->allowComments) && $page->module_settings->allowComments != 0)
<div class="m-t-25 text-center"> <div class="m-t-35">
<a href="#comments"><i class="fa fa-comments"></i> {{$page->comments->count()}}</a> <a href="#comments">{{$page->comments->count()}} <i class="fa fa-comments"></i></a>
</div> </div>
@endif @endif
</aside> </aside>
@@ -43,7 +41,7 @@
<a name="comments"></a> <a name="comments"></a>
<h2>Komentáře</h2> <h2 class="column large-11" style="float: right;">Komentáře</h2>
@foreach($page->comments as $comment) @foreach($page->comments as $comment)
<div class="row m-t-25 comment"> <div class="row m-t-25 comment">
@@ -70,7 +68,7 @@
<?php <?php
$loggedUser = \Auth::user(); $loggedUser = \Auth::user();
?> ?>
<div class="row m-t-25 "> <div class="large-11 pull-right m-t-25 comments-form">
<div class="column large-1"> <div class="column large-1">
@if($loggedUser) @if($loggedUser)
<img src="@gravatar($loggedUser->email)" class="gravatar" alt=""> <img src="@gravatar($loggedUser->email)" class="gravatar" alt="">
@@ -101,7 +99,7 @@
<div class="column medium-12"> <div class="column medium-12">
<textarea name="message" required>{{old('message')}}</textarea> <textarea name="message" required>{{old('message')}}</textarea>
<button type="submit" class="button success">Uložit</button> <button type="submit" class="button success pull-right">Uložit</button>
</div> </div>
</div> </div>
</form> </form>
@@ -18,18 +18,18 @@
<br> <br>
<span class="date uppercase month">@monthName($article->published_from ?: $article->created_at)</span> <span class="date uppercase month">@monthName($article->published_from ?: $article->created_at)</span>
</div> </div>
<div class="m-t-25 author"> <div class="m-t-15 author">
{{--<small>{{str_limit($article->author->name, 15)}}</small>--}} {{--<small>{{str_limit($article->author->name, 15)}}</small>--}}
<img class="gravatar" src="@gravatar($article->author->email, 35)" alt=""> <img class="gravatar" src="@gravatar($article->author->email, 35)" alt="">
</div> </div>
</aside> </aside>
<header> <header>
<h5> <h3 class="m-t-5">
<a href="{{route('page.content', ['url' => $article->url])}}"> <a href="{{route('page.content', ['url' => $article->url])}}">
{{$article->title}} {{$article->title}}
</a> </a>
</h5> </h3>
</header> </header>
<article class="p-0 column text-justify large-9"> <article class="p-0 column text-justify large-9">
{{str_limit($article->meta_description, 250)}} {{str_limit($article->meta_description, 250)}}