FEATURE: make content list in admin nicer

This commit is contained in:
Michal Kváček
2017-04-05 01:40:47 +02:00
parent 2e8f8dca1f
commit 870ca540c4
5 changed files with 403 additions and 400 deletions
+5 -2
View File
@@ -1,13 +1,15 @@
<?php
namespace App\CMS\Widgets\Menu;
use App\CMS\Contracts\Repositories\Content as IContent;
use App\CMS\Contracts\Widgets\PublicWidget;
use App\CMS\Widgets\Contracts\WidgetRenderer;
use App\CMS\Contracts\Widgets\WidgetRenderer;
use App\CMS\Widgets\Exceptions\MissingParameterException;
use App\Http\Requests\Request;
use App\Models\Content\Content;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;
use App\CMS\Contracts\Repositories\Content as IContent;
use Modules\Blog\Article\Handlers\Article;
class Menu implements PublicWidget
{
@@ -76,6 +78,7 @@ class Menu implements PublicWidget
$pages = Content::where('language', LaravelLocalization::getCurrentLocale())
->whereIn('id', $ids)
->whereIn('status', $allowedStatuses)
->where('moduleHandler', '!=', Article::class)
->get();
$used = [];
foreach ($pages as $page) {
+3 -1
View File
@@ -1,4 +1,5 @@
<?php
namespace App\CMS\Widgets\Menu\Presenters;
use App\CMS\Contracts\Repositories\Content as ContentContract;
@@ -81,7 +82,8 @@ class Menu implements WidgetRenderer
$content = app(ContentContract::class);
// get list of all pages
$pages = $content->getOverview();
$pages = $content->getOverview()
->get();
$widget->settings = new \stdClass();
$widget->settings->links = [];
@@ -1,7 +1,5 @@
@import "../imports";
/* *******************************************
* Item List general styles
********************************************** */
@@ -10,7 +8,6 @@
list-style: none;
padding: 0;
margin: 0;
margin-bottom: 0;
line-height: $item-list-line-height;
@include media(lg) {
@@ -29,11 +26,11 @@
flex-flow: column nowrap;
&.striped {
& > li {
& > div {
border-bottom: 1px solid $item-list-color-border;
}
& > li:nth-child(2n + 1) {
& > div:nth-child(2n + 1) {
background-color: lighten($color-divider, 12%);
@include media-down(sm) {
@@ -47,12 +44,10 @@
}
}
/* *******************************************
* Item general styles
********************************************** */
.item-list {
.item {
display: flex;
@@ -117,12 +112,10 @@
}
}
/* *******************************************
* Item components
********************************************** */
.item-list {
/********************************************
@@ -220,7 +213,7 @@
.item-img {
flex-grow: 1;
align-self: stretch;
background-color: #efefef;
background-color: #EFEFEF;
padding-bottom: 100%;
width: 100%;
height: 0;
@@ -328,7 +321,6 @@
left: 100%;
}
.item-actions-list {
padding: 0;
list-style: none;
@@ -367,7 +359,6 @@
}
/* *******************************************
* Adjustments
********************************************** */
@@ -1,5 +1,9 @@
@import "../../../imports";
.item-list {
}
.items-list-page {
.title-search-block {
@@ -313,12 +317,7 @@
text-align: left;
}
}
}
}
}
}
@@ -22,7 +22,9 @@
@endif
@if (count($pages) > 0)
<div class="item-list rows-striped">
<div class="card items">
<div class="card-block">
<div class="item-list striped rows-striped">
<div class="row bold p-tb-15">
<div class="col-md-1 hidden-sm-down"></div>
<div class="col-xs-10 col-md-3 col-lg-4">@lang('admin/contents.title')</div>
@@ -55,7 +57,8 @@
{{$page->title}}
</a>
@if($page->isHomepage) <span class="m-l-10 tag tag-primary">@lang('admin/contents.homepage')</span> @endif
@if($page->isHomepage) <span
class="m-l-10 tag tag-primary">@lang('admin/contents.homepage')</span> @endif
</div>
<div class="col-lg-2 col-md-3 hidden-sm-down">
<span class="tag @if($page->isPublic()) tag-success
@@ -85,7 +88,8 @@
<li>
<a href="{{route('content.setHomepage', ['id' => $page->id])}}"
data-toggle="tooltip" title="@lang('admin/contents.setHomepage')">
data-toggle="tooltip"
title="@lang('admin/contents.setHomepage')">
<i class="fa fa-home"></i>
</a>
</li>
@@ -115,7 +119,8 @@
</li>
@else
<li>
<a href="{{route('page.content', ['url' => $page->url])}}" target="_blank"
<a href="{{route('page.content', ['url' => $page->url])}}"
target="_blank"
data-toggle="tooltip" title="@lang('admin/contents.viewPage')"
class="button tiny secondary"><i class="fa fa-globe"></i>
</a>
@@ -144,10 +149,13 @@
</div>
@endforeach
</div>
</div>
<div class="row">
<div class="card-footer">
{!! $pages->render() !!}
</div>
</div>
@else
<div class="alert alert-info">