hid create new article ui from normal users
This commit is contained in:
parent
2fcc91850b
commit
1f600dce5a
@ -603,31 +603,7 @@
|
|||||||
<button onclick="cloudArticleApp."></button>
|
<button onclick="cloudArticleApp."></button>
|
||||||
<button onclick="cloudArticleApp.export_as_file()">Export Selections as file</button>
|
<button onclick="cloudArticleApp.export_as_file()">Export Selections as file</button>
|
||||||
</div>
|
</div>
|
||||||
<section class="popup-container hide" id="article_creation_div">
|
<div id="admindiv"></div>
|
||||||
<div id="article_creation_modal" class="popup">
|
|
||||||
<h3>Create a new article</h3>
|
|
||||||
<input type="text" id="article_name" placeholder="Article name">
|
|
||||||
|
|
||||||
<input type="number" id="section_nums" placeholder="Number of sections">
|
|
||||||
|
|
||||||
<button onclick="hidePopup('article_creation_modal')">Cancel</button>
|
|
||||||
<button id="reset_data_btn">Create</button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<div class="popup-container hide">
|
|
||||||
<div id="edit_article" class="popup">
|
|
||||||
<header>
|
|
||||||
<h3>Edit section names</h3>
|
|
||||||
<button onclick="cloudArticleApp.update_section_names()">
|
|
||||||
<svg viewBox="0 0 45.91 32.62">
|
|
||||||
<polyline points="0.71,17.21 14.71,31.21 45.21,0.71 "/>
|
|
||||||
</svg>
|
|
||||||
Done</button>
|
|
||||||
</header>
|
|
||||||
<div id="edit_section_container"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<nav id="navbar">
|
<nav id="navbar">
|
||||||
<svg id="icon" viewBox="0 0 99.555 117.877">
|
<svg id="icon" viewBox="0 0 99.555 117.877">
|
||||||
@ -667,6 +643,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
// function required for popups or modals to appear
|
// function required for popups or modals to appear
|
||||||
function showPopup(popup) {
|
function showPopup(popup) {
|
||||||
let thisPopup = document.getElementById(popup);
|
let thisPopup = document.getElementById(popup);
|
||||||
@ -739,6 +716,47 @@
|
|||||||
spinner.firstElementChild.classList.remove('pulse');
|
spinner.firstElementChild.classList.remove('pulse');
|
||||||
spinner.classList.add('hide');
|
spinner.classList.add('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buidAdminUI() {
|
||||||
|
|
||||||
|
if(floGlobals.subAdmins.includes(myFloID)) {
|
||||||
|
let admindivui = `<section class="popup-container hide" id="article_creation_div">
|
||||||
|
<div id="article_creation_modal" class="popup">
|
||||||
|
<h3>Create a new article</h3>
|
||||||
|
<input type="text" id="article_name" placeholder="Article name">
|
||||||
|
|
||||||
|
<input type="number" id="section_nums" placeholder="Number of sections">
|
||||||
|
|
||||||
|
<button onclick="hidePopup('article_creation_modal')">Cancel</button>
|
||||||
|
<button id="reset_data_btn">Create</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<div class="popup-container hide">
|
||||||
|
<div id="edit_article" class="popup">
|
||||||
|
<header>
|
||||||
|
<h3>Edit section names</h3>
|
||||||
|
<button onclick="cloudArticleApp.update_section_names()">
|
||||||
|
<svg viewBox="0 0 45.91 32.62">
|
||||||
|
<polyline points="0.71,17.21 14.71,31.21 45.21,0.71 "/>
|
||||||
|
</svg>
|
||||||
|
Done</button>
|
||||||
|
</header>
|
||||||
|
<div id="edit_section_container"></div>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
document.getElementById('admindiv').innerHTML = admindivui;
|
||||||
|
|
||||||
|
const reset_data_btn = document.getElementById('reset_data_btn');
|
||||||
|
reset_data_btn.onclick = function() {
|
||||||
|
cloudArticleApp.resetArticleContent();
|
||||||
|
hidePopup('edit_article')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script id="init_lib">
|
<script id="init_lib">
|
||||||
@ -9423,6 +9441,7 @@ Bitcoin.Util = {
|
|||||||
console.log(result)
|
console.log(result)
|
||||||
showMessage(result)
|
showMessage(result)
|
||||||
showMessage(`Welcome FLO_ID: ${myFloID}`)
|
showMessage(`Welcome FLO_ID: ${myFloID}`)
|
||||||
|
buidAdminUI();
|
||||||
cloudArticleApp.retrieveLatestContent();
|
cloudArticleApp.retrieveLatestContent();
|
||||||
}).catch(error => console.error(error))
|
}).catch(error => console.error(error))
|
||||||
}
|
}
|
||||||
@ -9892,16 +9911,5 @@ Bitcoin.Util = {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
(function() {
|
|
||||||
const reset_data_btn = document.getElementById('reset_data_btn');
|
|
||||||
reset_data_btn.onclick = function() {
|
|
||||||
cloudArticleApp.resetArticleContent();
|
|
||||||
hidePopup('edit_article')
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue
Block a user