use dropdown for entity actions on detail pages (#801)

This commit is contained in:
Kevin Papst
2019-05-21 23:21:26 +02:00
committed by GitHub
parent ec174a38a9
commit 871b2e52c7
12 changed files with 52 additions and 193 deletions

View File

@@ -27,7 +27,7 @@
{% set actions = actions|merge({'timesheet': path('admin_timesheet', {'customer': activity.project ? activity.project.customer.id : null, 'project': activity.project ? activity.project.id : null, 'activity': activity.id})}) %}
{% endif %}
{% if is_granted('create_other_timesheet') %}
{% set actions = actions|merge({'create-timesheet': path('admin_timesheet_create', {'project': activity.project ? activity.project.id : null, 'activity': activity.id})}) %}
{% set actions = actions|merge({'create-timesheet': {'url': path('admin_timesheet_create', {'project': activity.project ? activity.project.id : null, 'activity': activity.id}), 'class': 'modal-ajax-form'}}) %}
{% endif %}
{% if view == 'index' and is_granted('delete', activity) %}
{% set actions = actions|merge({'trash': {'url': path('admin_activity_delete', {'id': activity.id}), 'class': 'modal-ajax-form'}}) %}
@@ -35,14 +35,14 @@
{% endif %}
{% if view != 'index' %}
{% set actions = actions|merge({'list': path('admin_activity')}) %}
{% set actions = actions|merge({'activity': path('admin_activity')}) %}
{% endif %}
{% set event = trigger('actions.activity', {'actions': actions, 'view': view, 'activity': activity}) %}
{% if view == 'index' %}
{{ widgets.table_actions(event.payload.actions) }}
{% else %}
{{ widgets.page_actions(event.payload.actions) }}
{{ widgets.entity_actions(event.payload.actions) }}
{% endif %}
{% endmacro %}
@@ -84,7 +84,7 @@
{% if view == 'index' %}
{{ widgets.table_actions(event.payload.actions) }}
{% else %}
{{ widgets.page_actions(event.payload.actions) }}
{{ widgets.entity_actions(event.payload.actions) }}
{% endif %}
{% endmacro %}
@@ -127,14 +127,14 @@
{% endif %}
{% if view != 'index' %}
{% set actions = actions|merge({'list': path('admin_project')}) %}
{% set actions = actions|merge({'project': path('admin_project')}) %}
{% endif %}
{% set event = trigger('actions.project', {'actions': actions, 'view': view, 'project': project}) %}
{% if view == 'index' %}
{{ widgets.table_actions(event.payload.actions) }}
{% else %}
{{ widgets.page_actions(event.payload.actions) }}
{{ widgets.entity_actions(event.payload.actions) }}
{% endif %}
{% endmacro %}
@@ -180,14 +180,14 @@
{% endif %}
{% if view != 'index' %}
{% set actions = actions|merge({'list': path('admin_customer')}) %}
{% set actions = actions|merge({'customer': path('admin_customer')}) %}
{% endif %}
{% set event = trigger('actions.customer', {'actions': actions, 'view': view, 'customer': customer}) %}
{% if view == 'index' %}
{{ widgets.table_actions(event.payload.actions) }}
{% else %}
{{ widgets.page_actions(event.payload.actions) }}
{{ widgets.entity_actions(event.payload.actions) }}
{% endif %}
{% endmacro %}
@@ -247,14 +247,14 @@
{% endif %}
{% if view != 'index' %}
{% set actions = actions|merge({'list': path('timesheet')}) %}
{% set actions = actions|merge({'timesheet': path('timesheet')}) %}
{% endif %}
{% set event = trigger('actions.timesheet', {'actions': actions, 'view': view, 'timesheet': timesheet}) %}
{% if view == 'index' %}
{{ widgets.table_actions(event.payload.actions) }}
{% else %}
{{ widgets.page_actions(event.payload.actions) }}
{{ widgets.entity_actions(event.payload.actions) }}
{% endif %}
{%- endfilter -%}
{% endmacro %}
@@ -302,14 +302,14 @@
{% endif %}
{% if view != 'index' %}
{% set actions = actions|merge({'list': path('admin_timesheet')}) %}
{% set actions = actions|merge({'timesheet': path('admin_timesheet')}) %}
{% endif %}
{% set event = trigger('actions.timesheet_team', {'actions': actions, 'view': view, 'timesheet': timesheet}) %}
{% if view == 'index' %}
{{ widgets.table_actions(event.payload.actions) }}
{% else %}
{{ widgets.page_actions(event.payload.actions) }}
{{ widgets.entity_actions(event.payload.actions) }}
{% endif %}
{% endmacro %}
@@ -331,7 +331,7 @@
{% if view == 'index' %}
{{ widgets.table_actions(event.payload.actions) }}
{% else %}
{{ widgets.page_actions(event.payload.actions) }}
{{ widgets.entity_actions(event.payload.actions) }}
{% endif %}
{% endmacro %}