{% set filters_resolved = ctx.blocks.get(block.filters) if block.filters else none %} {% set filters_block = filters_resolved.block if filters_resolved else none %} {% set actions_resolved = ctx.blocks.get(block.actions) if block.actions else none %} {% set actions_block = actions_resolved.block if actions_resolved else none %} {% set table_resolved = ctx.blocks.get(block.target) if block.target else none %} {% set table_block = table_resolved.block if table_resolved else none %} {% set has_settings = table_block is not none and table_block.settings is not none %} {% set search_value = resolved.extra.get('search_value', block.search.value if block.search else '') %} {% set pref_grid_id = resolved.extra.get('pref_grid_id', block.search.bind or block.target or block.id if block.search else block.id) %}
{% if actions_block %} {% set button_items = actions_block.items | selectattr('type', 'equalto', 'button') | list %} {% if button_items %}
{% for action in button_items %} {% include '_action_button.html' %} {% endfor %}
{% endif %} {% endif %} {% if block.search %}
{% if block.search.saved %}
{% endif %}
{% endif %}
{% if filters_block %}
{{ host.translate('filter_bar.filters_label') | e }} {% set fb = filters_block %} {% set fb_search = {'param': block.search.param, 'value': search_value} if block.search else none %} {% include '_filter_bar.html' %}
{% endif %} {% if block.clear_all and block.target %} {% endif %}
{% for counter in block.counters %}
{% set _tone_cls = {'success': 'cm-val-green', 'danger': 'cm-val-red', 'warning': 'cm-val-yellow', 'muted': 'cm-muted'} %} {{ counter.label | e }}: {% if counter.total is not none %}{{ counter.value | e }}/{{ counter.total | e }}{% else %}{{ counter.value | e }}{% endif %}
{% endfor %} {% if actions_block or has_settings %}
{% if actions_block %} {% set export_items = actions_block.items | selectattr('type', 'equalto', 'export') | list %} {% set link_items = actions_block.items | selectattr('type', 'equalto', 'link') | list %} {% if export_items %}
{% for action in export_items %} {% set href = export_action_href(action) %} {% if action.format == 'xlsx' %} {% elif action.format == 'pdf' %} {% endif %} {{ host.translate('export.' ~ action.format) | e }} {% endfor %}
{% endif %} {% for action in link_items %} {% include '_action_link.html' %} {% endfor %} {% endif %} {% if has_settings %} {% endif %} {% if block.reload and block.target %} {% endif %}
{% endif %}