clean up how we create toasts() [no longer try to reuse dom elements, just add new ones each time], support persistent notifications and close button or not [via separate booleans], created a clear message route and use that now in templates/base.html to clear FE messages. This will break for check dups as I am not setting persistence / close buttons correctly for those jobs, that is next. Converted move_files to new format
This commit is contained in:
@@ -161,7 +161,7 @@
|
||||
|
||||
{% if not InDBox %}
|
||||
{%block script_content %}{% endblock script_content %}
|
||||
<div id="status_container" class="position-fixed bottom-0 end-0 p-3" style="z-index: 11">
|
||||
<div id="status_container" class="position-fixed top-1 end-0 p-1" style="z-index: 11">
|
||||
<div id="st1" class="toast hide align-items-center text-white bg-success border-0" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<div class="d-flex">
|
||||
<div class="toast-body">
|
||||
@@ -172,24 +172,16 @@
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
<!-- f/e messages are resident in memory of the page being rendered, just process now -->
|
||||
<!-- f/e messages are resident in memory of the page being rendered, just process now (stay this way so faster/dont need DB for some message) -->
|
||||
{% if GetMessage()|length %}
|
||||
msg = "{{ GetMessage()|safe }}"
|
||||
msg=msg.replace('href=', 'class=link-light href=')
|
||||
st=Object; st.message=msg; st.alert='{{GetAlert()}}'; StatusMsg(st)
|
||||
alert( '{{GetAlert()}}' )
|
||||
<!-- call ClearStatus: strictly not needed as we are near finished rendering, and any new page will lose it from memory (better to be explicit) -->
|
||||
{{ ClearStatus() }}
|
||||
{% endif %}
|
||||
CheckForJobs()
|
||||
/*
|
||||
<!-- this this is totally useless as can only live for this 1 page render anyway -->
|
||||
{{ ClearStatus() }}
|
||||
{% if GetJM_Message() != None and GetJM_Message().alert == "success" %}
|
||||
msg="{{GetJM_Message().message}}"
|
||||
msg=msg.replace('href=', 'class=link-light href=')
|
||||
st=Object; st.message=msg; st.alert="success"; StatusMsg(st)
|
||||
StatusMsg(st)
|
||||
{% set dont_print=ClearJM_Message(GetJM_Message().id) %}
|
||||
{% endif %}
|
||||
*/
|
||||
} )
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user