Fixes for removing media items and page deletion
The upload process changed, so some tweaks needed to me made to the page deletion process, which just marks the page as deleted but keeps the file. Also updated the file manager to properly delete items from the display list. The css for page listings also had to updated [forgot to put that on the list] so the styles for that were updated and the template pages adjusted accordingnly. Also forgot to mention changes to the notification display in the last commit. It's basic as of right now but it will be enhanced as needed.
This commit is contained in:
parent
07b422a9c3
commit
fcca7357bc
9 changed files with 206 additions and 120 deletions
|
@ -5,95 +5,76 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=dfvgy">
|
<link rel="stylesheet" type="text/css" href="/assets/css/dash/start.css?=vdthg">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block mainContent %}
|
{% block mainContent %}
|
||||||
<div id="post-index">
|
<section role="book-index-header">
|
||||||
<div id="post-index-wrapper">
|
<div role="book-index-header-left">
|
||||||
<div id="post-index-header">
|
{{ filter }}
|
||||||
<div id="post-index-header-left">
|
Pages
|
||||||
{{ filter }}
|
</div>
|
||||||
Pages
|
<div role="book-index-header-right">
|
||||||
</div>
|
<a href="/dashboard/pages/all" title="view all pages">
|
||||||
<div id="post-index-header-right">
|
<button>
|
||||||
<a href="/dashboard/pages/all" title="view all pages">
|
<i class="ti ti-clipboard-list"></i>
|
||||||
<button>
|
{{ stats['all'] }}
|
||||||
<svg>
|
</button>
|
||||||
<use xlink:href="/assets/images/global/sprite.svg#entypo-archive"/>
|
</a>
|
||||||
</svg>
|
<a href="/dashboard/pages/published" title="view publised pages">
|
||||||
{{ stats['all'] }}
|
<button>
|
||||||
</button>
|
<i class="ti ti-clipboard-check"></i>
|
||||||
</a>
|
{{ stats['published'] }}
|
||||||
<a href="/dashboard/pages/published" title="view publised pages">
|
</button>
|
||||||
<button>
|
</a>
|
||||||
<svg>
|
<a href="/dashboard/pages/deleted" title="view deleted pages">
|
||||||
<use xlink:href="/assets/images/global/sprite.svg#entypo-globe"/>
|
<button>
|
||||||
</svg>
|
<i class="ti ti-clipboard-off"></i>
|
||||||
{{ stats['published'] }}
|
{{ stats['deleted'] }}
|
||||||
</button>
|
</button>
|
||||||
</a>
|
</a>
|
||||||
<a href="/dashboard/pages/deleted" title="view deleted pages">
|
</section>
|
||||||
<button>
|
<section role="book-index-pages">
|
||||||
<svg>
|
{% for page in pages %}
|
||||||
<use xlink:href="/assets/images/global/sprite.svg#entypo-circle-with-cross"/>
|
{% if page.media[0].type == 'mp4' %}
|
||||||
</svg>
|
<a href="/dashboard/page/edit/{{ page.uuid }}" id="{{ page.uuid }}" class="page-link">
|
||||||
{{ stats['deleted'] }}
|
<div class="page-video">
|
||||||
</button>
|
<video class="post-video" loop muted autoplay>
|
||||||
</a>
|
<source src="{{ page.media[0].file }}" type="video/mp4">
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
Sorry, your browser doesn't support embedded videos.
|
||||||
<div id="posts-list">
|
</video>
|
||||||
{% for page in pages %}
|
<div id="meta">
|
||||||
{% if page.media[0].type == 'mp4' %}
|
{{ include("dash/partials/recent-meta.twig") }}
|
||||||
<a href="/dashboard/page/edit/{{ page.uuid }}" id="{{ page.uuid }}" class="page-link">
|
|
||||||
<div class="page-video">
|
|
||||||
<video class="post-video" loop muted autoplay>
|
|
||||||
<source src="{{ page.media[0].file }}" type="video/mp4">
|
|
||||||
|
|
||||||
Sorry, your browser doesn't support embedded videos.
|
|
||||||
</video>
|
|
||||||
<label>
|
|
||||||
{{ page.title }}
|
|
||||||
</label>
|
|
||||||
<div id="meta">
|
|
||||||
{{ include("dash/partials/recent-options.twig") }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="page-link" href="/dashboard/page/edit/{{ page.uuid }}">
|
<a class="page-link" href="/dashboard/page/edit/{{ page.uuid }}">
|
||||||
<div class="page-bg" style="background: url({{ page.media[0].file }}) no-repeat center center / cover">
|
<div class="page-bg" style="background: url({{ page.media[0].file }}) no-repeat center center / cover">
|
||||||
<label>
|
<div id="meta">
|
||||||
{{ page.title }}
|
{{ include("dash/partials/recent-meta.twig") }}
|
||||||
</label>
|
|
||||||
<div id="meta">
|
|
||||||
{{ include("dash/partials/recent-options.twig") }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
{% endif %}
|
</a>
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
{% if numOfPages > 1 %}
|
|
||||||
<div class="paginate">
|
|
||||||
<a class="page-btns" href="/dashboard/pages/{{ paginate['sort'] }}/{{ paginate['prevPage'] }}">
|
|
||||||
<svg viewbox="0 0 20 20" class="icons"><use xlink:href="/assets/images/global/sprite.svg#entypo-chevron-left"/></svg>
|
|
||||||
</a>
|
|
||||||
<span class="count">
|
|
||||||
{{ currentPage }}
|
|
||||||
of
|
|
||||||
{{ numOfPages }}
|
|
||||||
</span>
|
|
||||||
<a class="page-btns" href="/dashboard/pages/{{ paginate['sort'] }}/{{ paginate['nextPage'] }}">
|
|
||||||
<svg viewbox="0 0 20 20" class="icons"><use xlink:href="/assets/images/global/sprite.svg#entypo-chevron-right"/></svg>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
{% endfor %}
|
||||||
</div>
|
{% if numOfPages > 1 %}
|
||||||
</div>
|
<div role="paginate">
|
||||||
{% endblock %}
|
<a class="page-btns" href="/dashboard/pages/{{ paginate['sort'] }}/{{ paginate['prevPage'] }}">
|
||||||
|
<i class="ti ti-square-arrow-left"></i>
|
||||||
|
</a>
|
||||||
|
<span class="count">
|
||||||
|
{{ currentPage }}
|
||||||
|
of
|
||||||
|
{{ numOfPages }}
|
||||||
|
</span>
|
||||||
|
<a class="page-btns" href="/dashboard/pages/{{ paginate['sort'] }}/{{ paginate['nextPage'] }}">
|
||||||
|
<i class="ti ti-square-arrow-right"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</section>
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -26,13 +26,12 @@
|
||||||
{% if page.media[0].type == 'mp4' %}
|
{% if page.media[0].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("dash/partials/recent-meta.twig") }}
|
||||||
<video class="post-video" loop muted autoplay>
|
<video class="post-video" loop muted autoplay>
|
||||||
<source src="{{ page.media[0].file }}" type="video/mp4">
|
<source src="{{ page.media[0].file }}" type="video/mp4">
|
||||||
|
|
||||||
Sorry, your browser doesn't support embedded videos.
|
Sorry, your browser doesn't support embedded videos.
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
{{ include("dash/partials/recent-meta.twig") }}
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
116
public/assets/css/dash/book.css
Normal file
116
public/assets/css/dash/book.css
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
section[role="book-index-header"] {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
margin: 100px auto 20px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-header"] > div[role="book-index-header-left"] {
|
||||||
|
text-transform: capitalize;
|
||||||
|
display: inline-block;
|
||||||
|
color: var(--white);
|
||||||
|
font-size: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-header"] > div[role="book-index-header-right"] {
|
||||||
|
text-align: right;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 900px;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] > a.page-link {
|
||||||
|
vertical-align: top;
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
text-decoration: none;
|
||||||
|
margin: 0 0 20px;
|
||||||
|
border-radius: 3px;
|
||||||
|
height: 350px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] > a.page-link div.page-video {
|
||||||
|
width: 100%;
|
||||||
|
height: 350px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: left;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
border-bottom: none;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] > a.page-link video {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] > a.page-link > div.page-bg {
|
||||||
|
width: 100%;
|
||||||
|
height: 350px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: left;
|
||||||
|
align-items: center;
|
||||||
|
border-radius: 5px;
|
||||||
|
border-bottom: none;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] aside {
|
||||||
|
font-size: 1.1em;
|
||||||
|
color: var(--white);
|
||||||
|
text-shadow: 2px 2px 2px var(--black);
|
||||||
|
padding: 10px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] hr {
|
||||||
|
color: var(--white);
|
||||||
|
border: 0.1px solid;
|
||||||
|
margin: 7px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] button[data-active="true"] {
|
||||||
|
background: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] button[data-active="true"] svg {
|
||||||
|
fill: var(--tertiary);
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] button[data-active="false"] {
|
||||||
|
background: var(--secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] button[data-active="false"] svg {
|
||||||
|
fill: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] > div[role="paginate"] {
|
||||||
|
width: fit-content;
|
||||||
|
margin: 0 auto;
|
||||||
|
font-size: 1.5em;
|
||||||
|
color: var(--highlight);
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] > div[role="paginate"] i {
|
||||||
|
color: var(--secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] > div[role="paginate"] a,
|
||||||
|
section[role="book-index-pages"] > div[role="paginate"] span {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="book-index-pages"] > div[role="paginate"] span {
|
||||||
|
position: relative;
|
||||||
|
top: -15px;
|
||||||
|
}
|
|
@ -20,14 +20,10 @@ html body {
|
||||||
a {
|
a {
|
||||||
color: var(--primary);
|
color: var(--primary);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border-bottom: 1px solid var(--secondary);
|
border-bottom: 0;
|
||||||
transition: all 0.2s linear;
|
transition: all 0.2s linear;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover {
|
|
||||||
border-bottom: 1px solid var(--highlight);
|
|
||||||
}
|
|
||||||
|
|
||||||
sup {
|
sup {
|
||||||
background: var(--black);
|
background: var(--black);
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
|
|
|
@ -14,6 +14,15 @@ section[role="index-recent-pages"] a {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
section[role="index-recent-pages"] a video {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
object-fit: cover;
|
||||||
|
height: 100%;
|
||||||
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[role="index-recent-pages"] a:nth-child(1) {
|
section[role="index-recent-pages"] a:nth-child(1) {
|
||||||
|
@ -76,6 +85,7 @@ section[role="index-recent-pages"] aside {
|
||||||
color: var(--white);
|
color: var(--white);
|
||||||
text-shadow: 2px 2px 2px var(--black);
|
text-shadow: 2px 2px 2px var(--black);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
section[role="index-recent-pages"] hr {
|
section[role="index-recent-pages"] hr {
|
||||||
|
|
|
@ -5,5 +5,6 @@
|
||||||
@import url("icons.css");
|
@import url("icons.css");
|
||||||
@import url("notifications.css");
|
@import url("notifications.css");
|
||||||
@import url("index.css");
|
@import url("index.css");
|
||||||
|
@import url("book.css");
|
||||||
@import url("page-editor.css");
|
@import url("page-editor.css");
|
||||||
@import url("page-editor-highlights.css");
|
@import url("page-editor-highlights.css");
|
||||||
|
|
|
@ -6954,25 +6954,18 @@ class $832f4be7bc001332$export$2e2bcd8739ae039 {
|
||||||
// event handlers
|
// event handlers
|
||||||
//--------------------------
|
//--------------------------
|
||||||
removeFile(e) {
|
removeFile(e) {
|
||||||
var list = [];
|
var item = e.target.parentNode.parentNode;
|
||||||
switch(e.target.parentNode.className){
|
switch(item.className){
|
||||||
case "img-item":
|
case "img-item":
|
||||||
case "video-item":
|
case "video-item":
|
||||||
list = this.imageList;
|
this.imageList.removeChild(item);
|
||||||
break;
|
break;
|
||||||
case "audio-item":
|
case "audio-item":
|
||||||
case "file-item":
|
case "file-item":
|
||||||
list = this.fileList;
|
this.fileList.removeChild(item);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for(let index = 0; index < list.childNodes.length; index++){
|
$832f4be7bc001332$var$notify.alert("File Removed!", true);
|
||||||
let media = list.childNodes[index];
|
|
||||||
if (media.id == e.target.id) {
|
|
||||||
list.removeChild(media);
|
|
||||||
$832f4be7bc001332$var$notify.alert("REINDEXING MEDIA", null);
|
|
||||||
//this.updateFiles();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
handleFileActions(e) {
|
handleFileActions(e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@ -7104,7 +7097,7 @@ class $371d2518d50c1748$export$2e2bcd8739ae039 {
|
||||||
$371d2518d50c1748$var$notify.alert("Index cannot be deleted", false);
|
$371d2518d50c1748$var$notify.alert("Index cannot be deleted", false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (confirm("AYE! You know you're deleting this post, right?")) new (0, $de01a7e5b1773530$export$2e2bcd8739ae039)().collectInfo(document.getElementById("featured-image-upload").files[0]).then((page)=>{
|
if (confirm("AYE! You know you're deleting this post, right?")) new (0, $de01a7e5b1773530$export$2e2bcd8739ae039)().collectInfo(this.fm.getFileOrder()).then((page)=>{
|
||||||
self.processing = true;
|
self.processing = true;
|
||||||
this.admin.pageActions((0, $cbea55afea03b976$export$f9aea0c55bfa15c9), page).then(()=>{
|
this.admin.pageActions((0, $cbea55afea03b976$export$f9aea0c55bfa15c9), page).then(()=>{
|
||||||
self.processing = false;
|
self.processing = false;
|
||||||
|
|
|
@ -177,9 +177,7 @@ export default class PostEditor {
|
||||||
}
|
}
|
||||||
if (confirm("AYE! You know you're deleting this post, right?")) {
|
if (confirm("AYE! You know you're deleting this post, right?")) {
|
||||||
new PageActions()
|
new PageActions()
|
||||||
.collectInfo(
|
.collectInfo(this.fm.getFileOrder())
|
||||||
document.getElementById('featured-image-upload').files[0]
|
|
||||||
)
|
|
||||||
.then(page => {
|
.then(page => {
|
||||||
self.processing = true;
|
self.processing = true;
|
||||||
this.admin
|
this.admin
|
||||||
|
|
|
@ -249,26 +249,18 @@ export default class FileManager {
|
||||||
// event handlers
|
// event handlers
|
||||||
//--------------------------
|
//--------------------------
|
||||||
removeFile(e) {
|
removeFile(e) {
|
||||||
var list = [];
|
var item = e.target.parentNode.parentNode;
|
||||||
switch (e.target.parentNode.className) {
|
switch (item.className) {
|
||||||
case 'img-item':
|
case 'img-item':
|
||||||
case 'video-item':
|
case 'video-item':
|
||||||
list = this.imageList;
|
this.imageList.removeChild(item);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'audio-item':
|
case 'audio-item':
|
||||||
case 'file-item':
|
case 'file-item':
|
||||||
list = this.fileList;
|
this.fileList.removeChild(item);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
for (let index = 0; index < list.childNodes.length; index++) {
|
notify.alert('File Removed!', true);
|
||||||
let media = list.childNodes[index];
|
|
||||||
if (media.id == e.target.id) {
|
|
||||||
list.removeChild(media);
|
|
||||||
notify.alert('REINDEXING MEDIA', null);
|
|
||||||
//this.updateFiles();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handleFileActions(e) {
|
handleFileActions(e) {
|
||||||
|
|
Loading…
Reference in a new issue