FEATURE: rewrite widgets management into new layout

This commit is contained in:
Michal Kváček
2016-09-15 23:52:01 +02:00
parent 48c0abbe89
commit 48294842bf
6 changed files with 99 additions and 38 deletions
@@ -3,6 +3,6 @@
@section('pageHeading', @trans('admin/widgetAreas.edit', ['name' => $area->name]))
@section('content')
@include('admin.widgets.area.form', ['action' => {{route('widgetareas.postEdit', ['id' => $area->id])}}])
@include('admin.widgets.area.form', ['action' => route('widgetareas.postEdit', ['id' => $area->id])])
@stop
@@ -1,36 +1,26 @@
<form action="{{$action}}" method="POST">
{!! csrf_field() !!}
<label>
<label class="control-label">
@lang('admin/widgetAreas.name')
<input type="text" name="name" value="{{$area->name}}" placeholder="@lang('admin/widgetAreas.name')" />
@if (isset($errors) && $errors->has('name'))
<div class="callout alert">
{{ $errors->first('name') }}
</div>
@endif
</label>
<label>
<input type="text" class="form-control" name="name" value="{{$area->name}}"
placeholder="@lang('admin/widgetAreas.name')" />
<label class="control-label">
@lang('admin/widgetAreas.code')
<input type="text" name="code" disabled="true" value="{{$area->code}}"
placeholder="@lang('admin/widgetAreas.code')" />
</label>
<label>
<input type="text" class="form-control" name="code" @if($area->code) disabled @endif value="{{$area->code}}"
placeholder="@lang('admin/widgetAreas.code')" />
<label class="control-label">
@lang('admin/widgetAreas.description')
<textarea rows="3" name="description"
placeholder="@lang('admin/widgetAreas.description')">{{$area->description}}</textarea>
@if (isset($errors) && $errors->has('description'))
<div class="callout alert">
{{ $errors->first('description') }}
</div>
@endif
</label>
<button type="submit" class="button success">@lang('admin/widgetAreas.editButton')</button>
<textarea rows="3" class="form-control" name="description"
placeholder="@lang('admin/widgetAreas.description')">{{$area->description}}</textarea>
<button type="submit" class="btn btn-primary">@lang('admin/widgetAreas.save')</button>
</form>
@@ -3,40 +3,64 @@
@section('pageHeading', @trans('admin/widgetAreas.overview'))
@section('content')
<div class="column large-8">
<div class="row">
<div class="col-lg-8">
@if (count($areas) > 0)
<table class="full-width">
<table class="table item-list table-striped">
<tr>
<th>@lang('admin/widgetAreas.name')</th>
<th>@lang('admin/widgetAreas.code')</th>
<th>@lang('admin/widgetAreas.uniqueCode')</th>
<th>@lang('admin/widgetAreas.description')</th>
<th>@lang('admin/widgetAreas.actions')</th>
</tr>
@foreach($areas as $area)
<tr>
<td>{{$area->name}}</td>
<td>{{$area->code}}</td>
<td><a href="{{route('widgetareas.edit', ['id' => $area->id])}}">{{$area->name}}</a></td>
<td><a href="{{route('widgetareas.edit', ['id' => $area->id])}}">{{$area->code}}</a></td>
<td>{{str_limit($area->description, 100)}}</td>
<td class="text-center">
<a href="{{route('widgets.associate', ['widgetArea' => $area->id])}}"><i class="fa fa-plus"></i></a>
<a href="{{route('widgetareas.edit', ['id' => $area->id])}}"><i class="fa fa-edit"></i></a>
<a href="{{route('widgetareas.delete', ['id' => $area->id])}}"><i
class="fa fa-remove confirm"></i></a>
<div class="item-actions-dropdown">
<a class="item-actions-toggle-btn">
<span class="inactive"><i class="fa fa-cog"></i></span>
<span class="active"><i class="fa fa-chevron-circle-right"></i></span>
</a>
<div class="item-actions-block">
<ul class="item-actions-list">
<li>
<a class="edit" href="{{route('widgetareas.edit', ['id' => $area->id])}}"><i
class="fa fa-pencil"></i></a>
</li>
<li>
<a href="{{route('widgets.associate', ['widgetArea' => $area->id])}}"><i
class="fa fa-plus"></i></a>
</li>
<li>
<a class="confirm remove"
href="{{route('widgetareas.delete', ['id' => $area->id])}}"><i
class="fa fa-trash"></i></a>
</li>
</ul>
</div>
</div>
</td>
</tr>
@endforeach
</table>
@else
<em>@lang('admin/widgetAreas.noEntries')</em>
<div class="alert alert-info">
<em>@lang('admin/widgetAreas.noEntries')</em>
</div>
@endif
</div>
<div class="column large-4">
<div class="col-lg-4">
<h3>@lang('admin/widgetAreas.new')</h3>
@include('admin.widgets.area.newForm', ['hideMessages' => true])
@include('admin.widgets.area.form', ['action' => route('widgetareas.postNew'), 'area' => new \App\Models\WidgetArea()])
</div>
</div>
<div class="row pagination">
{!! $areas->render() !!}
</div>