FEATURE: move categories into own repository
This commit is contained in:
Executable
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
return [
|
||||
"actions" => "Akce",
|
||||
"deleteSuccessfull" => "Kategorie úspěšně smazána",
|
||||
"description" => "Modul pro správu a kategorizaci obsahu.",
|
||||
"edit" => "Úprava kategorie",
|
||||
"fields" => ["description" => "Popis",
|
||||
"module" => "Modul",
|
||||
"name" => "Jméno",
|
||||
"parentCategory" => "Rodičovská kategorie",
|
||||
"save" => "Uložit",
|
||||
"url" => "URL",
|
||||
],
|
||||
"module" => "Modul",
|
||||
"name" => "Kategorie",
|
||||
"new" => "Nová kategorie",
|
||||
"noCategories" => "Žádná vytvořená kategorie.",
|
||||
"overview" => "Všechny kategorie",
|
||||
"saveSuccessfull" => "Kategorie úspěšně uložena",
|
||||
];
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
return [
|
||||
'name' => 'Categories',
|
||||
'description' => 'Module for category management and content categorization.',
|
||||
'new' => 'New category',
|
||||
'overview' => 'All categories',
|
||||
'fields' => [
|
||||
'name' => 'Name',
|
||||
'description' => 'Description',
|
||||
'url' => 'URL',
|
||||
'module' => 'Module',
|
||||
'parentCategory' => 'Parent category',
|
||||
'save' => 'Save category'
|
||||
],
|
||||
'edit' => 'Edit category',
|
||||
'saveSuccessfull' => 'Category successfully saved',
|
||||
'deleteSuccessfull' => 'Category successfully deleted',
|
||||
'module' => 'Module',
|
||||
'actions' => 'Actions',
|
||||
'noCategories' => 'No categories available'
|
||||
];
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
return [
|
||||
"actions" => "Akcie",
|
||||
"deleteSuccessfull" => "Kategória úspešne zmazaná.",
|
||||
"description" => "Modul pre správu kategórií a kategorizovanie obsahu",
|
||||
"edit" => "Upraviť kategóriu",
|
||||
"fields" => ["description" => "Popis",
|
||||
"module" => "Modul",
|
||||
"name" => "Názov",
|
||||
"parentCategory" => "Rodičovská kategória",
|
||||
"save" => "Uložiť kategóriu",
|
||||
"url" => "URL",
|
||||
],
|
||||
"module" => "Modul",
|
||||
"name" => "Kategórie",
|
||||
"new" => "Nová kategória",
|
||||
"noCategories" => "Žiadne kategórie nie sú dostupné.",
|
||||
"overview" => "Všetky kategórie",
|
||||
"saveSuccessfull" => "Kategória úspešne uložená.",
|
||||
];
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
@extends('admin.layoutWithNavigation')
|
||||
|
||||
@section('pageHeading', trans('categories::categories.edit'))
|
||||
|
||||
@section('content')
|
||||
@include('categories::admin.form', ['action' => route('categories.postEdit', ['id' => $category->id])])
|
||||
@endsection
|
||||
Executable
+67
@@ -0,0 +1,67 @@
|
||||
<form action="{{$action}}" method="post">
|
||||
{!! csrf_field() !!}
|
||||
<div class="row">
|
||||
<div class="col-lg-5">
|
||||
<label class="label-control">
|
||||
@lang('categories::categories.fields.name')
|
||||
</label>
|
||||
|
||||
<input type="text" name="name" class="form-control slug-source" value="{{old('name', $category->name)}}">
|
||||
</div>
|
||||
<div class="col-lg-5">
|
||||
<label>
|
||||
@lang('categories::categories.fields.url')
|
||||
</label>
|
||||
|
||||
<input type="text" name="url" class="form-control slug-target" value="{{old('url', $category->url)}}">
|
||||
|
||||
</div>
|
||||
<div class="col-lg-2 text-center">
|
||||
<div>
|
||||
<label>
|
||||
<input class="checkbox" value="1" id="lockUrl"
|
||||
@if(old('lockUrl') || ($category->id > 0 && \Illuminate\Support\Str::slug($category->name) != $category->url)) checked
|
||||
@endif name="lockUrl" type="checkbox">
|
||||
<span>@lang('admin/contents.lockUrl')</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="label-control">
|
||||
@lang('categories::categories.fields.description')
|
||||
</label>
|
||||
|
||||
<textarea class="form-control" name="description">{{old('description', $category->description)}}</textarea>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<label class="label-control">
|
||||
@lang('categories::categories.fields.module')
|
||||
</label>
|
||||
|
||||
<select class="form-control" name="moduleId" @if($category->id) disabled @endif>
|
||||
@foreach($modules as $module)
|
||||
<option @if($module->id == $category->module_id) selected
|
||||
@endif value="{{$module->id}}">{{trans($module->name)}}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
@if(count($categories))
|
||||
<label class="label-control">
|
||||
@lang('categories::categories.fields.parentCategory')
|
||||
</label>
|
||||
|
||||
<select class="form-control" name="parentCategory">
|
||||
<option value="">@lang('admin/contents.noCategory')</option>
|
||||
@foreach($categories as $parentCategory)
|
||||
@include('categories::admin.snippets.optionParentCategories', ['level' => 0, 'selectedCategory' => $category, 'currentCategory' => $parentCategory])
|
||||
@endforeach
|
||||
</select>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">@lang('categories::categories.fields.save')</button>
|
||||
</form>
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
@extends('admin.layoutWithNavigation')
|
||||
|
||||
@section('pageHeading', trans('categories::categories.new'))
|
||||
|
||||
@section('content')
|
||||
@include('categories::admin.form', ['action' => route('categories.postNew')])
|
||||
@endsection
|
||||
@@ -0,0 +1,35 @@
|
||||
@extends('admin.layoutWithNavigation')
|
||||
|
||||
@section('pageHeading', trans('categories::categories.overview'))
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="card items">
|
||||
<div class="card-block">
|
||||
|
||||
@if(count($categories))
|
||||
<div class="item-list striped rows-striped">
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>@lang('categories::categories.name')</th>
|
||||
<th>@lang('categories::categories.module')</th>
|
||||
<th>@lang('categories::categories.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($categories as $category)
|
||||
@include('categories::admin.snippets.overviewRow', ['level' => 0, 'currentCategory' => $category])
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-info">
|
||||
@lang('categories::categories.noCategories')
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
@@ -0,0 +1,9 @@
|
||||
<option @if($currentCategory['id'] == $selectedCategory->parent_id) selected @endif value="{{$currentCategory['id']}}">
|
||||
{{str_repeat('-', $level)}} {{$currentCategory['name']}}
|
||||
</option>
|
||||
|
||||
@if(isset($currentCategory['children']))
|
||||
@foreach($currentCategory['children'] as $category)
|
||||
@include('categories::admin.snippets.optionParentCategories', ['selectedCategory' => $selectedCategory, 'currentCategory' => $category, 'level' => $level+1])
|
||||
@endforeach
|
||||
@endif
|
||||
@@ -0,0 +1,39 @@
|
||||
<tr>
|
||||
<td>
|
||||
{{str_repeat('-', $level)}} <a href="{{route('categories.edit', ['id' => $currentCategory['id']])}}">{{$currentCategory['name']}}</a>
|
||||
</td>
|
||||
<td>@lang($modules[$currentCategory['module_id']])</td>
|
||||
<td>
|
||||
<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 href="{{route('categories.edit', ['id' => $currentCategory['id']])}}"><i
|
||||
class="fa fa-fw fa-pencil"></i></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="confirm remove"
|
||||
href="{{route('categories.delete', ['id' => $currentCategory['id']])}}"><i
|
||||
class="fa fa-fw fa-trash"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
@if(isset($currentCategory['children']))
|
||||
@foreach($currentCategory['children'] as $category)
|
||||
@include('categories::admin.snippets.overviewRow', ['currentCategory' => $category, 'level' => $level+1])
|
||||
@endforeach
|
||||
@endif
|
||||
Reference in New Issue
Block a user