toast now used for JM messages that are successful, its a hack but good enough for now added TODO to do this all properly one day

This commit is contained in:
2023-01-05 20:49:48 +11:00
parent a64b449327
commit 62f476e80f
2 changed files with 32 additions and 22 deletions

3
TODO
View File

@@ -1,8 +1,9 @@
### GENERAL
* get all status messages to use toasts AND get func to also increase/descrease the job counter as appropriate)
- [DONE] all status messages use toasts
-- [TODO] make a helper func for setting toast body and use it in base.html && file_support.js
-- [DONE] make a helper func for setting toast body and use it in base.html && file_support.js
-- [TODO] make a helper func for setting 'Active Jobs' text/badge and call it when document ready (rather/both than start of base.html)
-- should allow all JM Messages, or other messages to be an active Ajax poll until a job has completed
* ignore face should ignore ALL matching faces (re: Declan)

View File

@@ -137,6 +137,7 @@
{% if GetJM_Message() != None %}
{% set msg=GetJM_Message() %}
{% if request.endpoint != "fix_dups" and request.endpoint != "rm_dups" and request.endpoint != "stale_jobs" %}
{% if msg.alert != "success" %}
<div class="py-2 mx-1 alert alert-{{msg.alert}}">
{% if msg.alert != "success" and msg.job.name != "checkdups" %}
<form id="_dismiss" action="{{url_for('clear_jm_msg', id=msg.id)}}" method="POST">
@@ -156,6 +157,7 @@
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% block main_content %}
@@ -172,16 +174,23 @@
</div>
</div>
</div>
{% if GetMessage()|length %}
<script>
$(document).ready(function() {
{% if GetMessage()|length %}
msg = "{{ GetMessage()|safe }}"
msg=msg.replace('href=', 'class=link-light href=')
st=Object; st.message=msg; st.alert="success"; StatusMsg(st)
} )
</script>
{{ ClearStatus() }}
{% endif %}
{% 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>
</html>
{% endif %}