Optimized CRUD templated for entity

This commit is contained in:
Kevin Frantz 2019-02-25 21:23:49 +01:00
parent 90b14a1ef5
commit 6a9e9db8d8
3 changed files with 13 additions and 3 deletions

View File

@ -0,0 +1,5 @@
{% set form = action_template_data_store_service.getData(action) %}
{{ form_start(form,{'method':'POST'})}}
{{ form_widget(form) }}
<input type="submit" value="{{ action|trans|capitalize }}" class="btn btn-primary"/>
{{ form_end(form) }}

View File

@ -0,0 +1,4 @@
{% set form = action_template_data_store_service.getData(action) %}
{{ form_start(form, {'method': 'PUT'}) }}
{{ form(form) }}
{{ form_end(form) }}

View File

@ -1,8 +1,9 @@
{# @todo Refactor this template #}
{% extends "frames/default.html.twig" %}
{% set layer = requested_action_service.getLayer()%}
{% set headline = (layer|trans|capitalize)~': ' %}
{% set headline = (layer|trans|capitalize) %}
{% if requested_action_service.hasRequestedEntity() and requested_action_service.getRequestedEntity().hasIdentity() %}
{% set headline = headline~': ' %}
{% set entity = requested_action_service.getRequestedEntity().getEntity() %}
{% if entity.hasSlug is defined and entity.hasSlug %}
{% set headline = headline~entity.slug %}
@ -31,7 +32,7 @@
<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 }}
<i class="{{ action_icon_class_map.getIconClass(action) }}"></i> {{ action|trans|capitalize }}
</button>
</h5>
</div>
@ -42,8 +43,8 @@
</div>
</div>
</div>
{% set aria_expanded = 'false' %}
{% endif %}
{% set aria_expanded = 'false' %}
{% endfor %}
</div>
{% else %}