2021-05-17 19:34:49 +00:00
|
|
|
{% import 'admin/static.html' as admin_static with context %}
|
|
|
|
|
2022-03-02 22:35:20 +00:00
|
|
|
{% macro dropdown(actions, btn_class='nav-link dropdown-toggle') -%}
|
|
|
|
<a class="{{ btn_class }}" data-toggle="dropdown" href="javascript:void(0)" role="button" aria-haspopup="true"
|
|
|
|
aria-expanded="false">{{ _gettext('With selected') }}<b class="caret"></b></a>
|
|
|
|
<div class="dropdown-menu">
|
2021-05-17 19:34:49 +00:00
|
|
|
{% for p in actions %}
|
2022-03-02 22:35:20 +00:00
|
|
|
<a class="dropdown-item" href="javascript:void(0)"
|
|
|
|
onclick="return modelActions.execute('{{ p[0] }}');">{{ _gettext(p[1]) }}</a>
|
2021-05-17 19:34:49 +00:00
|
|
|
{% endfor %}
|
2022-03-02 22:35:20 +00:00
|
|
|
</div>
|
2021-05-17 19:34:49 +00:00
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro form(actions, url) %}
|
|
|
|
{% if actions %}
|
2022-03-02 22:35:20 +00:00
|
|
|
<form id="action_form" action="{{ url }}" method="POST" style="display: none">
|
|
|
|
{% if action_form.csrf_token %}
|
|
|
|
{{ action_form.csrf_token }}
|
|
|
|
{% elif csrf_token %}
|
|
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
|
|
{% endif %}
|
|
|
|
{{ action_form.url(value=return_url) }}
|
|
|
|
{{ action_form.action() }}
|
|
|
|
</form>
|
2021-05-17 19:34:49 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
|
|
|
|
|
|
|
{% macro script(message, actions, actions_confirmation) %}
|
|
|
|
{% if actions %}
|
|
|
|
<div id="actions-confirmation-data" style="display:none;">{{ actions_confirmation|tojson|safe }}</div>
|
|
|
|
<div id="message-data" style="display:none;">{{ message|tojson|safe }}</div>
|
|
|
|
<script src="{{ admin_static.url(filename='admin/js/actions.js', v='1.0.0') }}"></script>
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|