* Conversion script to new configuration layout. This is to prevent from secrets being loaded into memory aside from when they are needed. * Updated code throughout the project to account for the new methods. * New classes and code for new configuration layout * New Javascript for backend to control all the dialogues * Moved modals to separate files * Smaller database model update * Removed redundant code * Added database upgrade path via the dashboard * Admin password is now properly hashed * You can now export all locations manually in event of an errorprojects
parent
194ffc754b
commit
ad8f68cdd8
20 changed files with 865 additions and 404 deletions
@ -0,0 +1,22 @@ |
|||||||
|
<div class="modal" id="modal-comments-export"> |
||||||
|
<div class="modal-background"></div> |
||||||
|
<div class="modal-card"> |
||||||
|
<header class="modal-card-head has-background-warning"> |
||||||
|
<p class="modal-card-title has-text-black is-uppercase">Export all comments</p> |
||||||
|
<button onclick="hide_modal('modal-comments-export')" class="delete" aria-label="close"></button> |
||||||
|
</header> |
||||||
|
<section class="modal-card-body has-text-white bg-deepmatte"> |
||||||
|
<p class="block">This will export all comments of this project to all locations. |
||||||
|
Usually this is not needed, but can be helpful, if you have imported backups or similar.</p> |
||||||
|
<p class="block has-text-danger">Do you wish to proceed?</p> |
||||||
|
</section> |
||||||
|
<footer class="modal-card-foot bg-deepmatte"> |
||||||
|
<button id="modal-ok" onclick="export_all_comments(this);" class="button is-success"> |
||||||
|
OK |
||||||
|
</button> |
||||||
|
<button id="modal-cancel" onclick="hide_modal('modal-comments-export')" class="button is-info"> |
||||||
|
CANCEL |
||||||
|
</button> |
||||||
|
</footer> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,21 @@ |
|||||||
|
<div class="modal" id="modal-project-delete"> |
||||||
|
<div class="modal-background"></div> |
||||||
|
<div class="modal-card"> |
||||||
|
<header class="modal-card-head has-background-warning"> |
||||||
|
<p class="modal-card-title has-text-black">WARNING!</p> |
||||||
|
<button onclick="hide_modal('modal-project-delete')" class="delete" aria-label="close"></button> |
||||||
|
</header> |
||||||
|
<section class="modal-card-body has-text-black"> |
||||||
|
You are about to delete a project. All associated data will be unrecoverably lost! |
||||||
|
Please perform a manual sql dump if you would like to retain that data. |
||||||
|
</section> |
||||||
|
<footer class="modal-card-foot"> |
||||||
|
<button id="modal-delete-ok" onclick="project_delete()" class="button is-danger"> |
||||||
|
OK |
||||||
|
</button> |
||||||
|
<button id="modal-delete-cancel" onclick="hide_modal('modal-project-delete')" class="button is-success"> |
||||||
|
CANCEL |
||||||
|
</button> |
||||||
|
</footer> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,109 @@ |
|||||||
|
<div class="modal" id="modal-project-edit"> |
||||||
|
<div class="modal-background"></div> |
||||||
|
<div class="modal-card"> |
||||||
|
<header class="modal-card-head has-background-warning"> |
||||||
|
<p id="modal-title" class="modal-card-title has-text-black">Edit Project</p> |
||||||
|
<button onclick="hide_modal('modal-project-edit')" class="delete" aria-label="close"></button> |
||||||
|
</header> |
||||||
|
<section class="modal-card-body has-text-black bg-deepmatte"> |
||||||
|
<form> |
||||||
|
<div class="field"> |
||||||
|
<div class="control has-icons-left" |
||||||
|
data-tippy-content="Please select an unique name for your project."> |
||||||
|
<input class="input" id="edit-project-name" |
||||||
|
name="edit-project-name" type="text"> |
||||||
|
<span class="icon is-small is-left"> |
||||||
|
<i class="mdi mdi-24px mdi-help-rhombus-outline"></i> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<label class="label help has-text-white" for="edit-project-name"> |
||||||
|
Project Name |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
<div class="control has-icons-left" |
||||||
|
data-tippy-content="URL of your hugo site, e.g. https://example.com"> |
||||||
|
<input class="input" id="edit-project-blog-url" name="edit-project-blog-url" type="text"> |
||||||
|
<span class="icon is-small is-left"> |
||||||
|
<i class="mdi mdi-24px mdi-help-rhombus-outline"></i> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<label class="label help has-text-white" for="edit-project-blog-url"> |
||||||
|
URL of your Hugo site for this project |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
<div class="control has-icons-left" |
||||||
|
data-tippy-content="The path to the data directory of your Hugo installation."> |
||||||
|
<input class="input" id="edit-project-output" name="edit-project-output" type="text"> |
||||||
|
<span class="icon is-small is-left"> |
||||||
|
<i class="mdi mdi-24px mdi-help-rhombus-outline"></i> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<label class="label help has-text-white" for="edit-project-output">Output Directory</label> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
<div class="control"> |
||||||
|
<label class="checkbox help has-text-white" for="edit-project-gravatar-cache"> |
||||||
|
<input id="edit-project-gravatar-cache" class="checkbox" type="checkbox" |
||||||
|
name="edit-project-gravatar-cache" checked onclick="toggle_gravatar_settings(this);"> |
||||||
|
Cache Gravatar images? |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
<div class="control has-icons-left" |
||||||
|
data-tippy-content="The directory where to save the gravatar images. Should be a full path."> |
||||||
|
<input class="input" id="edit-project-gravatar-cache-dir" name="edit-project-gravatar-cache-dir" type="text"> |
||||||
|
<span class="icon is-small is-left"> |
||||||
|
<i class="mdi mdi-24px mdi-help-rhombus-outline"></i> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<label class="label help has-text-white" for="edit-project-gravatar-cache-dir"> |
||||||
|
Gravatar Cache Directory |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
<div class="control has-icons-left" |
||||||
|
data-tippy-content="The numeric size of the images to download. Must be a power of 2."> |
||||||
|
<input class="input" id="edit-project-gravatar-size" name="edit-project-gravatar-size" type="text" value="256"> |
||||||
|
<span class="icon is-small is-left"> |
||||||
|
<i class="mdi mdi-24px mdi-help-rhombus-outline"></i> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<label class="label help has-text-white" for="edit-project-gravatar-size"> |
||||||
|
Gravatar image size |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
<div class="control"> |
||||||
|
<label class="checkbox help has-text-white" for="edit-project-send-otp"> |
||||||
|
<input id="edit-project-send-otp" class="checkbox" type="checkbox" |
||||||
|
name="edit-project-send-otp" checked> |
||||||
|
Send OTP to publish? |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="field"> |
||||||
|
<div class="control"> |
||||||
|
<label class="checkbox help has-text-white" for="edit-project-addons-smileys"> |
||||||
|
<input id="edit-project-addons-smileys" class="checkbox" type="checkbox" |
||||||
|
name="edit-project-addons-smileys" checked> |
||||||
|
Enable Smiley Addon? |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="label has-text-danger" id="modal-edit-error-messages"> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</section> |
||||||
|
<footer class="modal-card-foot bg-deepmatte"> |
||||||
|
<button id="modal-save-ok" onclick="save_project_settings('modal-project-edit');" class="button is-success"> |
||||||
|
OK |
||||||
|
</button> |
||||||
|
<button onclick="hide_modal('modal-project-edit')" class="button is-info"> |
||||||
|
CANCEL |
||||||
|
</button> |
||||||
|
</footer> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,24 @@ |
|||||||
|
<div class="modal" id="modal-project-not-found"> |
||||||
|
<div class="modal-background"></div> |
||||||
|
<div class="modal-card"> |
||||||
|
<header class="modal-card-head has-background-danger"> |
||||||
|
<p class="modal-card-title has-text-white">ERROR</p> |
||||||
|
<button onclick="hide_modal('modal-project-not-found')" class="delete" aria-label="close"></button> |
||||||
|
</header> |
||||||
|
<section class="modal-card-body has-text-black"> |
||||||
|
The specified project was not found! Did you delete it? Try refreshing the page.<br> |
||||||
|
If you believe this to be a bug, please report it |
||||||
|
<a class="has-text-info" |
||||||
|
href="https://github.com/domeniko-gentner/labertasche/issues" |
||||||
|
target="_blank" rel="nofollow noopener norefferer"> |
||||||
|
here |
||||||
|
</a>. |
||||||
|
</section> |
||||||
|
<footer class="modal-card-foot"> |
||||||
|
<button id="modal-ok" onclick="hide_modal('modal-project-not-found', {{ url_for('bp_dashboard.dashboard_project_list') }})" |
||||||
|
class="button is-success"> |
||||||
|
OK |
||||||
|
</button> |
||||||
|
</footer> |
||||||
|
</div> |
||||||
|
</div> |
Loading…
Reference in new issue