cleaned up page edit template, fix formatting
cleaned up the page edit template a bit to make it easier to convert to the new editor UI. php formatting also needed to be updated, so the php cs fixer file was updated and added some setting to prettier to handle blade files
This commit is contained in:
parent
47dfdbb7fc
commit
16856f6c25
7 changed files with 221 additions and 215 deletions
|
@ -55,20 +55,15 @@ return $config
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'no_multiline_whitespace_around_double_arrow' => true,
|
'no_multiline_whitespace_around_double_arrow' => true,
|
||||||
'no_spaces_around_offset' => true,
|
|
||||||
'no_unused_imports' => true,
|
|
||||||
'no_whitespace_before_comma_in_array' => true,
|
'no_whitespace_before_comma_in_array' => true,
|
||||||
'no_whitespace_in_blank_line' => true,
|
'no_whitespace_in_blank_line' => true,
|
||||||
'object_operator_without_whitespace' => true,
|
'object_operator_without_whitespace' => true,
|
||||||
'single_blank_line_before_namespace' => true,
|
|
||||||
'ternary_operator_spaces' => true,
|
'ternary_operator_spaces' => true,
|
||||||
'trim_array_spaces' => true,
|
'trim_array_spaces' => true,
|
||||||
'unary_operator_spaces' => true,
|
'unary_operator_spaces' => true,
|
||||||
'whitespace_after_comma_in_array' => true,
|
'whitespace_after_comma_in_array' => true,
|
||||||
'single_line_after_imports' => true,
|
'single_line_after_imports' => true,
|
||||||
'ordered_imports' => [
|
//'single_blank_line_before_namespace' => true, php fixer doesn't like this rule?
|
||||||
'sort_algorithm' => 'none',
|
|
||||||
],
|
|
||||||
//Other rules here...
|
//Other rules here...
|
||||||
])
|
])
|
||||||
->setLineEnding("\n");
|
->setLineEnding("\n");
|
||||||
|
|
10
.prettierrc
10
.prettierrc
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
|
"plugins": ["@shufo/prettier-plugin-blade"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{ "files": ".prettierrc", "options": { "parser": "json" } },
|
||||||
"files": ".prettierrc",
|
|
||||||
"options": { "parser": "json" }
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"files": "*.css",
|
"files": "*.css",
|
||||||
"options": {
|
"options": {
|
||||||
|
@ -31,6 +29,10 @@
|
||||||
"tabWidth": 4,
|
"tabWidth": 4,
|
||||||
"printWidth": 90
|
"printWidth": 90
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["*.blade.php"],
|
||||||
|
"options": { "parser": "blade", "tabWidth": 4 }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,12 +92,50 @@ class DashController extends Controller
|
||||||
$mode == 'edit' ? $title = $page['title'] : $title = 'Add New';
|
$mode == 'edit' ? $title = $page['title'] : $title = 'Add New';
|
||||||
$mode == 'edit' ? $views = $this->themes->getCustomViews($page['layout']) : $views[] = 'page';
|
$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'];
|
||||||
|
} else {
|
||||||
|
$id = "";
|
||||||
|
$uuid = "";
|
||||||
|
$slug = "";
|
||||||
|
$feature = "";
|
||||||
|
$layout = "";
|
||||||
|
$tags = "";
|
||||||
|
$content = "";
|
||||||
|
$date = "";
|
||||||
|
$updated = "";
|
||||||
|
$media = "";
|
||||||
|
$files = "";
|
||||||
|
};
|
||||||
|
|
||||||
return view('back.page', [
|
return view('back.page', [
|
||||||
"status" => $this->member::status(),
|
"status" => $this->member::status(),
|
||||||
"mode" => $mode,
|
"mode" => $mode,
|
||||||
"page" => $page,
|
"page" => $page,
|
||||||
"views" => $views,
|
"views" => $views,
|
||||||
"title" => $title,
|
"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),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,4 @@
|
||||||
@extends('frame')
|
@extends('frame')
|
||||||
|
|
||||||
@php
|
|
||||||
$title = urldecode($title);
|
|
||||||
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'];
|
|
||||||
}else{
|
|
||||||
$id = "";
|
|
||||||
$uuid = "";
|
|
||||||
$slug = "";
|
|
||||||
$feature = "";
|
|
||||||
$layout = "";
|
|
||||||
$tags = "";
|
|
||||||
$content = "";
|
|
||||||
$date = "";
|
|
||||||
$updated = "";
|
|
||||||
$media = "";
|
|
||||||
$files = "";
|
|
||||||
}
|
|
||||||
@endphp
|
|
||||||
@section('title', 'The Dash | Editing '. $title)
|
@section('title', 'The Dash | Editing '. $title)
|
||||||
|
|
||||||
@section('main-content')
|
@section('main-content')
|
||||||
|
@ -47,95 +17,15 @@
|
||||||
</div>
|
</div>
|
||||||
<label class="list-title">IMAGES AND VIDEO</label>
|
<label class="list-title">IMAGES AND VIDEO</label>
|
||||||
<div id="page-images-list" class="page-images-list">
|
<div id="page-images-list" class="page-images-list">
|
||||||
@if(count($media)>1)
|
@include('includes.media-list')
|
||||||
@foreach($media as $item)
|
|
||||||
@if($item['type'] == "mp4")
|
|
||||||
<div id="{{ $loop->index }}" class="video-item" data-id="{{ $item['file'] }}">
|
|
||||||
<video>
|
|
||||||
<source src="{{ $item['file'] }}"/>
|
|
||||||
</video>
|
|
||||||
<button id="{{ $loop->index }}" class="media-remove">
|
|
||||||
X
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<div id="{{ $loop->index }}" class="img-item" data-id="{{ $item['file'] }}" style="background: url({{ $item['file'] }}) no-repeat center center / cover">
|
|
||||||
<button id="{{ $loop->index }}" class="media-remove">
|
|
||||||
X
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
@else
|
|
||||||
@if($media[0] != '')
|
|
||||||
@if($media[0]['type'] == "mp4")
|
|
||||||
<div id="0" class="video-item" data-id="{{ $media[0]['file'] }}">
|
|
||||||
<button id="0" class="media-remove">X</button>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<div id="0" class="img-item" data-id="{{ $media[0]['file'] }}" style="background: url({{ $media[0]['file'] }}) no-repeat center center / cover">
|
|
||||||
<button id="0" class="media-remove">X</button>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
</div>
|
</div>
|
||||||
<label class="list-title">FILES</label>
|
<label class="list-title">FILES</label>
|
||||||
<div class="page-files-list">
|
<div class="page-files-list">
|
||||||
@if(count($files) > 1)
|
@include('includes.files-list')
|
||||||
@foreach($files as $item)
|
|
||||||
@php
|
|
||||||
$fileName = explode("/", $item['file']);
|
|
||||||
@endphp
|
|
||||||
@if($item['type'] == "mp3")
|
|
||||||
<div id="{{ $loop->index }}" class="audio-item" data-id="{{ $item['file'] }}">
|
|
||||||
<audio controls>
|
|
||||||
<source src="{{ $item['file'] }}"/>
|
|
||||||
</audio>
|
|
||||||
<button id="{{ $loop->index }}" class="media-remove">
|
|
||||||
X
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<div id="{{ $loop->index }}" class="file-item" data-id="{{ $item['file'] }}">
|
|
||||||
<a href="{{ $item['file'] }}" target="_blank">{{ $fileName[6] }}"</a>
|
|
||||||
<button id="{{ $loop->index }}" class="media-remove">
|
|
||||||
X
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
</section>
|
||||||
@else
|
<section class="page-meta">
|
||||||
@if(isset($files[0]) && $files[0] != '')
|
|
||||||
@php
|
|
||||||
$fileName = explode("/", $item['file']);
|
|
||||||
@endphp
|
|
||||||
@if($files[0]['type'] == "mp3")
|
|
||||||
<div id="0" class="audio-item" data-id="{{ $files[0]['file'] }}">
|
|
||||||
<audio controls>
|
|
||||||
<source src="{{ $files[0]['file'] }}"/>
|
|
||||||
</audio>
|
|
||||||
<button id="{{ $loop->index }}" class="media-remove">
|
|
||||||
X
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
@else
|
|
||||||
<div id="0" class="file-item" data-id="{{ $files[0]['file'] }}">
|
|
||||||
<a href="{{ $item['file'] }}" target="_blank">{{ $fileName[6] }}"</a>
|
|
||||||
<button id="{{ $loop->index }}" class="media-remove">
|
|
||||||
X
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
@else
|
|
||||||
|
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@endif
|
|
||||||
</section><section class="page-meta">
|
|
||||||
<div class="page-meta-wrapper">
|
<div class="page-meta-wrapper">
|
||||||
<div class="page-title">
|
<div class="page-title">
|
||||||
<strong>TITLE</strong>
|
<strong>TITLE</strong>
|
||||||
|
@ -174,7 +64,8 @@
|
||||||
</span>
|
</span>
|
||||||
<input id="page-files-upload" type="file" name="page-files-upload" multiple />
|
<input id="page-files-upload" type="file" name="page-files-upload" multiple />
|
||||||
<input id="post-image-upload" type="file" name="post-image-upload" />
|
<input id="post-image-upload" type="file" name="post-image-upload" />
|
||||||
<input id="form_token" name="token" type="hidden" value="needtoaddtoken"></div>
|
<input id="form_token" name="token" type="hidden" value="needtoaddtoken">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
50
resources/views/includes/files-list.blade.php
Normal file
50
resources/views/includes/files-list.blade.php
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
@if(count($files) > 1)
|
||||||
|
@foreach($files as $item)
|
||||||
|
@php
|
||||||
|
$fileName = explode("/", $item['file']);
|
||||||
|
@endphp
|
||||||
|
@if($item['type'] == "mp3")
|
||||||
|
<div id="{{$loop->index}}" class="audio-item" data-id="{{$item['file']}}">
|
||||||
|
<audio controls>
|
||||||
|
<source src="{{$item['file']}}" />
|
||||||
|
</audio>
|
||||||
|
<button id="{{$loop->index}}" class="media-remove">
|
||||||
|
X
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div id="{{$loop->index}}" class="file-item" data-id="{{$item['file']}}">
|
||||||
|
<a href="{{$item['file']}}" target="_blank">{{$fileName[6]}}"</a>
|
||||||
|
<button id="{{$loop->index}}" class="media-remove">
|
||||||
|
X
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
@if(isset($files[0]) && $files[0] != '')
|
||||||
|
@php
|
||||||
|
$fileName = explode("/", $item['file']);
|
||||||
|
@endphp
|
||||||
|
@if($files[0]['type'] == "mp3")
|
||||||
|
<div id="0" class="audio-item" data-id="{{$files[0]['file']}}">
|
||||||
|
<audio controls>
|
||||||
|
<source src="{{$files[0]['file']}}" />
|
||||||
|
</audio>
|
||||||
|
<button id="{{$loop->index}}" class="media-remove">
|
||||||
|
X
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div id="0" class="file-item" data-id="{{$files[0]['file']}}">
|
||||||
|
<a href="{{$item['file']}}" target="_blank">{{$fileName[6]}}"</a>
|
||||||
|
<button id="{{$loop->index}}" class="media-remove">
|
||||||
|
X
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@else
|
||||||
|
|
||||||
|
@endif
|
||||||
|
@endif
|
32
resources/views/includes/media-list.blade.php
Normal file
32
resources/views/includes/media-list.blade.php
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
@if(count($media)>1)
|
||||||
|
@foreach($media as $item)
|
||||||
|
@if($item['type'] == "mp4")
|
||||||
|
<div id="{{$loop->index}}" class="video-item" data-id="{{$item['file']}}">
|
||||||
|
<video>
|
||||||
|
<source src="{{$item['file']}}" />
|
||||||
|
</video>
|
||||||
|
<button id="{{$loop->index}}" class="media-remove">
|
||||||
|
X
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div id="{{$loop->index}}" class="img-item" data-id="{{$item['file']}}" style="background: url({{$item['file']}}) no-repeat center center / cover">
|
||||||
|
<button id="{{$loop->index}}" class="media-remove">
|
||||||
|
X
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
@else
|
||||||
|
@if($media[0] != '')
|
||||||
|
@if($media[0]['type'] == "mp4")
|
||||||
|
<div id="0" class="video-item" data-id="{{$media[0]['file']}}">
|
||||||
|
<button id="0" class="media-remove">X</button>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div id="0" class="img-item" data-id="{{$media[0]['file']}}" style="background: url({{$media[0]['file']}}) no-repeat center center / cover">
|
||||||
|
<button id="0" class="media-remove">X</button>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endif
|
||||||
|
@endif
|
|
@ -1,5 +1,4 @@
|
||||||
|
<?php
|
||||||
@php
|
|
||||||
|
|
||||||
if(isset($page['menu']) && $page['menu'])
|
if(isset($page['menu']) && $page['menu'])
|
||||||
{
|
{
|
||||||
|
@ -28,8 +27,7 @@ if(isset($page['uuid']))
|
||||||
}else{
|
}else{
|
||||||
$uuid = 1;
|
$uuid = 1;
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
@endphp
|
|
||||||
|
|
||||||
<div role="toolbar" aria-label="page options" aria-orientation="horizontal">
|
<div role="toolbar" aria-label="page options" aria-orientation="horizontal">
|
||||||
<button id="option-menu-pin" class="option-inactive post-option-btn" data-active="{{$menu}}" title='Pin to Menu' aria-label="pin to menu">
|
<button id="option-menu-pin" class="option-inactive post-option-btn" data-active="{{$menu}}" title='Pin to Menu' aria-label="pin to menu">
|
||||||
|
|
Loading…
Add table
Reference in a new issue