added persistent and cant_close to PA_JobManager_FE_Message, used them from pa_job_manager to set status messages with persistence/close buttons appropriately for items like fix_dups/stale_jobs. When "fixing" now, the persistent Status message stays, but its now positioned approx. below the navbar on the right and is ok. Started on changing status to a more sensible naming conventions (away from alert to level) - more work to complete this

This commit is contained in:
2023-01-10 17:45:02 +11:00
parent 56c2d586b6
commit 0784861331
8 changed files with 46 additions and 64 deletions

View File

@@ -128,40 +128,14 @@
</div class="collapse navbar-collapse">
</div class="container-fluid">
</nav>
{% if GetJM_Message() != None %}
{% set msg=GetJM_Message() %}
<!-- if we are fixing things dont put up alert -->
{% 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.job.name != "checkdups" %}
<form id="_dismiss" action="{{url_for('clear_jm_msg', id=msg.id)}}" method="POST">
<button type="button" class="close btn border-secondary me-3" aria-label="Close" onClick="$('#_dismiss').submit()">
<span aria-hidden="true">&times;</span>
</button>
{% endif %}
{% if msg.job_id %}
<a href="{{url_for('joblog', id=msg.job_id)}}">Job #{{msg.job_id}}</a>:
{% endif %}
{{msg.message|safe}}
</form>
</div>
{# if a JM is a danger message, allow code to remove the status, it should be 'permanent' until addressed -- e.g. you have duplicates, fix them #}
{% if msg.alert != "danger" %}
{% set dont_print=ClearJM_Message(msg.id) %}
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endif %} {# not InDBox #}
{% block main_content %}
{% endblock main_content %}
{% if not InDBox %}
{%block script_content %}{% endblock script_content %}
<div id="status_container" class="position-fixed top-1 end-0 p-1" style="z-index: 11">
<div id="status_container" class="position-fixed top-0 end-0 p-1 my-5" "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">
@@ -177,7 +151,6 @@
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 %}