Refactored source.html.twig

This commit is contained in:
Kevin Frantz 2019-02-24 15:34:33 +01:00
parent ecf819196d
commit b6f7a1e9b8
2 changed files with 10 additions and 3 deletions

View File

@ -5,6 +5,7 @@ twig:
form_themes: ['bootstrap_4_layout.html.twig']
globals:
layer_action_map: "@Infinito\\Domain\\LayerManagement\\LayerActionMap"
requested_action_service: "@Infinito\\Domain\\RequestManagement\\Action\\RequestedActionService"
action_icon_class_map: "@Infinito\\Domain\\TwigManagement\\ActionIconClassMap"
action_template_name_service: "@Infinito\\Domain\\TemplateManagement\\ActionTemplateNameServiceInterface"
action_template_data_store_service: "@Infinito\\Domain\\TemplateManagement\\ActionTemplateDataStoreServiceInterface"

View File

@ -1,14 +1,20 @@
{% extends "frames/default.html.twig" %}
{% set layer = requested_action_service.getLayer()%}
{% set entity = action_template_data_store_service.getData('read') %}
{% set headline = (layer|trans|capitalize)~':' %}
{% if entity.hasSlug %}
{% set headline = headline~entity.slug %}
{% endif %}
{% set headline = headline~'#'~entity.id %}
{% block title %}
{{ 'Source'|trans }}: {% if entity.hasSlug %}{{ entity.slug }}{% endif %}#{{ entity.id }}
{{ headline }}:
{% endblock %}
{% block content %}
<h1>
{{ 'Source'|trans }}: {% if entity.hasSlug %}{{ entity.slug }}{% endif %}#{{ entity.id }}
{{ headline }}
</h1>
<div id="accordion">
{% for action in layer_action_map.getActions('source') %}
{% for action in layer_action_map.getActions(layer) %}
{{ action_template_name_service.setActionType(action) }}
{% if action_template_name_service.doesAtomTemplateExist() %}
<div class="card">