Added option to edit article contributors in admin page
This commit is contained in:
parent
82071ce1f4
commit
44080c9d55
@ -1058,6 +1058,7 @@ smPopup.innerHTML = `
|
|||||||
right: 0;
|
right: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background: var(--backdrop-background);
|
background: var(--backdrop-background);
|
||||||
|
backdrop-filter: blur(0.1rem);
|
||||||
-webkit-transition: opacity 0.3s;
|
-webkit-transition: opacity 0.3s;
|
||||||
-o-transition: opacity 0.3s;
|
-o-transition: opacity 0.3s;
|
||||||
transition: opacity 0.3s;
|
transition: opacity 0.3s;
|
||||||
@ -1261,17 +1262,15 @@ customElements.define('sm-popup', class extends HTMLElement {
|
|||||||
duration: 300,
|
duration: 300,
|
||||||
easing: 'ease'
|
easing: 'ease'
|
||||||
}
|
}
|
||||||
if (popupStack) {
|
popupStack.push({
|
||||||
popupStack.push({
|
popup: this,
|
||||||
popup: this,
|
permission: pinned
|
||||||
permission: pinned
|
});
|
||||||
});
|
if (popupStack.items.length > 1) {
|
||||||
if (popupStack.items.length > 1) {
|
this.animateTo(popupStack.items[popupStack.items.length - 2].popup.shadowRoot.querySelector('.popup'), [
|
||||||
this.animateTo(popupStack.items[popupStack.items.length - 2].popup.shadowRoot.querySelector('.popup'), [
|
{ transform: 'none' },
|
||||||
{ transform: 'none' },
|
{ transform: (window.innerWidth > 640) ? 'scale(0.95)' : 'translateY(-1.5rem)' },
|
||||||
{ transform: 'translateY(-1.5rem) scale(0.9)' },
|
], animOptions)
|
||||||
], animOptions)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.popupContainer.classList.remove('hide');
|
this.popupContainer.classList.remove('hide');
|
||||||
if (!this.offset)
|
if (!this.offset)
|
||||||
@ -1321,20 +1320,6 @@ customElements.define('sm-popup', class extends HTMLElement {
|
|||||||
this.popupContainer.classList.add('hide');
|
this.popupContainer.classList.add('hide');
|
||||||
this.popup.style = ''
|
this.popup.style = ''
|
||||||
this.removeAttribute('open');
|
this.removeAttribute('open');
|
||||||
if (typeof popupStack !== 'undefined') {
|
|
||||||
popupStack.pop();
|
|
||||||
if (popupStack.items.length) {
|
|
||||||
this.animateTo(popupStack.items[popupStack.items.length - 1].popup.shadowRoot.querySelector('.popup'), [
|
|
||||||
{ transform: 'translateY(-1.5rem) scale(0.9)' },
|
|
||||||
{ transform: 'none' },
|
|
||||||
], animOptions)
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.resumeScrolling();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.resumeScrolling();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.forms.length) {
|
if (this.forms.length) {
|
||||||
this.forms.forEach(form => form.reset());
|
this.forms.forEach(form => form.reset());
|
||||||
@ -1349,6 +1334,16 @@ customElements.define('sm-popup', class extends HTMLElement {
|
|||||||
);
|
);
|
||||||
this.isOpen = false;
|
this.isOpen = false;
|
||||||
})
|
})
|
||||||
|
popupStack.pop();
|
||||||
|
if (popupStack.items.length) {
|
||||||
|
this.animateTo(popupStack.items[popupStack.items.length - 1].popup.shadowRoot.querySelector('.popup'), [
|
||||||
|
{ transform: (window.innerWidth > 640) ? 'scale(0.95)' : 'translateY(-1.5rem)' },
|
||||||
|
{ transform: 'none' },
|
||||||
|
], animOptions)
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.resumeScrolling();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleTouchStart(e) {
|
handleTouchStart(e) {
|
||||||
@ -3565,6 +3560,7 @@ tagsInput.innerHTML = `
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
|
overflow-wrap: anywhere;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
27
css/main.css
27
css/main.css
@ -34,8 +34,7 @@ body * {
|
|||||||
body[data-theme=dark],
|
body[data-theme=dark],
|
||||||
body[data-theme=dark] * {
|
body[data-theme=dark] * {
|
||||||
--accent-color: #86afff;
|
--accent-color: #86afff;
|
||||||
--text-color: 230, 230, 230;
|
--text-color: 220, 220, 220;
|
||||||
--text-color-light: 170, 170, 170;
|
|
||||||
--background-color: 10, 10, 10;
|
--background-color: 10, 10, 10;
|
||||||
--foreground-color: rgb(24, 24, 24);
|
--foreground-color: rgb(24, 24, 24);
|
||||||
--danger-color: rgb(255, 106, 106);
|
--danger-color: rgb(255, 106, 106);
|
||||||
@ -72,6 +71,7 @@ a:not([class]):focus-visible {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input[type=datetime-local] {
|
input[type=datetime-local] {
|
||||||
|
width: 100%;
|
||||||
padding: 0.6rem 0.8rem;
|
padding: 0.6rem 0.8rem;
|
||||||
background-color: rgba(var(--text-color), 0.06);
|
background-color: rgba(var(--text-color), 0.06);
|
||||||
border: none;
|
border: none;
|
||||||
@ -588,7 +588,6 @@ main {
|
|||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: calc(100% - 2rem);
|
width: calc(100% - 2rem);
|
||||||
margin: 0 1rem;
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
background-color: rgba(var(--background-color), 1);
|
background-color: rgba(var(--background-color), 1);
|
||||||
}
|
}
|
||||||
@ -884,12 +883,6 @@ footer {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@supports (-webkit-text-stroke: 1px black) {
|
|
||||||
#landing h1 {
|
|
||||||
-webkit-text-stroke: 1px rgba(var(--text-color), 1);
|
|
||||||
-webkit-text-fill-color: rgba(var(--background-color), 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media screen and (min-width: 40rem) {
|
@media screen and (min-width: 40rem) {
|
||||||
sm-popup {
|
sm-popup {
|
||||||
--width: 24rem;
|
--width: 24rem;
|
||||||
@ -955,7 +948,7 @@ footer {
|
|||||||
|
|
||||||
#preview_popup h1,
|
#preview_popup h1,
|
||||||
#article h1 {
|
#article h1 {
|
||||||
font-size: 2rem;
|
font-size: 2.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#article {
|
#article {
|
||||||
@ -965,6 +958,20 @@ footer {
|
|||||||
#preview_popup {
|
#preview_popup {
|
||||||
--width: 60ch;
|
--width: 60ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#edit_article_meta_popup {
|
||||||
|
--width: 48rem;
|
||||||
|
}
|
||||||
|
#edit_article_meta_popup > section {
|
||||||
|
display: grid;
|
||||||
|
gap: 1.5rem;
|
||||||
|
grid-template-columns: 1fr 1.5fr;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
#user_popup {
|
||||||
|
--width: 28rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@media (any-hover: hover) {
|
@media (any-hover: hover) {
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
|
|||||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
@ -37,8 +37,7 @@ body[data-theme="dark"] {
|
|||||||
&,
|
&,
|
||||||
* {
|
* {
|
||||||
--accent-color: #86afff;
|
--accent-color: #86afff;
|
||||||
--text-color: 230, 230, 230;
|
--text-color: 220, 220, 220;
|
||||||
--text-color-light: 170, 170, 170;
|
|
||||||
--background-color: 10, 10, 10;
|
--background-color: 10, 10, 10;
|
||||||
--foreground-color: rgb(24, 24, 24);
|
--foreground-color: rgb(24, 24, 24);
|
||||||
--danger-color: rgb(255, 106, 106);
|
--danger-color: rgb(255, 106, 106);
|
||||||
@ -75,6 +74,7 @@ a:not([class]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input[type="datetime-local"] {
|
input[type="datetime-local"] {
|
||||||
|
width: 100%;
|
||||||
padding: 0.6rem 0.8rem;
|
padding: 0.6rem 0.8rem;
|
||||||
background-color: rgba(var(--text-color), 0.06);
|
background-color: rgba(var(--text-color), 0.06);
|
||||||
border: none;
|
border: none;
|
||||||
@ -558,7 +558,6 @@ main {
|
|||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: calc(100% - 2rem);
|
width: calc(100% - 2rem);
|
||||||
margin: 0 1rem;
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
background-color: rgba(var(--background-color), 1);
|
background-color: rgba(var(--background-color), 1);
|
||||||
.icon-only {
|
.icon-only {
|
||||||
@ -846,12 +845,6 @@ footer {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@supports (-webkit-text-stroke: 1px black) {
|
|
||||||
#landing h1 {
|
|
||||||
-webkit-text-stroke: 1px rgba(var(--text-color), 1);
|
|
||||||
-webkit-text-fill-color: rgba(var(--background-color), 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media screen and (min-width: 40rem) {
|
@media screen and (min-width: 40rem) {
|
||||||
sm-popup {
|
sm-popup {
|
||||||
--width: 24rem;
|
--width: 24rem;
|
||||||
@ -908,7 +901,7 @@ footer {
|
|||||||
#preview_popup,
|
#preview_popup,
|
||||||
#article {
|
#article {
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 2rem;
|
font-size: 2.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#article {
|
#article {
|
||||||
@ -918,6 +911,18 @@ footer {
|
|||||||
#preview_popup {
|
#preview_popup {
|
||||||
--width: 60ch;
|
--width: 60ch;
|
||||||
}
|
}
|
||||||
|
#edit_article_meta_popup {
|
||||||
|
--width: 48rem;
|
||||||
|
& > section {
|
||||||
|
display: grid;
|
||||||
|
gap: 1.5rem;
|
||||||
|
grid-template-columns: 1fr 1.5fr;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#user_popup {
|
||||||
|
--width: 28rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@media (any-hover: hover) {
|
@media (any-hover: hover) {
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
|
|||||||
95
index.html
95
index.html
@ -345,7 +345,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<section id="preview_container"></section>
|
<section id="preview_container"></section>
|
||||||
</sm-popup>
|
</sm-popup>
|
||||||
<sm-popup id="edit_popup">
|
<sm-popup id="edit_article_meta_popup">
|
||||||
<header slot="header" class="popup__header">
|
<header slot="header" class="popup__header">
|
||||||
<div class="flex align-center">
|
<div class="flex align-center">
|
||||||
<button class="popup__header__close" onclick="hidePopup()">
|
<button class="popup__header__close" onclick="hidePopup()">
|
||||||
@ -361,36 +361,44 @@
|
|||||||
Edit
|
Edit
|
||||||
</h4>
|
</h4>
|
||||||
</header>
|
</header>
|
||||||
<section class="grid gap-1-5">
|
<section>
|
||||||
<div class="grid gap-0-5">
|
<div class="grid gap-1-5">
|
||||||
<h5>Title</h5>
|
<div class="grid gap-0-5">
|
||||||
<sm-input id="edit_title" required></sm-input>
|
<h5>Title</h5>
|
||||||
|
<sm-input id="edit_title" required></sm-input>
|
||||||
|
</div>
|
||||||
|
<div class="grid gap-0-5">
|
||||||
|
<h5>Select category</h5>
|
||||||
|
<sm-select id="edit_category">
|
||||||
|
<sm-option value="art">Art</sm-option>
|
||||||
|
<sm-option value="culture">Culture</sm-option>
|
||||||
|
<sm-option value="entertainment">Entertainment</sm-option>
|
||||||
|
<sm-option value="politics">Politics</sm-option>
|
||||||
|
<sm-option value="science">Science</sm-option>
|
||||||
|
<sm-option value="sports">Sports</sm-option>
|
||||||
|
<sm-option value="tech">Tech</sm-option>
|
||||||
|
</sm-select>
|
||||||
|
</div>
|
||||||
|
<div class="grid gap-0-5">
|
||||||
|
<h5>Summary</h5>
|
||||||
|
<sm-textarea id="edit_summary" rows="4"></sm-textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-0-5">
|
<div class="grid gap-1-5">
|
||||||
<h5>Summary</h5>
|
<div class="grid gap-0-5">
|
||||||
<sm-textarea id="edit_summary" rows="4"></sm-textarea>
|
<h5>Add tags</h5>
|
||||||
|
<tags-input id="edit_tags" limit="10"></tags-input>
|
||||||
|
</div>
|
||||||
|
<div class="grid gap-0-5">
|
||||||
|
<h5>contributors</h5>
|
||||||
|
<tags-input id="edit_contributors"></tags-input>
|
||||||
|
</div>
|
||||||
|
<label class="grid gap-0-5">
|
||||||
|
<h5>Publishing date</h5>
|
||||||
|
<input type="datetime-local" id="edit_published">
|
||||||
|
</label>
|
||||||
|
<sm-button id="set_article_meta" onclick="defineArticle()" variant="primary">Save</sm-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-0-5">
|
|
||||||
<h5>Select category</h5>
|
|
||||||
<sm-select id="edit_category">
|
|
||||||
<sm-option value="art">Art</sm-option>
|
|
||||||
<sm-option value="culture">Culture</sm-option>
|
|
||||||
<sm-option value="entertainment">Entertainment</sm-option>
|
|
||||||
<sm-option value="politics">Politics</sm-option>
|
|
||||||
<sm-option value="science">Science</sm-option>
|
|
||||||
<sm-option value="sports">Sports</sm-option>
|
|
||||||
<sm-option value="tech">Tech</sm-option>
|
|
||||||
</sm-select>
|
|
||||||
</div>
|
|
||||||
<div class="grid gap-0-5">
|
|
||||||
<h5>Add tags</h5>
|
|
||||||
<tags-input id="edit_tags" limit="10"></tags-input>
|
|
||||||
</div>
|
|
||||||
<label class="grid gap-0-5">
|
|
||||||
<h5>Publishing date</h5>
|
|
||||||
<input type="datetime-local" id="edit_published">
|
|
||||||
</label>
|
|
||||||
<sm-button id="set_article_meta" onclick="defineArticle()" variant="primary">Save</sm-button>
|
|
||||||
</section>
|
</section>
|
||||||
</sm-popup>
|
</sm-popup>
|
||||||
<sm-popup id="user_popup">
|
<sm-popup id="user_popup">
|
||||||
@ -802,6 +810,7 @@
|
|||||||
}
|
}
|
||||||
document.querySelectorAll('.page').forEach(page => page.classList.add('hide'))
|
document.querySelectorAll('.page').forEach(page => page.classList.add('hide'))
|
||||||
getRef(targetPage).classList.remove('hide')
|
getRef(targetPage).classList.remove('hide')
|
||||||
|
animateTo(getRef(targetPage), [{ opacity: 0 }, { opacity: 1 }], { duration: 300, fill: 'forwards', easing: 'ease' })
|
||||||
if (pagesData.lastPage !== pageId) {
|
if (pagesData.lastPage !== pageId) {
|
||||||
pagesData.lastPage = pageId
|
pagesData.lastPage = pageId
|
||||||
if (!pagesData.openedPages.includes(pageId)) {
|
if (!pagesData.openedPages.includes(pageId)) {
|
||||||
@ -982,7 +991,7 @@
|
|||||||
getRef('trending_article_container').innerHTML = ''
|
getRef('trending_article_container').innerHTML = ''
|
||||||
getRef('trending_article_container').append(frag)
|
getRef('trending_article_container').append(frag)
|
||||||
// render latest articles
|
// render latest articles
|
||||||
const sortedArticles = sortedByVotes.slice(3, 6).sort((a, b) => b.published - a.published)
|
const sortedArticles = sortedByVotes.slice(3).sort((a, b) => b.published - a.published)
|
||||||
sortedArticles.forEach(articleDetail => frag.append(render.articleCard(articleDetail)))
|
sortedArticles.forEach(articleDetail => frag.append(render.articleCard(articleDetail)))
|
||||||
getRef('latest_articles_list').innerHTML = ''
|
getRef('latest_articles_list').innerHTML = ''
|
||||||
getRef('latest_articles_list').append(frag)
|
getRef('latest_articles_list').append(frag)
|
||||||
@ -1118,7 +1127,6 @@
|
|||||||
const frag = document.createDocumentFragment()
|
const frag = document.createDocumentFragment()
|
||||||
searchResult.slice(0, 4).forEach((result) => {
|
searchResult.slice(0, 4).forEach((result) => {
|
||||||
const { uid, title } = result
|
const { uid, title } = result
|
||||||
console.log(result)
|
|
||||||
frag.append(createElement('a', {
|
frag.append(createElement('a', {
|
||||||
textContent: title,
|
textContent: title,
|
||||||
attributes: { href: `#/article?articleID=${uid}` },
|
attributes: { href: `#/article?articleID=${uid}` },
|
||||||
@ -1151,6 +1159,14 @@
|
|||||||
toggleSearch()
|
toggleSearch()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
getRef('search_suggestions').addEventListener('click', e => {
|
||||||
|
if (e.target.value.trim() !== '' && e.code === 'Enter') {
|
||||||
|
location.hash = `#/explore?type=search&query=${e.target.value.trim()}`
|
||||||
|
e.target.value = ''
|
||||||
|
toggleSearch()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const slideInLeft = [
|
const slideInLeft = [
|
||||||
{
|
{
|
||||||
opacity: 0,
|
opacity: 0,
|
||||||
@ -1390,7 +1406,7 @@
|
|||||||
const isPublished = floGlobals.appObjects['articles'].hasOwnProperty(articleID)
|
const isPublished = floGlobals.appObjects['articles'].hasOwnProperty(articleID)
|
||||||
getConfirmation(`${isPublished ? 'Update' : 'Publish'} article?`).then(res => {
|
getConfirmation(`${isPublished ? 'Update' : 'Publish'} article?`).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
const { title, category, summary, published, tags } = getArticleMetaData()
|
const { title, category, summary, published, tags, contributors } = getArticleMetaData()
|
||||||
floGlobals.appObjects['publishedVc'][vectorClock] = true
|
floGlobals.appObjects['publishedVc'][vectorClock] = true
|
||||||
floGlobals.appObjects.articlesContent[articleID] = content
|
floGlobals.appObjects.articlesContent[articleID] = content
|
||||||
if (isPublished) {
|
if (isPublished) {
|
||||||
@ -1427,12 +1443,12 @@
|
|||||||
if (e.target.closest('.publish-button')) {
|
if (e.target.closest('.publish-button')) {
|
||||||
const button = e.target.closest('.publish-button');
|
const button = e.target.closest('.publish-button');
|
||||||
const vc = button.closest('.request-card').dataset.vc;
|
const vc = button.closest('.request-card').dataset.vc;
|
||||||
const { message: { articleID, title } } = floGlobals.generalData[`publishing_requests|${floGlobals.adminID}|${floGlobals.application}`][vc]
|
const { message: { articleID, title, contributors } } = floGlobals.generalData[`publishing_requests|${floGlobals.adminID}|${floGlobals.application}`][vc]
|
||||||
const isPublished = floGlobals.appObjects['articles'].hasOwnProperty(articleID)
|
const isPublished = floGlobals.appObjects['articles'].hasOwnProperty(articleID)
|
||||||
if (isPublished)
|
if (isPublished)
|
||||||
setArticleMetaData(floGlobals.appObjects.articles[articleID])
|
setArticleMetaData(floGlobals.appObjects.articles[articleID])
|
||||||
else
|
else
|
||||||
setArticleMetaData({ title })
|
setArticleMetaData({ title, contributors })
|
||||||
floGlobals.subAdminData = {
|
floGlobals.subAdminData = {
|
||||||
actionType: 'request',
|
actionType: 'request',
|
||||||
articleID,
|
articleID,
|
||||||
@ -1440,7 +1456,7 @@
|
|||||||
}
|
}
|
||||||
getRef('set_article_meta').textContent = isPublished ? 'UPDATE' : 'PUBLISH'
|
getRef('set_article_meta').textContent = isPublished ? 'UPDATE' : 'PUBLISH'
|
||||||
getRef('edit_popup__title').textContent = isPublished ? 'Update' : 'Publish'
|
getRef('edit_popup__title').textContent = isPublished ? 'Update' : 'Publish'
|
||||||
showPopup('edit_popup')
|
showPopup('edit_article_meta_popup')
|
||||||
} else if (e.target.closest('.preview-button')) {
|
} else if (e.target.closest('.preview-button')) {
|
||||||
const button = e.target.closest('.preview-button');
|
const button = e.target.closest('.preview-button');
|
||||||
const vc = button.closest('.request-card').dataset.vc;
|
const vc = button.closest('.request-card').dataset.vc;
|
||||||
@ -1455,10 +1471,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setArticleMetaData(details) {
|
function setArticleMetaData(details) {
|
||||||
const { category, title, tags, summary, published } = details
|
const { category, title, tags, summary, published, contributors } = details
|
||||||
getRef('edit_title').value = title;
|
getRef('edit_title').value = title;
|
||||||
getRef('edit_summary').value = summary || '';
|
getRef('edit_summary').value = summary || '';
|
||||||
getRef('edit_category').value = category || '';
|
getRef('edit_category').value = category || '';
|
||||||
|
getRef('edit_contributors').value = contributors || [];
|
||||||
getRef('edit_tags').value = tags || [];
|
getRef('edit_tags').value = tags || [];
|
||||||
const now = Date.now()
|
const now = Date.now()
|
||||||
getRef('edit_published').value = new Date(published || now).toISOString().substr(0, new Date(published || now).toISOString().indexOf("."))
|
getRef('edit_published').value = new Date(published || now).toISOString().substr(0, new Date(published || now).toISOString().indexOf("."))
|
||||||
@ -1469,6 +1486,7 @@
|
|||||||
category: getRef('edit_category').value,
|
category: getRef('edit_category').value,
|
||||||
summary: getRef('edit_summary').value.trim(),
|
summary: getRef('edit_summary').value.trim(),
|
||||||
published: new Date(getRef('edit_published').value).getTime(),
|
published: new Date(getRef('edit_published').value).getTime(),
|
||||||
|
contributors: getRef('edit_contributors').value,
|
||||||
tags: getRef('edit_tags').value,
|
tags: getRef('edit_tags').value,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1483,18 +1501,19 @@
|
|||||||
}
|
}
|
||||||
getRef('set_article_meta').textContent = "UPDATE"
|
getRef('set_article_meta').textContent = "UPDATE"
|
||||||
getRef('edit_popup__title').textContent = "Update"
|
getRef('edit_popup__title').textContent = "Update"
|
||||||
showPopup('edit_popup')
|
showPopup('edit_article_meta_popup')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateArticleMetaData(articleID) {
|
function updateArticleMetaData(articleID) {
|
||||||
getConfirmation('Update article meta data?').then(res => {
|
getConfirmation('Update article meta data?').then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
const { title, category, summary, published, tags } = getArticleMetaData()
|
const { title, category, summary, published, tags, contributors } = getArticleMetaData()
|
||||||
floGlobals.appObjects['articles'][articleID].category = category
|
floGlobals.appObjects['articles'][articleID].category = category
|
||||||
floGlobals.appObjects['articles'][articleID].title = title
|
floGlobals.appObjects['articles'][articleID].title = title
|
||||||
floGlobals.appObjects['articles'][articleID].tags = tags
|
floGlobals.appObjects['articles'][articleID].tags = tags
|
||||||
floGlobals.appObjects['articles'][articleID].summary = summary
|
floGlobals.appObjects['articles'][articleID].summary = summary
|
||||||
|
floGlobals.appObjects['articles'][articleID].contributors = contributors
|
||||||
Promise.all([
|
Promise.all([
|
||||||
floCloudAPI.updateObjectData('articles'),
|
floCloudAPI.updateObjectData('articles'),
|
||||||
floCloudAPI.updateObjectData('publishedVc'),
|
floCloudAPI.updateObjectData('publishedVc'),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user