33 lines
1.2 KiB
HTML
33 lines
1.2 KiB
HTML
{% import 'admin/static.html' as admin_static with context %}
|
|
|
|
{% macro dropdown(actions, btn_class='dropdown-toggle') -%}
|
|
<a class="{{ btn_class }}" data-toggle="dropdown" href="javascript:void(0)"><b>{{ _gettext('With selected') }}</b><b class="caret"></b></a>
|
|
<ul class="dropdown-menu">
|
|
{% for p in actions %}
|
|
<li>
|
|
<a href="javascript:void(0)" onclick="return modelActions.execute('{{ p[0] }}');">{{ _gettext(p[1]) }}</a>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% endmacro %}
|
|
|
|
{% macro form(actions, url) %}
|
|
{% if actions %}
|
|
<form id="action_form" action="{{ url }}" method="POST" style="display: none">
|
|
{% if csrf_token %}
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
|
|
{% endif %}
|
|
<input type="hidden" id="action" name="action" />
|
|
</form>
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% macro script(message, actions, actions_confirmation) %}
|
|
{% if actions %}
|
|
<script src="{{ admin_static.url(filename='admin/js/actions-1.0.0.js') }}"></script>
|
|
<script language="javascript">
|
|
var modelActions = new AdminModelActions({{ message|tojson|safe }}, {{ actions_confirmation|tojson|safe }});
|
|
</script>
|
|
{% endif %}
|
|
{% endmacro %}
|