refactored page actions to event subscriber (#2420)

This commit is contained in:
Kevin Papst
2021-03-15 14:18:44 +01:00
committed by GitHub
parent 9a2fd9ba91
commit e1c9af795c
117 changed files with 2403 additions and 815 deletions

View File

@@ -1,14 +0,0 @@
{% macro export(view) %}
{% import "macros/widgets.html.twig" as widgets %}
{% set actions = {'visibility': '#modal_export'} %}
{% if view == 'preview' %}
{% set actions = actions|merge({'off': {'id':'export-toggle-button'}}) %}
{% endif %}
{% set actions = actions|merge({'help': {'url': 'export.html'|docu_link, 'target': '_blank'}}) %}
{% set event = trigger('actions.export', {'actions': actions, 'view': view}) %}
{{ widgets.page_actions(event.payload.actions) }}
{% endmacro %}

View File

@@ -2,7 +2,6 @@
{% import "macros/widgets.html.twig" as widgets %}
{% import "macros/toolbar.html.twig" as toolbar %}
{% import "macros/datatables.html.twig" as tables %}
{% import "export/actions.html.twig" as actions %}
{% set columns = {
'date': {'class': 'alwaysVisible text-nowrap', 'orderBy': false},
@@ -21,7 +20,10 @@
{% block page_title %}{{ 'export.title'|trans }}{% endblock %}
{% block page_subtitle %}{{ 'export.subtitle'|trans }}{% endblock %}
{% block page_actions %}{{ actions.export((preview_show ? 'preview' : 'index')) }}{% endblock %}
{% block page_actions %}
{% set event = actions(app.user, 'export', (preview_show ? 'preview' : 'index')) %}
{{ widgets.page_actions(event.actions) }}
{% endblock %}
{% block main_before %}
{{ tables.data_table_column_modal(tableName, columns) }}