2019-02-25 12:50:26 +01:00
{# @todo Refactor this template #}
2019-02-17 22:05:20 +01:00
{% extends "frames/default.html.twig" %}
2019-02-24 15:34:33 +01:00
{% set layer = requested_action_service .getLayer ( ) %}
2019-02-25 12:50:26 +01:00
{% set headline = ( layer | trans | capitalize ) ~ ': ' %}
2019-02-25 20:45:15 +01:00
{% if requested_action_service .hasRequestedEntity ( ) and requested_action_service .getRequestedEntity ( ) .hasIdentity ( ) %}
2019-02-25 12:50:26 +01:00
{% set entity = requested_action_service .getRequestedEntity ( ) .getEntity ( ) %}
{% if entity .hasSlug is defined and entity .hasSlug %}
{% set headline = headline ~ entity .slug %}
{% endif %}
{% set headline = headline ~ '#' ~ entity .id %}
2019-02-24 15:34:33 +01:00
{% endif %}
2019-02-17 22:05:20 +01:00
{% block title %}
2019-02-25 12:50:26 +01:00
{{ headline }}
2019-02-17 22:05:20 +01:00
{% endblock %}
{% block content %}
2019-02-25 12:50:26 +01:00
<h1>
2019-02-25 20:45:15 +01:00
{% include "element/link/_layer_create_link.html.twig" with { 'layer' : layer } %}
{% if entity is defined %}
: {% include "element/link/_layer_read_link.html.twig" with { 'id' : entity .getId ( ) , 'layer' : layer , 'slug' : ( ( entity .hasSlug ( ) is defined and entity .hasSlug ( ) ) ? entity .getSlug ( ) : null ) } %}
{% endif %}
2019-02-25 12:50:26 +01:00
</h1>
{% if action_template_data_store_service .getAllStoredData ( ) .count ( ) > 0 %}
<div id="accordion">
{% set aria_expanded = 'true' %}
{% for action in layer_action_map .getActions ( layer ) %}
{% if action_template_data_store_service .isDataStored ( action ) %}
{{ action_template_name_service .setActionType ( action ) }}
<div class="card">
<div class="card-header" id="heading_ {{ action }} ">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse"
data-target="#collapse_ {{ action }} " aria-expanded=" {{ aria_expanded }} "
aria-controls="collapse_ {{ action }} ">
<i class=" {{ action_icon_class_map .getIconClass ( action ) }} "></i> {{ action | trans }}
</button>
</h5>
</div>
<div id="collapse_ {{ action }} " class="collapse {{ ( aria_expanded == 'true' ) ? 'show' :'' }} "
aria-labelledby="heading_ {{ action }} " data-parent="#accordion">
<div class="card-body">
{% include [ action_template_name_service .getAtomTemplateName ( ) , 'entity/_entity_' ~ action ~ '.html.twig' ] %}
</div>
</div>
</div>
{% endif %}
{% set aria_expanded = 'false' %}
{% endfor %}
</div>
{% else %}
<div class="alert alert-warning" role="alert">
<i class="fas fa-exclamation-triangle"></i> {{ 'This entity doesn\'t offer you any options. It seems like you don\'t have any right to perform actions on this entity.' | trans }}
</div>
{% endif %}
2019-02-17 22:05:20 +01:00
{% endblock %}