fix: only show execution panel if batch view supports it
e.g. POS batch view should not
This commit is contained in:
parent
6fd4e15ca2
commit
9b5b7ad9a7
1 changed files with 74 additions and 72 deletions
|
|
@ -7,86 +7,88 @@
|
|||
</%def>
|
||||
|
||||
<%def name="tool_panel_execution()">
|
||||
<wutta-tool-panel heading="Execution">
|
||||
% if batch.executed:
|
||||
<b-notification :closable="false">
|
||||
<p class="block">
|
||||
Batch was executed<br />
|
||||
${app.render_time_ago(batch.executed)}<br />
|
||||
by ${batch.executed_by}
|
||||
</p>
|
||||
</b-notification>
|
||||
% elif why_not_execute:
|
||||
<b-notification type="is-warning" :closable="false">
|
||||
<p class="block">
|
||||
Batch cannot be executed:
|
||||
</p>
|
||||
<p class="block">
|
||||
${why_not_execute}
|
||||
</p>
|
||||
</b-notification>
|
||||
% else:
|
||||
% if master.has_perm('execute'):
|
||||
<b-notification type="is-success" :closable="false">
|
||||
% if master.executable:
|
||||
<wutta-tool-panel heading="Execution">
|
||||
% if batch.executed:
|
||||
<b-notification :closable="false">
|
||||
<p class="block">
|
||||
Batch can be executed
|
||||
Batch was executed<br />
|
||||
${app.render_time_ago(batch.executed)}<br />
|
||||
by ${batch.executed_by}
|
||||
</p>
|
||||
<b-button type="is-primary"
|
||||
@click="executeInit()"
|
||||
icon-pack="fas"
|
||||
icon-left="arrow-circle-right">
|
||||
Execute Batch
|
||||
</b-button>
|
||||
|
||||
<b-modal has-modal-card
|
||||
:active.sync="executeShowDialog">
|
||||
<div class="modal-card">
|
||||
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Execute ${model_title}</p>
|
||||
</header>
|
||||
|
||||
## TODO: forcing black text b/c of b-notification
|
||||
## wrapping button, which has white text
|
||||
<section class="modal-card-body has-text-black">
|
||||
<p class="block has-text-weight-bold">
|
||||
What will happen when this batch is executed?
|
||||
</p>
|
||||
<div class="content">
|
||||
${execution_described|n}
|
||||
</div>
|
||||
${h.form(master.get_action_url('execute', batch), ref='executeForm')}
|
||||
${h.csrf_token(request)}
|
||||
${h.end_form()}
|
||||
</section>
|
||||
|
||||
<footer class="modal-card-foot">
|
||||
<b-button @click="executeShowDialog = false">
|
||||
Cancel
|
||||
</b-button>
|
||||
<b-button type="is-primary"
|
||||
@click="executeSubmit()"
|
||||
icon-pack="fas"
|
||||
icon-left="arrow-circle-right"
|
||||
:disabled="executeSubmitting">
|
||||
{{ executeSubmitting ? "Working, please wait..." : "Execute Batch" }}
|
||||
</b-button>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</b-modal>
|
||||
</b-notification>
|
||||
|
||||
% else:
|
||||
% elif why_not_execute:
|
||||
<b-notification type="is-warning" :closable="false">
|
||||
<p class="block">
|
||||
Batch may be executed,<br />
|
||||
but you do not have permission.
|
||||
Batch cannot be executed:
|
||||
</p>
|
||||
<p class="block">
|
||||
${why_not_execute}
|
||||
</p>
|
||||
</b-notification>
|
||||
% else:
|
||||
% if master.has_perm('execute'):
|
||||
<b-notification type="is-success" :closable="false">
|
||||
<p class="block">
|
||||
Batch can be executed
|
||||
</p>
|
||||
<b-button type="is-primary"
|
||||
@click="executeInit()"
|
||||
icon-pack="fas"
|
||||
icon-left="arrow-circle-right">
|
||||
Execute Batch
|
||||
</b-button>
|
||||
|
||||
<b-modal has-modal-card
|
||||
:active.sync="executeShowDialog">
|
||||
<div class="modal-card">
|
||||
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Execute ${model_title}</p>
|
||||
</header>
|
||||
|
||||
## TODO: forcing black text b/c of b-notification
|
||||
## wrapping button, which has white text
|
||||
<section class="modal-card-body has-text-black">
|
||||
<p class="block has-text-weight-bold">
|
||||
What will happen when this batch is executed?
|
||||
</p>
|
||||
<div class="content">
|
||||
${execution_described|n}
|
||||
</div>
|
||||
${h.form(master.get_action_url('execute', batch), ref='executeForm')}
|
||||
${h.csrf_token(request)}
|
||||
${h.end_form()}
|
||||
</section>
|
||||
|
||||
<footer class="modal-card-foot">
|
||||
<b-button @click="executeShowDialog = false">
|
||||
Cancel
|
||||
</b-button>
|
||||
<b-button type="is-primary"
|
||||
@click="executeSubmit()"
|
||||
icon-pack="fas"
|
||||
icon-left="arrow-circle-right"
|
||||
:disabled="executeSubmitting">
|
||||
{{ executeSubmitting ? "Working, please wait..." : "Execute Batch" }}
|
||||
</b-button>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</b-modal>
|
||||
</b-notification>
|
||||
|
||||
% else:
|
||||
<b-notification type="is-warning" :closable="false">
|
||||
<p class="block">
|
||||
Batch may be executed,<br />
|
||||
but you do not have permission.
|
||||
</p>
|
||||
</b-notification>
|
||||
% endif
|
||||
% endif
|
||||
% endif
|
||||
</wutta-tool-panel>
|
||||
</wutta-tool-panel>
|
||||
% endif
|
||||
</%def>
|
||||
|
||||
<%def name="modify_vue_vars()">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue