FEATURE #1455: add template path overview
This commit is contained in:
@@ -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()
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user