{% extends bap.layout %} {% import '@OroUI/macros.html.twig' as UI %} {% oro_title_set({params : {"%name%": dashboard.getLabel() }}) %} {% block breadcrumb %} {% set breadcrumbs = [ {'label': 'oro.dashboard.menu.dashboards_tab.label'|trans }, {'label': dashboard.getLabel()|trans } ] %} {% include '@OroNavigation/Menu/breadcrumbs.html.twig' %} {% endblock breadcrumb %} {% block content %} {% set widgetIdPrefix = 'dashboard-widget-' ~ random() ~ '-' %} {% set allowEdit = is_granted('EDIT', dashboard.entity) %} {% set availableWidgets = [] %} {% for widgetName, widget in widgets %} {% if widget.acl is not defined or is_granted(widget.acl) %} {% set icon = asset(widget.icon|default("bundles/orodashboard/img/no_icon.png")) %} {% set title = widget.label|trans %} {% set description = '' %} {% if widget.description is defined %} {% set description = widget.description|trans %} {% endif %} {% set availableWidgets = availableWidgets|merge([{ 'dialogIcon': icon, 'iconClass': widget.icon_class|default(null), 'title': title, 'widgetName': widgetName, 'description': description, 'isNew': widget.isNew, 'configurationDialogOptions': widget.configuration_dialog_options }]) %} {% endif %} {% endfor %} {% set widgetIds = [] %} {% for widget in dashboard.widgets %} {% if widget.config.acl is not defined or is_granted(widget.config.acl) %} {% set widgetIds = widgetIds|merge([widgetIdPrefix ~ widget.id]) %} {% endif %} {% endfor %} {% set dashboardContainerOptions = { widgetIds: widgetIds, dashboardId: dashboard.id, columnsSelector: '.dashboard-column', allowEdit: allowEdit ? 'true' : 'false', availableWidgets: availableWidgets } %} {% import '@OroUI/macros.html.twig' as UI %}