routing overhaul
previously all the of the page routing was handlede through controller organized by CRUD methods. it worked, but organizing by CRUD and not purpose resulted in more time spent looking for a specific task through controllers, so it turned out not to an effecient way of organizing. so routing has been completely reorganized into laravel's web routing section and methods have been moved to their appropriate controller so tasks are much easier to find front facing page routing turned out to be a bit more tricky that anticipated do the overap of routing paths, but it only affects dynamic page rendering and there's a patch in place that handles that issue until a better solution is found. Rendered HTML pages works fine. whew!
This commit is contained in:
parent
42dfdc947e
commit
743d7c4d90
26 changed files with 690 additions and 758 deletions
|
@ -4,157 +4,71 @@ namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Interfaces\PageRepositoryInterface;
|
use App\Interfaces\PageRepositoryInterface;
|
||||||
use App\Interfaces\MemberRepositoryInterface;
|
use App\Interfaces\MemberRepositoryInterface;
|
||||||
use App\Services\Data\ThemeService;
|
use App\Services\Assets\FileUploadService;
|
||||||
use App\Services\Data\SortingService;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class DashController extends Controller
|
class DashController extends Controller
|
||||||
{
|
{
|
||||||
protected PageRepositoryInterface $pages;
|
protected PageRepositoryInterface $pages;
|
||||||
protected MemberRepositoryInterface $member;
|
protected MemberRepositoryInterface $member;
|
||||||
protected ThemeService $themes;
|
protected FileUploadService $upload;
|
||||||
protected SortingService $sort;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
PageRepositoryInterface $pageRepository,
|
PageRepositoryInterface $pageRepository,
|
||||||
MemberRepositoryInterface $memberRepo,
|
MemberRepositoryInterface $memberRepo,
|
||||||
ThemeService $themeService,
|
FileUploadService $fileUploadService,
|
||||||
SortingService $sortingService
|
|
||||||
) {
|
) {
|
||||||
$this->pages = $pageRepository;
|
$this->pages = $pageRepository;
|
||||||
$this->member = $memberRepo;
|
$this->member = $memberRepo;
|
||||||
$this->themes = $themeService;
|
$this->upload = $fileUploadService;
|
||||||
$this->sort = $sortingService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---
|
//---
|
||||||
// GET
|
// GET
|
||||||
//---
|
//---
|
||||||
|
|
||||||
public function init($second, $third, $fourth)
|
|
||||||
{
|
|
||||||
switch ($second) {
|
|
||||||
case 'settings':
|
|
||||||
return $this->settings();
|
|
||||||
break;
|
|
||||||
case 'navigation':
|
|
||||||
return $this->navigation();
|
|
||||||
break;
|
|
||||||
case 'pages':
|
|
||||||
($third == null) ? $third = 'all' : $third = $third;
|
|
||||||
($fourth == null) ? $fourth = 1 : $fourth = $fourth;
|
|
||||||
return $this->book($third, $fourth);
|
|
||||||
break;
|
|
||||||
case 'page':
|
|
||||||
return $this->page($third, $fourth);
|
|
||||||
break;
|
|
||||||
case 'logout':
|
|
||||||
return $this->logout();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return $this->start();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function start()
|
public function start()
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
if ($this->member::status()) {
|
if ($this->member::status()) {
|
||||||
$result = $this->pages->getGroup(1, 4);
|
$result = $this->pages->getGroup(1, 4);
|
||||||
}
|
}
|
||||||
return view('back.start', [
|
|
||||||
"status" => $this->member::status(),
|
|
||||||
"result" => $result,
|
|
||||||
"title" => "Start"
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function book($pageFilter = 'all', $pageNum = 1)
|
|
||||||
{
|
|
||||||
$result = [];
|
|
||||||
if ($this->member::status()) {
|
if ($this->member::status()) {
|
||||||
$result = $this->pages->getGroup($pageNum, 4, $pageFilter);
|
return view('back.start', [
|
||||||
}
|
"status" => $this->member::status(),
|
||||||
return view('back.book', [
|
"result" => $result,
|
||||||
"status" => $this->member::status(),
|
"title" => "Start"
|
||||||
"result" => $result,
|
]);
|
||||||
"currentPage" => $pageNum,
|
|
||||||
"title" => "Pages"
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function page($mode, $uuid)
|
|
||||||
{
|
|
||||||
$title;
|
|
||||||
$page = [];
|
|
||||||
$views = [];
|
|
||||||
$mode == 'edit' ? $page = $this->pages->getByUuid($uuid) : $page = [];
|
|
||||||
$mode == 'edit' ? $title = 'Edit Page' : $title = 'Add New';
|
|
||||||
$mode == 'edit' ? $views = $this->themes->getCustomViews($page['layout']) : $views[] = 'page';
|
|
||||||
|
|
||||||
//just a patch for now to get this out of the template
|
|
||||||
if ($mode == 'edit') {
|
|
||||||
$id = $page['id'];
|
|
||||||
$uuid = $page['uuid'];
|
|
||||||
$slug = $page['slug'];
|
|
||||||
$feature = $page['feature'];
|
|
||||||
$layout = $page['layout'];
|
|
||||||
$tags = $page['tags'];
|
|
||||||
$content = $page['content'];
|
|
||||||
$date = $page['created'];
|
|
||||||
$updated = $page['updated'];
|
|
||||||
$media = $page['media'];
|
|
||||||
$files = $page['docs'];
|
|
||||||
$editTitle = $page['title'];
|
|
||||||
} else {
|
} else {
|
||||||
$id = "";
|
return view('back.login', [
|
||||||
$uuid = "";
|
"status" => $this->member::status(),
|
||||||
$slug = "";
|
"title" => "Hi!"
|
||||||
$feature = "";
|
]);
|
||||||
$layout = "";
|
}
|
||||||
$tags = "";
|
|
||||||
$content = "";
|
|
||||||
$date = "";
|
|
||||||
$updated = "";
|
|
||||||
$media = "";
|
|
||||||
$files = "";
|
|
||||||
$editTitle = "";
|
|
||||||
};
|
|
||||||
|
|
||||||
return view('back.page', [
|
|
||||||
"status" => $this->member::status(),
|
|
||||||
"mode" => $mode,
|
|
||||||
"page" => $page,
|
|
||||||
"views" => $views,
|
|
||||||
"id" => $id,
|
|
||||||
"uuid" => $uuid,
|
|
||||||
"slug" => $slug,
|
|
||||||
"feature" => $feature,
|
|
||||||
"layout" => $layout,
|
|
||||||
"tags" => $tags,
|
|
||||||
"content" => $content,
|
|
||||||
"date" => $date,
|
|
||||||
"updated" => $updated,
|
|
||||||
"media" => $media,
|
|
||||||
"files" => $files,
|
|
||||||
"title" => urldecode($title),
|
|
||||||
"editTitle" => urldecode($editTitle),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function navigation()
|
|
||||||
{
|
|
||||||
return view('back.navigation', $this->sort->navigation());
|
|
||||||
}
|
|
||||||
|
|
||||||
public function settings()
|
|
||||||
{
|
|
||||||
return view('back.settings', $this->sort->settings());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---
|
//---
|
||||||
// POST
|
// POST
|
||||||
//---
|
//---
|
||||||
|
public function uploads(Request $request)
|
||||||
|
{
|
||||||
|
$result = $result = $this->upload->handleFile($request);
|
||||||
|
//update configs for specfic uploads
|
||||||
|
switch ($request['source']) {
|
||||||
|
case 'avatar-upload':
|
||||||
|
$member = [];
|
||||||
|
$member = session('member');
|
||||||
|
$member['avatar'] = $result['filePath'];
|
||||||
|
$member = (object) $member;
|
||||||
|
$this->member->update($member);
|
||||||
|
break;
|
||||||
|
case 'background-upload':
|
||||||
|
$this->settings->updateGlobalData('background', $result['filePath']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
//---
|
//---
|
||||||
// PUT
|
// PUT
|
||||||
|
@ -167,7 +81,7 @@ class DashController extends Controller
|
||||||
public function login()
|
public function login()
|
||||||
{
|
{
|
||||||
if ($this->member::status()) {
|
if ($this->member::status()) {
|
||||||
return redirect('dashboard');
|
return redirect('dashboard/start');
|
||||||
} else {
|
} else {
|
||||||
return view('back.login', [
|
return view('back.login', [
|
||||||
"status" => $this->member::status(),
|
"status" => $this->member::status(),
|
||||||
|
|
|
@ -6,6 +6,9 @@ use App\Interfaces\PageRepositoryInterface;
|
||||||
use App\Services\Assets\AssetService;
|
use App\Services\Assets\AssetService;
|
||||||
use App\Services\Data\SettingsService;
|
use App\Services\Data\SettingsService;
|
||||||
use App\Services\Data\SortingService;
|
use App\Services\Data\SortingService;
|
||||||
|
use App\Services\Upkeep\InitService;
|
||||||
|
use App\Http\Controllers\DashController;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
use function _\find;
|
use function _\find;
|
||||||
|
|
||||||
|
@ -15,52 +18,95 @@ class FrontController extends Controller
|
||||||
protected PageRepositoryInterface $pages;
|
protected PageRepositoryInterface $pages;
|
||||||
protected AssetService $assets;
|
protected AssetService $assets;
|
||||||
protected SortingService $sort;
|
protected SortingService $sort;
|
||||||
|
protected $init;
|
||||||
|
protected $dash;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
PageRepositoryInterface $pageRepository,
|
PageRepositoryInterface $pageRepository,
|
||||||
SettingsService $settingsService,
|
SettingsService $settingsService,
|
||||||
AssetService $assetService,
|
AssetService $assetService,
|
||||||
SortingService $sortService,
|
SortingService $sortService,
|
||||||
|
InitService $initService,
|
||||||
|
DashController $dashController,
|
||||||
) {
|
) {
|
||||||
$this->pages = $pageRepository;
|
$this->pages = $pageRepository;
|
||||||
$this->settings = $settingsService;
|
$this->settings = $settingsService;
|
||||||
$this->assets = $assetService;
|
$this->assets = $assetService;
|
||||||
$this->sort = $sortService;
|
$this->sort = $sortService;
|
||||||
|
$this->init = $initService;
|
||||||
|
$this->dash = $dashController;
|
||||||
}
|
}
|
||||||
|
|
||||||
//REFACTOR: there is some method overlap between index and pages, so that needs to be addressed
|
public function start($one = 00, $two = 00, $three = 00)
|
||||||
public function index($first = 00, $second = 00, $third = 00)
|
|
||||||
{
|
{
|
||||||
$global = $this->settings->getGlobal();
|
$global = $this->settings->getGlobal();
|
||||||
$currentTheme = $this->assets->getCurrentTheme();
|
$currentTheme = $this->assets->getCurrentTheme();
|
||||||
$template;
|
$template;
|
||||||
$pageData = [];
|
$pageData = [];
|
||||||
$pages = $this->pages->getAll();
|
$pages = $this->pages->getAll();
|
||||||
|
//weird bug where the whole url is being passed with optional params
|
||||||
|
//for now, just split it manually and set it to the vars used
|
||||||
|
|
||||||
|
$paths = explode('/', $one);
|
||||||
|
if (isset($paths[0])) {
|
||||||
|
$one = $paths[0];
|
||||||
|
}
|
||||||
|
if (isset($paths[1])) {
|
||||||
|
$two = $paths[1];
|
||||||
|
}
|
||||||
|
if (isset($paths[2])) {
|
||||||
|
$three = $paths[2];
|
||||||
|
}
|
||||||
|
|
||||||
//check if configs are present
|
//check if configs are present
|
||||||
if (file_exists(env('FOLKS_PATH')) && file_exists(env('SETTINGS_PATH'))) {
|
if (file_exists(env('FOLKS_PATH')) && file_exists(env('SETTINGS_PATH'))) {
|
||||||
if ($global['dynamicRender'] == 'true') {
|
if ($global['dynamicRender'] == 'true') {
|
||||||
if (is_numeric($first)) {
|
if (is_numeric($one)) {
|
||||||
if ($first == 00 || !isset($first)) {
|
if ($one == 00 || !isset($one)) {
|
||||||
$page = $pages->where('id', 1)->first();
|
|
||||||
$pageData = $this->sort->page($page, false);
|
|
||||||
$template = $currentTheme . '.index';
|
|
||||||
} else {
|
|
||||||
$page = $this->pages->getBySlug($third);
|
|
||||||
$pageData = $this->sort->page($page, false);
|
|
||||||
$template = $currentTheme . '.' . $page['layout'];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($first == null || $first == '') {
|
|
||||||
$page = $pages->where('id', 0)->first();
|
$page = $pages->where('id', 0)->first();
|
||||||
$pageData = $this->sort->page($page, false);
|
$pageData = $this->sort->page($page, false);
|
||||||
$template = $currentTheme . '.index';
|
$template = $currentTheme . '.index';
|
||||||
} else {
|
} else {
|
||||||
$page = $this->pages->getBySlug($first);
|
$page = $this->pages->getBySlug($three);
|
||||||
$pageData = $this->sort->page($page, false);
|
$pageData = $this->sort->page($page, false);
|
||||||
$template = $currentTheme . '.' . $page['layout'];
|
$template = $currentTheme . '.' . $page['layout'];
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if ($one == null || $one == '') {
|
||||||
|
$page = $pages->where('id', 0)->first();
|
||||||
|
$pageData = $this->sort->page($page, false);
|
||||||
|
$template = $currentTheme . '.index';
|
||||||
|
} else {
|
||||||
|
if ($one == 'archives' || $one == 'archive' || $one == 'tags') {
|
||||||
|
$currentTheme = $this->assets->getCurrentTheme();
|
||||||
|
switch ($one) {
|
||||||
|
case 'archive':
|
||||||
|
case 'archives':
|
||||||
|
$template = $currentTheme . '.archive';
|
||||||
|
$pageData = $this->sort->archive(false);
|
||||||
|
break;
|
||||||
|
case 'tags':
|
||||||
|
$template = $currentTheme . '.tags';
|
||||||
|
$tags = $this->sort->tags(false);
|
||||||
|
$tagData = find($tags['tags'], ['tag_name' => $two]);
|
||||||
|
$pageData = [
|
||||||
|
'theme' => $currentTheme, // for theme kit
|
||||||
|
'title' => 'Pages Tagged as ' . $two,
|
||||||
|
'dynamicRender' => $tags['dynamicRender'],
|
||||||
|
'info' => $tags['info'],
|
||||||
|
'menu' => $tags['menu'],
|
||||||
|
'pages' => $tagData['pages'],
|
||||||
|
'media' => $tags['media'],
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$page = $this->pages->getBySlug($one);
|
||||||
|
$pageData = $this->sort->page($page, false);
|
||||||
|
$template = $currentTheme . '.' . $page['layout'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return view($template, $pageData);
|
return view($template, $pageData);
|
||||||
} else {
|
} else {
|
||||||
if (is_file('../public/index.html')) {
|
if (is_file('../public/index.html')) {
|
||||||
|
@ -74,30 +120,18 @@ class FrontController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function page($first = 00, $second = 00, $third = 00)
|
//setup up a new site or restore from back up
|
||||||
|
public function init($task, Request $request)
|
||||||
{
|
{
|
||||||
$currentTheme = $this->assets->getCurrentTheme();
|
$result = [];
|
||||||
switch ($first) {
|
switch ($task) {
|
||||||
case 'archive':
|
case 'fresh':
|
||||||
case 'archives':
|
$result = $this->init->fresh(json_decode($request->getContent()));
|
||||||
$template = $currentTheme . '.archive';
|
|
||||||
$pageData = $this->sort->archive();
|
|
||||||
break;
|
break;
|
||||||
case 'tags':
|
case 'restore':
|
||||||
$template = $currentTheme . '.tags';
|
$result = $this->init->restore($request);
|
||||||
$tags = $this->sort->tags(false);
|
|
||||||
$tagData = find($tags['tags'], ['tag_name' => $second]);
|
|
||||||
$pageData = [
|
|
||||||
'theme' => $currentTheme, // for theme kit
|
|
||||||
'title' => 'Pages Tagged as ' . $second,
|
|
||||||
'dynamicRender' => $tags['dynamicRender'],
|
|
||||||
'info' => $tags['info'],
|
|
||||||
'menu' => $tags['menu'],
|
|
||||||
'pages' => $tagData['pages'],
|
|
||||||
'media' => $tags['media'],
|
|
||||||
];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return view($template, $pageData);
|
return response()->json($result)->header('Content-Type', 'application/json');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
147
app/Http/Controllers/PageController.php
Normal file
147
app/Http/Controllers/PageController.php
Normal file
|
@ -0,0 +1,147 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Interfaces\PageRepositoryInterface;
|
||||||
|
use App\Interfaces\MemberRepositoryInterface;
|
||||||
|
use App\Services\Data\ThemeService;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class PageController extends Controller
|
||||||
|
{
|
||||||
|
protected PageRepositoryInterface $page;
|
||||||
|
protected MemberRepositoryInterface $member;
|
||||||
|
protected ThemeService $themes;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
PageRepositoryInterface $pageRepo,
|
||||||
|
MemberRepositoryInterface $memberRepo,
|
||||||
|
ThemeService $themeService,
|
||||||
|
) {
|
||||||
|
$this->page = $pageRepo;
|
||||||
|
$this->member = $memberRepo;
|
||||||
|
$this->themes = $themeService;
|
||||||
|
}
|
||||||
|
|
||||||
|
//---
|
||||||
|
// GET Actions
|
||||||
|
//---
|
||||||
|
|
||||||
|
public function start(string $one = 'all', string $two = '1')
|
||||||
|
{
|
||||||
|
//checks mode to see what needs to get loaded
|
||||||
|
switch ($one) {
|
||||||
|
case "edit":
|
||||||
|
case "add":
|
||||||
|
return $this->page($one, $two);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return $this->book($one, $two);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function page($mode, $uuid)
|
||||||
|
{
|
||||||
|
$title;
|
||||||
|
$page = [];
|
||||||
|
$views = [];
|
||||||
|
$mode == 'edit' ? $page = $this->page->getByUuid($uuid) : $page = [];
|
||||||
|
$mode == 'edit' ? $title = 'Edit Page' : $title = 'Add New';
|
||||||
|
$mode == 'edit' ? $views = $this->themes->getCustomViews($page['layout']) : $views[] = 'page';
|
||||||
|
|
||||||
|
//just a patch for now to get this out of the template
|
||||||
|
if ($mode == 'edit') {
|
||||||
|
$id = $page['id'];
|
||||||
|
$uuid = $page['uuid'];
|
||||||
|
$slug = $page['slug'];
|
||||||
|
$feature = $page['feature'];
|
||||||
|
$layout = $page['layout'];
|
||||||
|
$tags = $page['tags'];
|
||||||
|
$content = $page['content'];
|
||||||
|
$date = $page['created'];
|
||||||
|
$updated = $page['updated'];
|
||||||
|
$media = $page['media'];
|
||||||
|
$files = $page['docs'];
|
||||||
|
$editTitle = $page['title'];
|
||||||
|
} else {
|
||||||
|
$id = "";
|
||||||
|
$uuid = "";
|
||||||
|
$slug = "";
|
||||||
|
$feature = "";
|
||||||
|
$layout = "";
|
||||||
|
$tags = "";
|
||||||
|
$content = "";
|
||||||
|
$date = "";
|
||||||
|
$updated = "";
|
||||||
|
$media = "";
|
||||||
|
$files = "";
|
||||||
|
$editTitle = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
return view('back.page', [
|
||||||
|
"status" => $this->member::status(),
|
||||||
|
"mode" => $mode,
|
||||||
|
"page" => $page,
|
||||||
|
"views" => $views,
|
||||||
|
"id" => $id,
|
||||||
|
"uuid" => $uuid,
|
||||||
|
"slug" => $slug,
|
||||||
|
"feature" => $feature,
|
||||||
|
"layout" => $layout,
|
||||||
|
"tags" => $tags,
|
||||||
|
"content" => $content,
|
||||||
|
"date" => $date,
|
||||||
|
"updated" => $updated,
|
||||||
|
"media" => $media,
|
||||||
|
"files" => $files,
|
||||||
|
"title" => urldecode($title),
|
||||||
|
"editTitle" => urldecode($editTitle),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function book($pageFilter, $pageNum)
|
||||||
|
{
|
||||||
|
$result = [];
|
||||||
|
if ($this->member::status()) {
|
||||||
|
$result = $this->page->getGroup($pageNum, 4, $pageFilter);
|
||||||
|
}
|
||||||
|
return view('back.book', [
|
||||||
|
"status" => $this->member::status(),
|
||||||
|
"result" => $result,
|
||||||
|
"currentPage" => $pageNum,
|
||||||
|
"title" => "Pages"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//---
|
||||||
|
// POST Actions
|
||||||
|
//---
|
||||||
|
public function create(Request $request)
|
||||||
|
{
|
||||||
|
$body = json_decode($request->getContent());
|
||||||
|
$result = $this->page->create($body);
|
||||||
|
return response()->json($result)->header('Content-Type', 'application/json');
|
||||||
|
}
|
||||||
|
|
||||||
|
//---
|
||||||
|
// PUT Actions
|
||||||
|
//---
|
||||||
|
public function write(Request $request)
|
||||||
|
{
|
||||||
|
$body = json_decode($request->getContent());
|
||||||
|
$result = $this->page->update($body);
|
||||||
|
return response()->json($result)->header('Content-Type', 'application/json');
|
||||||
|
}
|
||||||
|
|
||||||
|
//---
|
||||||
|
// DELETE Actions
|
||||||
|
//---
|
||||||
|
public function delete(Request $request)
|
||||||
|
{
|
||||||
|
$body = json_decode($request->getContent());
|
||||||
|
$result = $this->page->delete($body);
|
||||||
|
return response()->json($result)->header('Content-Type', 'application/json');
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,29 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Interfaces\PageRepositoryInterface;
|
|
||||||
|
|
||||||
class RouteDeleteController extends Controller
|
|
||||||
{
|
|
||||||
protected $page;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
PageRepositoryInterface $pageRepo
|
|
||||||
) {
|
|
||||||
$this->page = $pageRepo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function handleRequest(Request $request)
|
|
||||||
{
|
|
||||||
$path = explode('/', $request->path());
|
|
||||||
switch ($path[0]) {
|
|
||||||
case 'page':
|
|
||||||
$body = json_decode($request->getContent());
|
|
||||||
$result = $this->page->delete($body);
|
|
||||||
return response()->json($result)->header('Content-Type', 'application/json');
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,91 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use App\Interfaces\MemberRepositoryInterface;
|
|
||||||
use App\Services\Data\SettingsService;
|
|
||||||
|
|
||||||
class RouteGetController extends Controller
|
|
||||||
{
|
|
||||||
protected $dash;
|
|
||||||
protected $gate;
|
|
||||||
protected $theme;
|
|
||||||
protected $front;
|
|
||||||
protected $member;
|
|
||||||
protected $settings;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
DashController $dashController,
|
|
||||||
AuthController $authController,
|
|
||||||
ThemeController $themeController,
|
|
||||||
FrontController $frontController,
|
|
||||||
MemberRepositoryInterface $memberRepo,
|
|
||||||
SettingsService $settingsService,
|
|
||||||
) {
|
|
||||||
$this->dash = $dashController;
|
|
||||||
$this->gate = $authController;
|
|
||||||
$this->theme = $themeController;
|
|
||||||
$this->front = $frontController;
|
|
||||||
$this->member = $memberRepo;
|
|
||||||
$this->settings = $settingsService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function handleRequest($first = null, $second = null, $third = null, $fourth = null)
|
|
||||||
{
|
|
||||||
if (isset($first) && !is_numeric($first)) {
|
|
||||||
switch ($first) {
|
|
||||||
case 'dashboard':
|
|
||||||
if ($this->member::status()) {
|
|
||||||
return $this->dash->init($second, $third, $fourth);
|
|
||||||
} else {
|
|
||||||
return $this->dash->login();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'theme':
|
|
||||||
if ($this->member::status()) {
|
|
||||||
if (isset($second)) {
|
|
||||||
return $this->theme->getView($third, $fourth);
|
|
||||||
} else {
|
|
||||||
return $this->theme->start();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return $this->dash->login();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'tags':
|
|
||||||
case 'archives':
|
|
||||||
return $this->front->page($first, $second, $third);
|
|
||||||
break;
|
|
||||||
case 'backup':
|
|
||||||
return $this->downloadBackup($second);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return $this->front->index($first, $second, $third);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return $this->front->index($first, $second, $third);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function downloadBackup($type)
|
|
||||||
{
|
|
||||||
if ($this->member::status()) {
|
|
||||||
$latest = '';
|
|
||||||
$file = '';
|
|
||||||
if ($type == 'content-download') {
|
|
||||||
$latest = $this->settings->getGlobal()['last_content_backup'];
|
|
||||||
$file = 'backup-content-' . $latest . '.zip';
|
|
||||||
} else {
|
|
||||||
$latest = $this->settings->getGlobal()['last_files_backup'];
|
|
||||||
$file = 'backup-files-' . $latest . '.zip';
|
|
||||||
}
|
|
||||||
|
|
||||||
return response()->download(
|
|
||||||
'../content/backups/' . $file,
|
|
||||||
$file,
|
|
||||||
['Content-Type: application/zip']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,122 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Illuminate\Support\Facades\Mail;
|
|
||||||
use App\Mail\SystemEmail;
|
|
||||||
use App\Interfaces\PageRepositoryInterface;
|
|
||||||
use App\Services\Upkeep\MaintenanceService;
|
|
||||||
use App\Services\Assets\FileUploadService;
|
|
||||||
use App\Interfaces\MemberRepositoryInterface;
|
|
||||||
use App\Services\Data\SettingsService;
|
|
||||||
use App\Services\Upkeep\InitService;
|
|
||||||
use App\Services\Upkeep\ResetService;
|
|
||||||
|
|
||||||
class RoutePostController extends Controller
|
|
||||||
{
|
|
||||||
protected $page;
|
|
||||||
protected $gate;
|
|
||||||
protected $maintenance;
|
|
||||||
protected $upload;
|
|
||||||
protected $settings;
|
|
||||||
protected $member;
|
|
||||||
protected $init;
|
|
||||||
protected $reset;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
PageRepositoryInterface $pageRepo,
|
|
||||||
AuthController $authController,
|
|
||||||
MaintenanceService $maintenanceService,
|
|
||||||
FileUploadService $fileUploadService,
|
|
||||||
SettingsService $settingsService,
|
|
||||||
MemberRepositoryInterface $memberRepo,
|
|
||||||
InitService $initService,
|
|
||||||
ResetService $resetService,
|
|
||||||
) {
|
|
||||||
$this->page = $pageRepo;
|
|
||||||
$this->gate = $authController;
|
|
||||||
$this->maintenance = $maintenanceService;
|
|
||||||
$this->upload = $fileUploadService;
|
|
||||||
$this->settings = $settingsService;
|
|
||||||
$this->member = $memberRepo;
|
|
||||||
$this->init = $initService;
|
|
||||||
$this->reset = $resetService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function handleRequest(Request $request)
|
|
||||||
{
|
|
||||||
$path = explode('/', $request->path());
|
|
||||||
switch ($path[0]) {
|
|
||||||
case 'init':
|
|
||||||
return $this->initTask($path[1], $request);
|
|
||||||
break;
|
|
||||||
case 'login':
|
|
||||||
return $this->gate->enter($request);
|
|
||||||
break;
|
|
||||||
case 'page':
|
|
||||||
$body = json_decode($request->getContent());
|
|
||||||
$result = $this->page->create($body);
|
|
||||||
return response()->json($result)->header('Content-Type', 'application/json');
|
|
||||||
break;
|
|
||||||
case 'settings':
|
|
||||||
if ($path[1] == 'mailer') {
|
|
||||||
return $this->sendNotify($request);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'upload':
|
|
||||||
$result = $result = $this->upload->handleFile($request);
|
|
||||||
//update configs for specfic uploads
|
|
||||||
switch ($request['source']) {
|
|
||||||
case 'avatar-upload':
|
|
||||||
$member = [];
|
|
||||||
$member = session('member');
|
|
||||||
$member['avatar'] = $result['filePath'];
|
|
||||||
$member = (object) $member;
|
|
||||||
$this->member->update($member);
|
|
||||||
break;
|
|
||||||
case 'background-upload':
|
|
||||||
$this->settings->updateGlobalData('background', $result['filePath']);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function initTask($task, $request)
|
|
||||||
{
|
|
||||||
$result = [];
|
|
||||||
switch ($task) {
|
|
||||||
case 'fresh':
|
|
||||||
$result = $this->init->fresh(json_decode($request->getContent()));
|
|
||||||
break;
|
|
||||||
case 'restore':
|
|
||||||
$result = $this->init->restore($request);
|
|
||||||
break;
|
|
||||||
case 'reset':
|
|
||||||
$result = $this->reset->site($request);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return response()->json($result)->header('Content-Type', 'application/json');
|
|
||||||
}
|
|
||||||
|
|
||||||
private function sendNotify($request)
|
|
||||||
{
|
|
||||||
$result = [];
|
|
||||||
try {
|
|
||||||
Mail::to(env('ADMIN_EMAIL'))->send(new SystemEmail($request->content));
|
|
||||||
$result = [
|
|
||||||
'type' => 'mail_good',
|
|
||||||
'message' => 'Mail Sent',
|
|
||||||
];
|
|
||||||
} catch (TransportException $e) {
|
|
||||||
$result = [
|
|
||||||
'type' => 'mail_not_good',
|
|
||||||
'message' => 'Mail Not Sent. It\'s cool. Just check mail settings in the .env',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return response()->json($result)->header('Content-Type', 'application/json');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,75 +2,55 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Interfaces\PageRepositoryInterface;
|
|
||||||
use App\Services\Assets\AssetService;
|
|
||||||
use App\Services\Assets\RenderService;
|
|
||||||
use App\Interfaces\MemberRepositoryInterface;
|
use App\Interfaces\MemberRepositoryInterface;
|
||||||
use App\Services\Data\SettingsService;
|
use App\Services\Data\SettingsService;
|
||||||
|
use App\Services\Data\SortingService;
|
||||||
|
use App\Services\Assets\AssetService;
|
||||||
|
use App\Services\Assets\RenderService;
|
||||||
use App\Services\Upkeep\MaintenanceService;
|
use App\Services\Upkeep\MaintenanceService;
|
||||||
|
use App\Services\Upkeep\ResetService;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class RoutePutController extends Controller
|
class SettingsController extends Controller
|
||||||
{
|
{
|
||||||
protected $page;
|
protected $theme;
|
||||||
|
protected $member;
|
||||||
|
protected $settings;
|
||||||
|
protected $sort;
|
||||||
protected $assets;
|
protected $assets;
|
||||||
protected $render;
|
protected $render;
|
||||||
protected $settings;
|
|
||||||
protected $member;
|
|
||||||
protected $maintenance;
|
protected $maintenance;
|
||||||
|
protected $reset;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
PageRepositoryInterface $pageRepo,
|
ThemeController $themeController,
|
||||||
AssetService $assetService,
|
|
||||||
RenderService $renderService,
|
|
||||||
SettingsService $settingsService,
|
|
||||||
MemberRepositoryInterface $memberRepo,
|
MemberRepositoryInterface $memberRepo,
|
||||||
|
SettingsService $settingsService,
|
||||||
|
SortingService $sortingService,
|
||||||
|
AssetService $assetsService,
|
||||||
|
RenderService $renderService,
|
||||||
MaintenanceService $maintenanceService,
|
MaintenanceService $maintenanceService,
|
||||||
|
ResetService $resetService,
|
||||||
) {
|
) {
|
||||||
$this->page = $pageRepo;
|
$this->theme = $themeController;
|
||||||
$this->assets = $assetService;
|
|
||||||
$this->render = $renderService;
|
|
||||||
$this->settings = $settingsService;
|
|
||||||
$this->member = $memberRepo;
|
$this->member = $memberRepo;
|
||||||
|
$this->settings = $settingsService;
|
||||||
|
$this->sort = $sortingService;
|
||||||
|
$this->assets = $assetsService;
|
||||||
|
$this->render = $renderService;
|
||||||
$this->maintenance = $maintenanceService;
|
$this->maintenance = $maintenanceService;
|
||||||
|
$this->reset = $resetService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleRequest(Request $request)
|
public function start()
|
||||||
{
|
{
|
||||||
$path = explode('/', $request->path());
|
return view('back.settings', ['settings' => $this->sort->settings(), 'nav' => $this->sort->navigation()]);
|
||||||
switch ($path[0]) {
|
|
||||||
case 'page':
|
|
||||||
$body = json_decode($request->getContent());
|
|
||||||
$result = $this->page->update($body);
|
|
||||||
return response()->json($result)->header('Content-Type', 'application/json');
|
|
||||||
break;
|
|
||||||
case 'settings':
|
|
||||||
return $this->settingsTasks($request, $path[1]);
|
|
||||||
break;
|
|
||||||
case 'backup':
|
|
||||||
return $this->createBackup($request);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createBackup($request)
|
public function tasks(Request $request)
|
||||||
{
|
|
||||||
$body = json_decode($request->getContent());
|
|
||||||
if ($body->task == 'content_backup') {
|
|
||||||
return response()->json(
|
|
||||||
$this->maintenance->createContentBackUp()
|
|
||||||
)->header('Content-Type', 'application/json');
|
|
||||||
} else {
|
|
||||||
return response()->json(
|
|
||||||
$this->maintenance->createFileBackUp()
|
|
||||||
)->header('Content-Type', 'application/json');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function settingsTasks($request, $task)
|
|
||||||
{
|
{
|
||||||
$result = [];
|
$result = [];
|
||||||
switch ($task) {
|
switch (explode("/", $request->getURI())[5]) {
|
||||||
case 'publish':
|
case 'publish':
|
||||||
$this->assets->moveToTheme(true);
|
$this->assets->moveToTheme(true);
|
||||||
$result = $this->render->publishAll();
|
$result = $this->render->publishAll();
|
||||||
|
@ -89,4 +69,45 @@ class RoutePutController extends Controller
|
||||||
}
|
}
|
||||||
return response()->json($result)->header('Content-Type', 'application/json');
|
return response()->json($result)->header('Content-Type', 'application/json');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createBackup(Request $request)
|
||||||
|
{
|
||||||
|
$body = json_decode($request->getContent());
|
||||||
|
if ($body->task == 'content_backup') {
|
||||||
|
return response()->json(
|
||||||
|
$this->maintenance->createContentBackUp()
|
||||||
|
)->header('Content-Type', 'application/json');
|
||||||
|
} else {
|
||||||
|
return response()->json(
|
||||||
|
$this->maintenance->createFileBackUp()
|
||||||
|
)->header('Content-Type', 'application/json');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function downloadBackup($type)
|
||||||
|
{
|
||||||
|
if ($this->member::status()) {
|
||||||
|
$latest = '';
|
||||||
|
$file = '';
|
||||||
|
if ($type == 'content-download') {
|
||||||
|
$latest = $this->settings->getGlobal()['last_content_backup'];
|
||||||
|
$file = 'backup-content-' . $latest . '.zip';
|
||||||
|
} else {
|
||||||
|
$latest = $this->settings->getGlobal()['last_files_backup'];
|
||||||
|
$file = 'backup-files-' . $latest . '.zip';
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->download(
|
||||||
|
'../content/backups/' . $file,
|
||||||
|
$file,
|
||||||
|
['Content-Type: application/zip']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reset(Request $request)
|
||||||
|
{
|
||||||
|
$result = $this->reset->site($request);
|
||||||
|
return response()->json($result)->header('Content-Type', 'application/json');
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -3,6 +3,8 @@
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Mail;
|
use Illuminate\Support\Facades\Mail;
|
||||||
|
use App\Mail\SystemEmail;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class SystemMailController extends Controller
|
class SystemMailController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -14,4 +16,23 @@ class SystemMailController extends Controller
|
||||||
$message = "This is something important. Probably";
|
$message = "This is something important. Probably";
|
||||||
Mail::to(env('ADMIN_EMAIL'))->send(new SystemEmail($message));
|
Mail::to(env('ADMIN_EMAIL'))->send(new SystemEmail($message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sendNotify(Request $request)
|
||||||
|
{
|
||||||
|
$result = [];
|
||||||
|
try {
|
||||||
|
Mail::to(env('ADMIN_EMAIL'))->send(new SystemEmail($request->content));
|
||||||
|
$result = [
|
||||||
|
'type' => 'mail_good',
|
||||||
|
'message' => 'Mail Sent',
|
||||||
|
];
|
||||||
|
} catch (TransportException $e) {
|
||||||
|
$result = [
|
||||||
|
'type' => 'mail_not_good',
|
||||||
|
'message' => 'Mail Not Sent. It\'s cool. Just check mail settings in the .env',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return response()->json($result)->header('Content-Type', 'application/json');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ class ThemeController extends Controller
|
||||||
$template = $currentTheme . '.page';
|
$template = $currentTheme . '.page';
|
||||||
//if coming from theme page, grabs id of latest page
|
//if coming from theme page, grabs id of latest page
|
||||||
if ($id == null) {
|
if ($id == null) {
|
||||||
$uuid = $this->getPageUUID();
|
$page = $this->pages->getByUuid($this->getPageUUID());
|
||||||
} else {
|
} else {
|
||||||
//get page by uuid
|
//get page by uuid
|
||||||
$page = $this->pages->getByUuid($id);
|
$page = $this->pages->getByUuid($id);
|
||||||
|
|
|
@ -4,16 +4,16 @@ namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Services\AuthService;
|
use App\Interfaces\MemberRepositoryInterface;
|
||||||
|
|
||||||
class MemberCheck
|
class MemberCheck
|
||||||
{
|
{
|
||||||
protected $auth;
|
protected MemberRepositoryInterface $member;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AuthService $authService,
|
MemberRepositoryInterface $memberRepo,
|
||||||
) {
|
) {
|
||||||
$this->auth = $authService;
|
$this->member = $memberRepo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@ class MemberCheck
|
||||||
*/
|
*/
|
||||||
public function handle(Request $request, Closure $next)
|
public function handle(Request $request, Closure $next)
|
||||||
{
|
{
|
||||||
if ($this->auth::status()) {
|
if ($this->member::status()) {
|
||||||
return $next($request);
|
return $next($request);
|
||||||
} else {
|
} else {
|
||||||
return redirect('dashboard');
|
return redirect('dashboard');
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
article.navigation {
|
main > article > section.settings-tabs > section#site-menu {
|
||||||
width: 100%;
|
padding: 10px 0;
|
||||||
max-width: 900px;
|
|
||||||
margin: 100px auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
article.navigation > section > div.nav-item {
|
main > article > section.settings-tabs > section#site-menu > div.nav-item {
|
||||||
display: block;
|
display: block;
|
||||||
width: 98%;
|
width: 98%;
|
||||||
background: var(--secondary);
|
background: var(--secondary);
|
||||||
|
@ -15,7 +13,7 @@ article.navigation > section > div.nav-item {
|
||||||
cursor: move;
|
cursor: move;
|
||||||
}
|
}
|
||||||
|
|
||||||
article.navigation > section > div.nav-item > label {
|
main > article > section.settings-tabs > section#site-menu > label {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
margin: 12px 0 0 10px;
|
margin: 12px 0 0 10px;
|
||||||
|
@ -23,24 +21,30 @@ article.navigation > section > div.nav-item > label {
|
||||||
cursor: move;
|
cursor: move;
|
||||||
}
|
}
|
||||||
|
|
||||||
article.navigation > section > div.nav-item > div#nav-btns {
|
main > article > section.settings-tabs > section#site-menu > div.nav-item > div#nav-btns {
|
||||||
float: right;
|
float: right;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
article.navigation > section > div.nav-item > div#nav-btns button {
|
main
|
||||||
|
> article
|
||||||
|
> section.settings-tabs
|
||||||
|
> section#site-menu
|
||||||
|
> div.nav-item
|
||||||
|
> div#nav-btns
|
||||||
|
button {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 500px) {
|
@media only screen and (max-width: 500px) {
|
||||||
article.navigation > section > div.nav-item > label {
|
main > article > section.settings-tabs > section#site-menu > div.nav-item > label {
|
||||||
width: 55%;
|
width: 55%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
article.navigation > section i {
|
main > article > section.settings-tabs > section#site-menu > section i {
|
||||||
font-size: 1.5em;
|
font-size: 1.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ article[class="settings"] label {
|
||||||
}
|
}
|
||||||
|
|
||||||
article.settings div.tab-toolbar button {
|
article.settings div.tab-toolbar button {
|
||||||
width: 180px;
|
width: 120px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
color: var(--secondary);
|
color: var(--secondary);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ export default class NavActions {
|
||||||
//--------------------------
|
//--------------------------
|
||||||
syncMenu() {
|
syncMenu() {
|
||||||
let navData = [];
|
let navData = [];
|
||||||
let items = document.getElementById('nav-items').children;
|
let items = document.getElementById('site-menu').children;
|
||||||
for (let index = 0; index < items.length; index++) {
|
for (let index = 0; index < items.length; index++) {
|
||||||
navData.push({
|
navData.push({
|
||||||
title: items[index].getElementsByTagName('label')[0].innerHTML,
|
title: items[index].getElementsByTagName('label')[0].innerHTML,
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default class NavIndex {
|
||||||
start() {
|
start() {
|
||||||
//grabs elements and makes them sortables
|
//grabs elements and makes them sortables
|
||||||
let self = this;
|
let self = this;
|
||||||
Sortable.create(document.getElementById('nav-items'), {
|
Sortable.create(document.getElementById('site-menu'), {
|
||||||
onUpdate: () => {
|
onUpdate: () => {
|
||||||
new NavActions().syncMenu().then(data => {
|
new NavActions().syncMenu().then(data => {
|
||||||
notify.alert('Updating Menu', null);
|
notify.alert('Updating Menu', null);
|
||||||
|
@ -68,7 +68,7 @@ export default class NavIndex {
|
||||||
case 'edit-item':
|
case 'edit-item':
|
||||||
self.processing = false;
|
self.processing = false;
|
||||||
window.location =
|
window.location =
|
||||||
'/dashboard/page/edit/' + e.target.getAttribute('data-uuid');
|
'/dashboard/pages/edit/' + e.target.getAttribute('data-uuid');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ export default class PostEditor {
|
||||||
notify.alert(r.message, true);
|
notify.alert(r.message, true);
|
||||||
} else {
|
} else {
|
||||||
notify.alert(r.message, true);
|
notify.alert(r.message, true);
|
||||||
window.location = '/dashboard/page/edit/' + r.id;
|
window.location = '/dashboard/pages/edit/' + r.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -7,17 +7,17 @@ export const REQUEST_TYPE_DELETE = 'DELETE';
|
||||||
export const CONTENT_TYPE_JSON = 'json';
|
export const CONTENT_TYPE_JSON = 'json';
|
||||||
export const CONTENT_TYPE_FORM = 'x-www-form-urlencoded';
|
export const CONTENT_TYPE_FORM = 'x-www-form-urlencoded';
|
||||||
//** ACTIONS URLS **//
|
//** ACTIONS URLS **//
|
||||||
export const API_NEW_PAGE = '/page/create';
|
export const API_NEW_PAGE = '/dashboard/pages/create';
|
||||||
export const API_EDIT_PAGE = '/page/write';
|
export const API_EDIT_PAGE = '/dashboard/pages/write';
|
||||||
export const API_DELETE_PAGE = '/page/delete';
|
export const API_DELETE_PAGE = '/dashboard/pages/delete';
|
||||||
export const API_GET_SETTINGS = '/settings/site';
|
export const API_GET_SETTINGS = '/dashboard/settings/site';
|
||||||
export const API_SETTINGS_SYNC = '/settings/sync';
|
export const API_SETTINGS_SYNC = '/dashboard/settings/sync';
|
||||||
export const API_PUBLISH_PAGES = '/settings/publish';
|
export const API_PUBLISH_PAGES = '/dashboard/settings/publish';
|
||||||
export const API_NAV_SYNC = '/settings/nav-sync';
|
export const API_NAV_SYNC = '/dashboard/settings/nav-sync';
|
||||||
|
|
||||||
export const API_GET_MEMBER_INFO = '/settings/member';
|
export const API_GET_MEMBER_INFO = '/settings/member';
|
||||||
export const API_REINDEX_PAGES = '/settings/reindex';
|
export const API_REINDEX_PAGES = '/settings/reindex';
|
||||||
export const API_SEND_MAIL = '/settings/mailer';
|
export const API_SEND_MAIL = '/dashboard/mailer';
|
||||||
|
|
||||||
export const API_LOGIN = '/login';
|
export const API_LOGIN = '/login';
|
||||||
//** ACTIONS TASKS **//
|
//** ACTIONS TASKS **//
|
||||||
|
|
|
@ -9,11 +9,11 @@ export const CONTENT_TYPE_FORM = 'x-www-form-urlencoded';
|
||||||
//** API URLS **//
|
//** API URLS **//
|
||||||
export const API_INIT = '/init/fresh';
|
export const API_INIT = '/init/fresh';
|
||||||
export const API_RESTORE = '/init/restore';
|
export const API_RESTORE = '/init/restore';
|
||||||
export const API_RESET = '/init/reset';
|
export const API_RESET = '/dashboard/settings/reset';
|
||||||
export const API_CREATE_BACKUP = '/backup/create';
|
export const API_CREATE_BACKUP = '/dashboard/settings/backup/create';
|
||||||
export const API_DOWNLOAD_BACKUP = '/backup/download';
|
export const API_DOWNLOAD_BACKUP = '/dashboard/settings/backup/download';
|
||||||
export const API_RESTORE_BACKUP = '/backup/restore';
|
export const API_RESTORE_BACKUP = '/dashboard/settings/backup/restore';
|
||||||
export const API_FILES_UPLOAD = '/upload/files';
|
export const API_FILES_UPLOAD = '/dashboard/uploads';
|
||||||
|
|
||||||
//export const API_RESET_PASS = '/api/v1/reset-password';
|
//export const API_RESET_PASS = '/api/v1/reset-password';
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ export const TASK_BACKUP_RESTORE = 'restoreBackup';
|
||||||
export const TASK_BACKUP_CREATE = 'createBackup';
|
export const TASK_BACKUP_CREATE = 'createBackup';
|
||||||
export const TASK_GET_SECRET = 'retrieveSecret';
|
export const TASK_GET_SECRET = 'retrieveSecret';
|
||||||
export const TASK_RESET_PASS = 'resetPassword';
|
export const TASK_RESET_PASS = 'resetPassword';
|
||||||
export const TASK_UPLOAD_FILES = 'uploadFiles';
|
export const TASK_UPLOAD_FILES = '/task/uploadFiles';
|
||||||
//** API STATUS **//
|
//** API STATUS **//
|
||||||
export const API_ACCESS_GOOD = 'apiUseAuthorized';
|
export const API_ACCESS_GOOD = 'apiUseAuthorized';
|
||||||
export const API_ACCESS_BAD = 'apiUseNotAuthorized';
|
export const API_ACCESS_BAD = 'apiUseNotAuthorized';
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
@extends('frame')
|
|
||||||
|
|
||||||
@section('title', 'The Dash | Edit Navigation')
|
|
||||||
|
|
||||||
@section('main-content')
|
|
||||||
<article class="navigation">
|
|
||||||
<section id="nav-items">
|
|
||||||
@foreach($menu as $item)
|
|
||||||
<div id="{{ $item['id'] }}" class="nav-item" data-slug="{{ $item['slug'] }}" data-uuid="{{ $item['uuid'] }}" data-path="{{ $item['id'] }}">
|
|
||||||
<svg id="move-menu-item" class="icon">
|
|
||||||
<use id="move-menu-item" xlink:href="/assets/images/global/sprite.svg#entypo-select-arrows"/>
|
|
||||||
</svg>
|
|
||||||
<label>{{ $item['title'] }}</label>
|
|
||||||
<div id="nav-btns">
|
|
||||||
<button id="edit-item" class="nav-btn" data-uuid="{{ $item['uuid'] }}" data-id="{{ $item['id'] }}" title="edit page">
|
|
||||||
<svg id="edit-item" class="icon" data-uuid="{{ $item['uuid'] }}" data-id="{{ $item['id'] }}">
|
|
||||||
<use id="edit-item" data-uuid="{{ $item['uuid'] }}" data-id="{{ $item['id'] }}" xlink:href="/assets/images/global/sprite.svg#entypo-edit"/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
<button id="remove-item" class="nav-btn" data-uuid="{{ $item['uuid'] }}" data-id="{{ $item['id'] }}" title="delete from menu">
|
|
||||||
<svg id="remove-item" class="icon" data-uuid="{{ $item['uuid'] }}" data-id="{{ $item['id'] }}">
|
|
||||||
<use id="remove-item" data-uuid="{{ $item['uuid'] }}" data-id="{{ $item['id'] }}" xlink:href="/assets/images/global/sprite.svg#entypo-cross"/>
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endforeach
|
|
||||||
</section>
|
|
||||||
</article>
|
|
||||||
@endsection
|
|
||||||
@section('scripting')
|
|
||||||
<script type="module" src="/assets/scripts/dash/app/EditNav.js"></script>
|
|
||||||
@endsection
|
|
|
@ -1,169 +1,198 @@
|
||||||
@extends('frame')
|
@extends('frame')
|
||||||
|
<?php
|
||||||
|
$status = $settings['status'];
|
||||||
|
$title = $settings['title'];
|
||||||
|
$renderOnSave = $settings['renderOnSave'];
|
||||||
|
?>
|
||||||
|
|
||||||
@section('title', 'The Dash | '. $title)
|
@section('title', 'The Dash | '. $settings['title'])
|
||||||
|
|
||||||
@section('main-content')
|
@section('main-content')
|
||||||
<article class="settings">
|
<article class="settings">
|
||||||
<div class="tab-toolbar" role="toolbar">
|
<div class="tab-toolbar" role="toolbar">
|
||||||
<button id="profile" class="tab-button">PROFILE</button>
|
<button id="profile" class="tab-button">PROFILE</button>
|
||||||
<button id="features" class="tab-button">FEATURES</button>
|
<button id="features" class="tab-button">FEATURES</button>
|
||||||
<button id="themes" class="tab-button">THEMES</button>
|
<button id="themes" class="tab-button">THEMES</button>
|
||||||
</div>
|
<button id="menu" class="tab-button">MENU</button>
|
||||||
<section class="settings-tabs">
|
</div>
|
||||||
<section id="site-profile" class="section-tab show">
|
<section class="settings-tabs">
|
||||||
<div class="member-avatar">
|
<section id="site-profile" class="section-tab show">
|
||||||
<div class="avatar" style="background: url({{ $member['avatar'] }} ) no-repeat center center / cover"></div>
|
<div class="member-avatar">
|
||||||
<input id="avatar-upload" type="file" name="avatar-upload"/>
|
<div class="avatar" style="background: url({{$settings['member']['avatar']}} ) no-repeat center center / cover"></div>
|
||||||
</div>
|
<input id="avatar-upload" type="file" name="avatar-upload" />
|
||||||
<div class="site-background">
|
</div>
|
||||||
<div class="background" style="background: url({{ $background }} ) no-repeat center center / cover"></div>
|
<div class="site-background">
|
||||||
<input id="background-upload" type="file" name="backgrond-upload"/>
|
<div class="background" style="background: url({{$settings['background']}} ) no-repeat center center / cover"></div>
|
||||||
</div>
|
<input id="background-upload" type="file" name="backgrond-upload" />
|
||||||
<div>
|
|
||||||
<input type='text' class="input-dark" name='handle' id='settings-handle' placeholder='handle' value="{{ $member['handle'] }}" autofocus/>
|
|
||||||
<input type='text' class="input-dark" name='email' id='settings-email' placeholder='email' value="{{ $member['email'] }}" autofocus/>
|
|
||||||
<input type='hidden' name='member-id' id='member-id' value="{{ $member['id'] }}"/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input type='text' class="input-dark" name='base-url' id='settings-url' placeholder='url' value="{{ $baseUrl }}" autofocus/>
|
|
||||||
<input type='text' class="input-dark" name='base-title' id='settings-title' placeholder='site title' value="{{ $siteTitle }}" autofocus/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<textarea id="settings-desc" class="input-dark" type='text' name='settings_desc' class='settings-dec' placeholder='description stuff' , autofocus>{{ $desc }}</textarea>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<label>API KEY</label>
|
|
||||||
<span>{{ $member['key'] }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label>FORM TOKEN</label><br/>
|
<input type='text' class="input-dark" name='handle' id='settings-handle' placeholder='handle' value="{{$settings['member']['handle']}}" autofocus />
|
||||||
<span>{{ $ftoken }}</span>
|
<input type='text' class="input-dark" name='email' id='settings-email' placeholder='email' value="{{$settings['member']['email']}}" autofocus />
|
||||||
|
<input type='hidden' name='member-id' id='member-id' value="{{$settings['member']['id']}}" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section id="site-features" class="section-tab hide">
|
|
||||||
<div class="features-mail">
|
|
||||||
<button id="send-test-mail">
|
|
||||||
<svg id="nav-menu-icon" class="icon">
|
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-mail-with-circle"/>
|
|
||||||
</svg>
|
|
||||||
<span>TEST MAIL</span>
|
|
||||||
</button>
|
|
||||||
<div>
|
<div>
|
||||||
<label>SYSTEM EMAIL</label><br />
|
<input type='text' class="input-dark" name='base-url' id='settings-url' placeholder='url' value="{{$settings['baseUrl']}}" autofocus />
|
||||||
set email settings in .env file
|
<input type='text' class="input-dark" name='base-title' id='settings-title' placeholder='site title' value="{{$settings['siteTitle']}}" autofocus />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
<div class="site-options">
|
<textarea id="settings-desc" class="input-dark" type='text' name='settings_desc' class='settings-dec' placeholder='description stuff' , autofocus>{{$settings['desc']}}</textarea>
|
||||||
<div class="option-container">
|
|
||||||
<svg id="nav-menu-icon" class="icon">
|
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-landline"/>
|
|
||||||
</svg>
|
|
||||||
@if(isset($apiStatus) && $apiStatus == 'true')
|
|
||||||
<button id="api-access-toggle" title="allow external api" data-enabled="true">
|
|
||||||
<span id="api-status">API ACCESS ENABLED</span>
|
|
||||||
</button>
|
|
||||||
@else
|
|
||||||
<button id="api-access-toggle" title="allow external api" data-enabled="false">
|
|
||||||
|
|
||||||
<span id="api-status">API ACCESS NOT ENABLED</span>
|
|
||||||
</button>
|
|
||||||
@endif
|
|
||||||
</div>
|
</div>
|
||||||
<div class="option-container">
|
<div>
|
||||||
<svg id="nav-menu-icon" class="icon">
|
<div>
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-cycle"/>
|
<label>API KEY</label>
|
||||||
</svg>
|
<span>{{$settings['member']['key']}}</span>
|
||||||
@if(isset($dynamicRenderStatus) && $dynamicRenderStatus == 'true')
|
</div>
|
||||||
<button id="dynamic-render-toggle" title="allow external api" data-enabled="true">
|
<div>
|
||||||
<span id="dynamic-render-status">DYNAMIC PAGE RENDERING</span>
|
<label>FORM TOKEN</label><br />
|
||||||
</button>
|
<span>{{$settings['ftoken']}}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
@else
|
|
||||||
<button id="dynamic-render-toggle" title="allow external api" data-enabled="false">
|
|
||||||
<span id="dynamic-render-status">STATIC PAGE RENDERING</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
@endif
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
<div class="site-maintenance">
|
<section id="site-features" class="section-tab hide">
|
||||||
<div class="option-container">
|
<div class="features-mail">
|
||||||
<svg id="nav-menu-icon" class="icon">
|
<button id="send-test-mail">
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-copy"/>
|
<svg id="nav-menu-icon" class="icon">
|
||||||
</svg>
|
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-mail-with-circle" />
|
||||||
<button id="create-content-backup">
|
</svg>
|
||||||
<span>CONTENT BACKUP</span>
|
<span>TEST MAIL</span>
|
||||||
</button>
|
</button>
|
||||||
<span>
|
<div>
|
||||||
@if($lastContentBackup != '')
|
<label>SYSTEM EMAIL</label><br />
|
||||||
MOST RECENT:
|
set email settings in .env file
|
||||||
<a href="/backup/content-download">{{ $lastContentBackup }}</a><br/>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="site-options">
|
||||||
|
<div class="option-container">
|
||||||
|
<svg id="nav-menu-icon" class="icon">
|
||||||
|
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-landline" />
|
||||||
|
</svg>
|
||||||
|
@if(isset($settings['apiStatus']) && $settings['apiStatus'] == 'true')
|
||||||
|
<button id="api-access-toggle" title="allow external api" data-enabled="true">
|
||||||
|
<span id="api-status">API ACCESS ENABLED</span>
|
||||||
|
</button>
|
||||||
@else
|
@else
|
||||||
<span>span No back ups. Frowny face.</span>
|
<button id="api-access-toggle" title="allow external api" data-enabled="false">
|
||||||
|
|
||||||
|
<span id="api-status">API ACCESS NOT ENABLED</span>
|
||||||
|
</button>
|
||||||
@endif
|
@endif
|
||||||
<span>
|
</div>
|
||||||
</div>
|
<div class="option-container">
|
||||||
<div class="option-container">
|
<svg id="nav-menu-icon" class="icon">
|
||||||
<svg id="nav-menu-icon" class="icon">
|
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-cycle" />
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-images"/>
|
</svg>
|
||||||
</svg>
|
@if(isset($settings['dynamicRenderStatus']) && $settings['dynamicRenderStatus'] == 'true')
|
||||||
<button id="create-file-backup">
|
<button id="dynamic-render-toggle" title="allow external api" data-enabled="true">
|
||||||
<span>FILE BACKUP</span>
|
<span id="dynamic-render-status">DYNAMIC PAGE RENDERING</span>
|
||||||
</button>
|
</button>
|
||||||
<span>
|
|
||||||
@if($lastFilesBackup != '')
|
|
||||||
MOST RECENT:
|
|
||||||
<a href="/backup/files-download">{{ $lastFilesBackup }}</a><br/>
|
|
||||||
@else
|
@else
|
||||||
<span>span No back ups. Frowny face.</span>
|
<button id="dynamic-render-toggle" title="allow external api" data-enabled="false">
|
||||||
|
<span id="dynamic-render-status">STATIC PAGE RENDERING</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
</span>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="option-container">
|
<div class="site-maintenance">
|
||||||
<svg id="nav-menu-icon" class="icon">
|
<div class="option-container">
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-back-in-time"/>
|
<svg id="nav-menu-icon" class="icon">
|
||||||
</svg>
|
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-copy" />
|
||||||
<button id="reset-to-default">
|
</svg>
|
||||||
<span>RESET TO DEFAULT</span>
|
<button id="create-content-backup">
|
||||||
</button>
|
<span>CONTENT BACKUP</span>
|
||||||
<span>Deletes all content and configs <strong>CANNOT UNDO</strong></span>
|
</button>
|
||||||
|
<span>
|
||||||
|
@if($settings['lastContentBackup'] != '')
|
||||||
|
MOST RECENT:
|
||||||
|
<a href="/dashboard/settings/backup/get/content-download">{{$settings['lastContentBackup']}}</a><br />
|
||||||
|
@else
|
||||||
|
<span>span No back ups. Frowny face.</span>
|
||||||
|
@endif
|
||||||
|
<span>
|
||||||
|
</div>
|
||||||
|
<div class="option-container">
|
||||||
|
<svg id="nav-menu-icon" class="icon">
|
||||||
|
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-images" />
|
||||||
|
</svg>
|
||||||
|
<button id="create-file-backup">
|
||||||
|
<span>FILE BACKUP</span>
|
||||||
|
</button>
|
||||||
|
<span>
|
||||||
|
@if($settings['lastFilesBackup'] != '')
|
||||||
|
MOST RECENT:
|
||||||
|
<a href="/dashboard/settings/backup/get/files-download">{{$settings['lastFilesBackup']}}</a><br />
|
||||||
|
@else
|
||||||
|
<span>span No back ups. Frowny face.</span>
|
||||||
|
@endif
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="option-container">
|
||||||
|
<svg id="nav-menu-icon" class="icon">
|
||||||
|
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-back-in-time" />
|
||||||
|
</svg>
|
||||||
|
<button id="reset-to-default">
|
||||||
|
<span>RESET TO DEFAULT</span>
|
||||||
|
</button>
|
||||||
|
<span>Deletes all content and configs <strong>CANNOT UNDO</strong></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</section>
|
<section id="site-themes" class="section-tab hide">
|
||||||
<section id="site-themes" class="section-tab hide">
|
@foreach($settings['themes'] as $theme)
|
||||||
@foreach($themes as $theme)
|
@if($theme['name'] == $settings['currentTheme'])
|
||||||
@if($theme['name'] == $currentTheme)
|
<!--
|
||||||
<!--
|
|
||||||
<a target="_blank" href='/theme'>Edit</a>
|
<a target="_blank" href='/theme'>Edit</a>
|
||||||
-->
|
-->
|
||||||
<button id="{{ $theme['name'] }}" class="theme-select" data-enabled="true">
|
<button id="{{$theme['name']}}" class="theme-select" data-enabled="true">
|
||||||
<div for="{{ $theme['name'] }}">
|
<div for="{{$theme['name']}}">
|
||||||
<label id="label-{{ $theme['name'] }}">ACTIVE THEME</label>
|
<label id="label-{{$theme['name']}}">ACTIVE THEME</label>
|
||||||
</div>
|
</div>
|
||||||
<svg id="nav-menu-icon" class="icon">
|
<svg id="nav-menu-icon" class="icon">
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-palette"/>
|
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-palette" />
|
||||||
|
</svg>
|
||||||
|
<span for="{{$theme['name']}}">{{$theme['display-name']}}</span>
|
||||||
|
</button>
|
||||||
|
@else
|
||||||
|
<button id="{{$theme['name']}}" class="theme-select" data-enabled="false">
|
||||||
|
<div for="{{$theme['name']}}">
|
||||||
|
<label id="label-{{$theme['name']}}">INACTIVE THEME</label>
|
||||||
|
</div>
|
||||||
|
<svg id="nav-menu-icon" class="icon">
|
||||||
|
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-palette" />
|
||||||
|
</svg>
|
||||||
|
<span for="{{$theme['name']}}">{{$theme['display-name']}}</span>
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</section>
|
||||||
|
<section id="site-menu" class="section-tab hide">
|
||||||
|
@foreach($nav['menu'] as $item)
|
||||||
|
<div id="{{$item['id']}}" class="nav-item" data-slug="{{$item['slug']}}" data-uuid="{{$item['uuid']}}" data-path="{{$item['id']}}">
|
||||||
|
<svg id="move-menu-item" class="icon">
|
||||||
|
<use id="move-menu-item" xlink:href="/assets/images/global/sprite.svg#entypo-select-arrows" />
|
||||||
</svg>
|
</svg>
|
||||||
<span for="{{ $theme['name'] }}">{{ $theme['display-name'] }}</span>
|
<label>@php echo urldecode($item['title']) @endphp</label>
|
||||||
</button>
|
<div id="nav-btns">
|
||||||
@else
|
<button id="edit-item" class="nav-btn" data-uuid="{{$item['uuid']}}" data-id="{{$item['id']}}" title="edit page">
|
||||||
<button id="{{ $theme['name'] }}" class="theme-select" data-enabled="false">
|
<svg id="edit-item" class="icon" data-uuid="{{$item['uuid']}}" data-id="{{$item['id']}}">
|
||||||
<div for="{{ $theme['name'] }}">
|
<use id="edit-item" data-uuid="{{$item['uuid']}}" data-id="{{$item['id']}}" xlink:href="/assets/images/global/sprite.svg#entypo-edit" />
|
||||||
<label id="label-{{ $theme['name'] }}">INACTIVE THEME</label>
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button id="remove-item" class="nav-btn" data-uuid="{{$item['uuid']}}" data-id="{{$item['id']}}" title="delete from menu">
|
||||||
|
<svg id="remove-item" class="icon" data-uuid="{{$item['uuid']}}" data-id="{{$item['id']}}">
|
||||||
|
<use id="remove-item" data-uuid="{{$item['uuid']}}" data-id="{{$item['id']}}" xlink:href="/assets/images/global/sprite.svg#entypo-cross" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<svg id="nav-menu-icon" class="icon">
|
</div>
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-palette"/>
|
@endforeach
|
||||||
</svg>
|
</section>
|
||||||
<span for="{{ $theme['name'] }}">{{ $theme['display-name'] }}</span>
|
|
||||||
</button>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</article>
|
||||||
</article>
|
@endsection
|
||||||
@endsection
|
@section('scripting')
|
||||||
@section('scripting')
|
<script type="module" src="/assets/scripts/dash/app/EditSettings.js"></script>
|
||||||
<script type="module" src="/assets/scripts/dash/app/EditSettings.js"></script>
|
<script type="module" src="/assets/scripts/dash/app/EditNav.js"></script>
|
||||||
@endsection
|
@endsection
|
|
@ -1,38 +1,38 @@
|
||||||
@extends('frame')
|
@extends('frame')
|
||||||
|
|
||||||
@section('title', 'The Dash | Start')
|
@section('title', 'The Dash | Start')
|
||||||
|
|
||||||
@section('main-content')
|
@section('main-content')
|
||||||
<section class="index-header">
|
<section class="index-header">
|
||||||
<div class="index-header-left">
|
<div class="index-header-left">
|
||||||
<h1>Recent</h1>
|
<h1>Recent</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="index-header-right"></div>
|
<div class="index-header-right"></div>
|
||||||
</section>
|
</section>
|
||||||
<section class="index-recent-pages">
|
<section class="index-recent-pages">
|
||||||
@if($result['entryCount'] != 0)
|
@if($result['entryCount'] != 0)
|
||||||
@foreach($result['pages'] as $page)
|
@foreach($result['pages'] as $page)
|
||||||
@php
|
@php
|
||||||
$type = '';
|
$type = '';
|
||||||
$file = '';
|
$file = '';
|
||||||
isset($page['media'][0]['type']) ? $type = $page['media'][0]['type'] : $type = '';
|
isset($page['media'][0]['type']) ? $type = $page['media'][0]['type'] : $type = '';
|
||||||
isset($page['media'][0]['file']) ? $file = $page['media'][0]['file'] : $file = '';
|
isset($page['media'][0]['file']) ? $file = $page['media'][0]['file'] : $file = '';
|
||||||
@endphp
|
@endphp
|
||||||
@if($type =='mp4')
|
@if($type =='mp4')
|
||||||
<a href="/dashboard/page/edit/{{ $page['uuid'] }}" id="{{ $page['uuid'] }}" class="post-video-link recent-link">
|
<a href="/dashboard/page/edit/{{$page['uuid']}}" id="{{$page['uuid']}}" class="post-video-link recent-link">
|
||||||
@include('includes.recent-meta')
|
@include('includes.recent-meta')
|
||||||
<video class="post-video" loop muted autoplay>
|
<video class="post-video" loop muted autoplay>
|
||||||
<source src="{{ $file }}" type="video/mp4">
|
<source src="{{$file}}" type="video/mp4">
|
||||||
Sorry, your browser doesn't support embedded videos.
|
Sorry, your browser doesn't support embedded videos.
|
||||||
</video>
|
</video>
|
||||||
</a>
|
</a>
|
||||||
@else
|
@else
|
||||||
<a href="/dashboard/page/edit/{{ $page['uuid'] }}" id="{{ $page['uuid'] }}" class="post-link recent-link" style="background: url({{ $file }}) no-repeat center center / cover #cf436b">
|
<a href="/dashboard/pages/edit/{{$page['uuid']}}" id="{{$page['uuid']}}" class="post-link recent-link" style="background: url({{$file}}) no-repeat center center / cover #cf436b">
|
||||||
@include('includes.recent-meta')
|
@include('includes.recent-meta')
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
|
@ -8,6 +8,7 @@
|
||||||
@include('includes.submenu-start')
|
@include('includes.submenu-start')
|
||||||
@break
|
@break
|
||||||
|
|
||||||
|
@case("Add New")
|
||||||
@case("Edit Page")
|
@case("Edit Page")
|
||||||
@include('includes.submenu-edit-page')
|
@include('includes.submenu-edit-page')
|
||||||
@break
|
@break
|
||||||
|
@ -17,11 +18,6 @@
|
||||||
<use id="nav-settings-icon" xlink:href="/assets/images/global/sprite.svg#entypo-cog" />
|
<use id="nav-settings-icon" xlink:href="/assets/images/global/sprite.svg#entypo-cog" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
<a id="navigation" class="main-nav-secondary-highlight" href="/dashboard/navigation" title="edit navigation">
|
|
||||||
<svg id="nav-menu-icon" class="icon">
|
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-link" />
|
|
||||||
</svg>
|
|
||||||
</a>
|
|
||||||
<a id="navigation" class="main-nav-secondary-highlight" href="/dashboard/logout" title="log out">
|
<a id="navigation" class="main-nav-secondary-highlight" href="/dashboard/logout" title="log out">
|
||||||
<svg id="nav-logout-icon" class="icon">
|
<svg id="nav-logout-icon" class="icon">
|
||||||
<use id="nav-logout-icon" xlink:href="/assets/images/global/sprite.svg#entypo-log-out" />
|
<use id="nav-logout-icon" xlink:href="/assets/images/global/sprite.svg#entypo-log-out" />
|
||||||
|
@ -55,11 +51,6 @@
|
||||||
<use id="nav-settings-icon" xlink:href="/assets/images/global/sprite.svg#entypo-cog" />
|
<use id="nav-settings-icon" xlink:href="/assets/images/global/sprite.svg#entypo-cog" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
<a id="navigation" class="main-nav-secondary-highlight" href="/dashboard/navigation" title="edit navigation">
|
|
||||||
<svg id="nav-menu-icon" class="icon">
|
|
||||||
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-link" />
|
|
||||||
</svg>
|
|
||||||
</a>
|
|
||||||
<a id="navigation" class="main-nav-secondary-highlight" href="/dashboard/logout" title="log out">
|
<a id="navigation" class="main-nav-secondary-highlight" href="/dashboard/logout" title="log out">
|
||||||
<svg id="nav-logout-icon" class="icon">
|
<svg id="nav-logout-icon" class="icon">
|
||||||
<use id="nav-logout-icon" xlink:href="/assets/images/global/sprite.svg#entypo-log-out" />
|
<use id="nav-logout-icon" xlink:href="/assets/images/global/sprite.svg#entypo-log-out" />
|
||||||
|
|
|
@ -42,7 +42,7 @@ if(isset($page['uuid']))
|
||||||
<svg id="option-published-icon" class="icon">
|
<svg id="option-published-icon" class="icon">
|
||||||
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-globe" />
|
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-globe" />
|
||||||
</svg>
|
</svg>
|
||||||
</button><a href="/theme/view/page/{{$uuid}}" target="_blank"><button id="option-preview" class="option-inactive post-option-btn" data-active="false" title='preview page' aria-label="preview post">
|
</button><a href="/dashboard/themekit/view/page/{{$uuid}}" target="_blank"><button id="option-preview" class="option-inactive post-option-btn" data-active="false" title='preview page' aria-label="preview post">
|
||||||
<svg id="option-preview-icon" class="icon">
|
<svg id="option-preview-icon" class="icon">
|
||||||
<use id="option-preview-icon" xlink:href="/assets/images/global/sprite.svg#entypo-eye" />
|
<use id="option-preview-icon" xlink:href="/assets/images/global/sprite.svg#entypo-eye" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
@php
|
<?php
|
||||||
|
|
||||||
if($page['menu'] == 'true')
|
if($page['menu'] == 'true')
|
||||||
{
|
{
|
||||||
|
@ -21,35 +21,35 @@ if($page['featured'] == 'true')
|
||||||
$featured = 'false';
|
$featured = 'false';
|
||||||
}
|
}
|
||||||
|
|
||||||
@endphp
|
?>
|
||||||
|
|
||||||
<aside>
|
<aside>
|
||||||
<strong>
|
<strong>
|
||||||
{{ $page['updated'] }}
|
{{$page['updated']}}
|
||||||
</strong>
|
</strong>
|
||||||
<hr/>
|
<hr />
|
||||||
<strong>
|
<strong>
|
||||||
@php
|
@php
|
||||||
$title = urldecode($page['title']);
|
$title = urldecode($page['title']);
|
||||||
@endphp
|
@endphp
|
||||||
{{ $title }}
|
{{$title}}
|
||||||
</strong>
|
</strong>
|
||||||
<hr/>
|
<hr />
|
||||||
<button data-active="{{ $menu }}">
|
<button data-active="{{$menu}}">
|
||||||
<svg id="option-menu-pin" class="icon">
|
<svg id="option-menu-pin" class="icon">
|
||||||
<use id="option-menu-pin" xlink:href="/assets/images/global/sprite.svg#entypo-pin"/>
|
<use id="option-menu-pin" xlink:href="/assets/images/global/sprite.svg#entypo-pin" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<button data-active="{{ $published }}">
|
<button data-active="{{$published}}">
|
||||||
<svg id="option-published-icon" class="icon">
|
<svg id="option-published-icon" class="icon">
|
||||||
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-globe"/>
|
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-globe" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button data-active="{{ $featured }}">
|
<button data-active="{{$featured}}">
|
||||||
<svg id="option-feature-icon" class="icon">
|
<svg id="option-feature-icon" class="icon">
|
||||||
<use id="option-feature-icon" xlink:href="/assets/images/global/sprite.svg#entypo-star"/>
|
<use id="option-feature-icon" xlink:href="/assets/images/global/sprite.svg#entypo-star" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</aside>
|
</aside>
|
|
@ -4,7 +4,7 @@
|
||||||
<use id="option-menu-pin" xlink:href="/assets/images/global/sprite.svg#minicute-book" />
|
<use id="option-menu-pin" xlink:href="/assets/images/global/sprite.svg#minicute-book" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
<a class="main-nav-primary" href='/dashboard/page/add/new' title="add new page">
|
<a class="main-nav-primary" href='/dashboard/pages/add/new' title="add new page">
|
||||||
<svg id="option-menu-pin" class="icon">
|
<svg id="option-menu-pin" class="icon">
|
||||||
<use id="option-menu-pin" xlink:href="/assets/images/global/sprite.svg#entypo-squared-plus" />
|
<use id="option-menu-pin" xlink:href="/assets/images/global/sprite.svg#entypo-squared-plus" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|
|
@ -1,23 +1,23 @@
|
||||||
@extends('frame')
|
@extends('frame')
|
||||||
|
|
||||||
@section('title', 'The Dash | Fipamo Theme Kit')
|
@section('title', 'The Dash | Fipamo Theme Kit')
|
||||||
|
|
||||||
@section('main-content')
|
@section('main-content')
|
||||||
<section class="index-header">
|
<section class="index-header">
|
||||||
<div class="index-header-left">
|
<div class="index-header-left">
|
||||||
<h1>Templates</h1>
|
<h1>Templates</h1>
|
||||||
<h2>Base</h2>
|
<h2>Base</h2>
|
||||||
<a class="secondary" href="/theme/view/index">Index</a><br />
|
<a class="secondary" href="/dashboard/themekit/view/index">Index</a><br />
|
||||||
<a class="secondary" href="/theme/view/page">Page</a><br />
|
<a class="secondary" href="/dashboard/themekit/view/page">Page</a><br />
|
||||||
<a class="secondary" href="/theme/view/tags">Tags</a><br />
|
<a class="secondary" href="/dashboard/themekit/view/tags">Tags</a><br />
|
||||||
<a class="secondary" href="/theme/view/archive">Archive</a><br />
|
<a class="secondary" href="/dashboard/themekit/view/archive">Archive</a><br />
|
||||||
<h2>Custom</h2>
|
<h2>Custom</h2>
|
||||||
@foreach($pages as $view)
|
@foreach($pages as $view)
|
||||||
@if($view != 'page')
|
@if($view != 'page')
|
||||||
<a href="/theme/view/{{ $view }}" class="secondary" href="">{{ $view }}</a><br />
|
<a href="/dashboard/themekit/view/{{$view}}" class="secondary" href="">{{$view}}</a><br />
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
<div class="index-header-right"></div>
|
<div class="index-header-right"></div>
|
||||||
</section>
|
</section>
|
||||||
@endsection
|
@endsection
|
|
@ -1,28 +1,74 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use App\Http\Controllers\RouteGetController;
|
use App\Http\Controllers\FrontController;
|
||||||
use App\Http\Controllers\RoutePostController;
|
use App\Http\Controllers\PageController;
|
||||||
use App\Http\Controllers\RoutePutController;
|
use App\Http\Controllers\DashController;
|
||||||
use App\Http\Controllers\RouteDeleteController;
|
use App\Http\Controllers\SettingsController;
|
||||||
|
use App\Http\Controllers\AuthController;
|
||||||
|
use App\Http\Controllers\ThemeController;
|
||||||
|
use App\Http\Controllers\SystemMailController;
|
||||||
use App\Http\Middleware\VerifyCsrfToken;
|
use App\Http\Middleware\VerifyCsrfToken;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
/*
|
Route::prefix('/')
|
||||||
|--------------------------------------------------------------------------
|
->controller(FrontController::class)
|
||||||
| Web Routes
|
->group(function () {
|
||||||
|--------------------------------------------------------------------------
|
Route::get("/{one?}/{two?}/{three?}", 'start')->where('one', '^((?!dashboard).)*$');
|
||||||
|
|
Route::post("/init/{task}", 'init');
|
||||||
| Here is where you can register web routes for your application. These
|
});
|
||||||
| routes are loaded by the RouteServiceProvider and all of them will
|
|
||||||
| be assigned to the "web" middleware group. Make something great!
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
//REFACTOR: Reorganize routes here intstead of controllers to reduce confusion
|
//login stuff
|
||||||
Route::get("/{first?}/{second?}/{third?}/{four?}", [RouteGetController::class, 'handleRequest']);
|
Route::post("/login", [AuthController::class, 'enter']);
|
||||||
Route::post("/{first?}/{second?}/{third?}", [RoutePostController::class, 'handleRequest'])
|
|
||||||
->middleware(VerifyCsrfToken::class);
|
//Dashboard
|
||||||
Route::put("/{first?}/{second?}/{third?}", [RoutePutController::class, 'handleRequest'])
|
Route::prefix('dashboard')
|
||||||
->middleware(VerifyCsrfToken::class);
|
->middleware('member.check')
|
||||||
Route::delete("/{first?}/{second?}/{third?}", [RouteDeleteController::class, 'handleRequest'])
|
->controller(DashController::class)
|
||||||
->middleware(VerifyCsrfToken::class);
|
->group(function () {
|
||||||
|
Route::get("/", 'login')->withoutMiddleware('member.check');
|
||||||
|
Route::get("/start", 'start');
|
||||||
|
Route::get("/logout", 'logout');
|
||||||
|
Route::post("/uploads", 'uploads');
|
||||||
|
})->name('dashboard');
|
||||||
|
|
||||||
|
//Pages
|
||||||
|
Route::prefix('dashboard/pages')
|
||||||
|
->middleware('member.check')
|
||||||
|
->controller(PageController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get("/{pageFilter?}/{pageNum?}", 'start');
|
||||||
|
Route::get("/{mode?}/{uuid?}", 'start');
|
||||||
|
Route::put("/write", 'write');
|
||||||
|
Route::post("/create", 'create');
|
||||||
|
Route::delete("/delete", 'delete');
|
||||||
|
});
|
||||||
|
|
||||||
|
//Settings
|
||||||
|
Route::prefix('dashboard/settings')
|
||||||
|
->middleware('member.check')
|
||||||
|
->controller(SettingsController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get("/", 'start');
|
||||||
|
Route::put("/{task}", 'tasks');
|
||||||
|
Route::put("/backup/create", 'createBackup');
|
||||||
|
Route::get("/backup/get/{type}", 'downloadBackup');
|
||||||
|
Route::post("/reset", 'reset');
|
||||||
|
});
|
||||||
|
|
||||||
|
//mailer
|
||||||
|
Route::prefix('dashboard/mailer')
|
||||||
|
->middleware('member.check')
|
||||||
|
->controller(SystemMailController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::post("/", 'sendNotify');
|
||||||
|
});
|
||||||
|
|
||||||
|
//themekit
|
||||||
|
Route::prefix('dashboard/themekit')
|
||||||
|
->middleware('member.check')
|
||||||
|
->controller(ThemeController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get("/", 'start');
|
||||||
|
Route::get("/view/{view?}/{id?}", 'getView');
|
||||||
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue