FEATURE #1455: add template path overview

This commit is contained in:
Michal Kváček
2016-02-18 18:19:52 +01:00
parent f3dde68481
commit d082cee7b5
10 changed files with 150 additions and 2 deletions
@@ -0,0 +1,25 @@
<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Http\Requests;
use App\Models\TemplatePath;
use Illuminate\Http\Request;
class TemplateOverview extends Controller
{
public function getPath($path)
{
$path = TemplatePath::findOrFail($path);
return view('admin.templates.list', [
'directory' => $path,
'isWritable' => is_writable(base_path($path->path)),
'templates' => $path->templates()
->get(),
'subdirectories' => $path->subdirectories()
->get()
]);
}
}
+15
View File
@@ -51,6 +51,21 @@ Route::group([
Route::get('customfields/delete/{id}', 'EditCustomField@deleteCustomField')
->name('customfields.delete');
Route::get('templates/overview/path/{id}', 'TemplateOverview@getPath')
->name('templates.overview');
Route::get('templates/copy/{id}', 'TemplateOverview@getPath')
->name('templates.copy');
Route::get('templates/new/{pathId}', 'TemplateOverview@getPath')
->name('templates.new');
Route::get('templates/edit/{id}', 'TemplateOverview@getPath')
->name('templates.edit');
Route::post('templates/edit/{id}', 'TemplateOverview@getPath')
->name('templates.postEdit');
});
// these routes are available for all logged (authenticated) users