Optimized template draft

This commit is contained in:
Kevin Frantz
2019-02-25 12:50:26 +01:00
parent d0adc9b42a
commit 2cf9e019e8
22 changed files with 208 additions and 178 deletions

View File

@@ -0,0 +1,12 @@
{% set icon_class = layer_icon_class_map.getIconClass(layer) %}
<i class="{{ icon_class }}"></i>
{# <a href="{{
path('infinito_api_rest_layer_read',{'layer':layer,'_format':'html'})}}">
#}
{{ layer|capitalize }}: {# </a>#}
{% if slug is defined and slug%}
<a
href="{{ path('infinito_api_rest_layer_read',{'identity':slug,'layer':layer,'_format':'html'}) }}">
{{ slug }}</a>{% endif %}<a
href="{{ path('infinito_api_rest_layer_read',{'identity':id,'layer':layer,'_format':'html'}) }}">#{{ id }}
</a>

View File

@@ -12,7 +12,10 @@
<td>{{ name|trans }}</td>
<td>
{% if id and layer %}
<a href="{{ path('infinito_api_rest_layer_read',{'identity':id,'layer':layer,'_format':'html'}) }}">{{ content }}</a>
<a href="{{ path('infinito_api_rest_layer_read',{'identity':id,'layer':layer,'_format':'html'}) }}">
<i class="fas fa-link"></i>
{% if id == content %}#{% endif %}{{ content }}
</a>
{% else %}
{{ content }}
{% endif %}

View File

@@ -1,115 +1,51 @@
{# @todo Refactor this template #}
{% 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 %}
{% set headline = (layer|trans|capitalize)~': ' %}
{% if requested_action_service.hasRequestedEntity()%}
{% 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 %}
{% endif %}
{% set headline = headline~'#'~entity.id %}
{% block title %}
{{ headline }}:
{{ headline }}
{% endblock %}
{% block content %}
<h1>
{{ headline }}
</h1>
<div id="accordion">
{% 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="false"
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-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 %}
{% endfor %}
</div>
<hr />
<div id="accordion">
<div class="card">
<div class="card-header" id="headingThree">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse"
data-target="#collapseThree" aria-expanded="false"
aria-controls="collapseThree">
<i class="fas fa-wrench"></i> Manage
</button>
</h5>
</div>
<div id="collapseThree" class="collapse"
aria-labelledby="headingThree" data-parent="#accordion">
<div class="card-body">Anim pariatur cliche reprehenderit, enim
eiusmod high life accusamus terry richardson ad squid. 3 wolf moon
officia aute, non cupidatat skateboard dolor brunch. Food truck
quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt
aliqua put a bird on it squid single-origin coffee nulla assumenda
shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes
anderson cred nesciunt sapiente ea proident. Ad vegan excepteur
butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw
denim aesthetic synth nesciunt you probably haven't heard of them
accusamus labore sustainable VHS.</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingHistory">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse"
data-target="#collapseHistory" aria-expanded="false"
aria-controls="collapseHistory">
<i class="fas fa-history"></i> History
</button>
</h5>
</div>
<div id="collapseHistory" class="collapse"
aria-labelledby="headingHistory" data-parent="#accordion">
<div class="card-body">Anim pariatur cliche reprehenderit, enim
eiusmod high life accusamus terry richardson ad squid. 3 wolf moon
officia aute, non cupidatat skateboard dolor brunch. Food truck
quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt
aliqua put a bird on it squid single-origin coffee nulla assumenda
shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes
anderson cred nesciunt sapiente ea proident. Ad vegan excepteur
butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw
denim aesthetic synth nesciunt you probably haven't heard of them
accusamus labore sustainable VHS.</div>
</div>
</div>
<div class="card">
<div class="card-header" id="headingRelation">
<h5 class="mb-0">
<button class="btn btn-link collapsed" data-toggle="collapse"
data-target="#collapseHistory" aria-expanded="false"
aria-controls="collapseRelation">
<i class="fas fa-map-marked-alt"></i> Map
</button>
</h5>
</div>
<div id="collapseRelation" class="collapse"
aria-labelledby="headingRelation" data-parent="#accordion">
<div class="card-body">Anim pariatur cliche reprehenderit, enim
eiusmod high life accusamus terry richardson ad squid. 3 wolf moon
officia aute, non cupidatat skateboard dolor brunch. Food truck
quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt
aliqua put a bird on it squid single-origin coffee nulla assumenda
shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes
anderson cred nesciunt sapiente ea proident. Ad vegan excepteur
butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw
denim aesthetic synth nesciunt you probably haven't heard of them
accusamus labore sustainable VHS.</div>
</div>
</div>
</div>
<h1>
{% include "element/link/_layer_link.html.twig" with {'id':entity.getId(),'layer':layer,'slug':((entity.hasSlug() is defined and entity.hasSlug())?entity.getSlug():null)} %}
</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 %}
{% endblock %}

View File

@@ -1,6 +0,0 @@
{% extends "frames/default.html.twig" %}
{% block title %}
{% trans %}
Law
{% endtrans %}
{% endblock %}

View File

@@ -1,17 +0,0 @@
{% extends "law/law.html.twig" %}
{% block content %}
<h1>
{% trans %}
Law
{% endtrans %}
#
{{ law.id }}
</h1>
{% trans %}
Responsible for:
{% endtrans %}
<a href="{{ path('app_node_show',{'id':law.node.id})}}"> {% trans with {'%law.node.id%':law.node.id}%}
node #%law.node.id% {% endtrans %}
</a>
.
{% endblock %}

View File

@@ -1,3 +0,0 @@
{{ form_start(form) }}
{{ form_widget(form) }}
{{ form_end(form) }}

View File

@@ -1,5 +0,0 @@
{% extends "source/form/source.html.twig" %}
{% block content %}
<h1>{% trans %} Name {% endtrans %}</h1>
{% include "source/form/content/name." ~ app.request.requestFormat ~ ".twig" %}
{% endblock %}

View File

@@ -1,6 +0,0 @@
{% extends "source/source.html.twig" %}
{% block title %}
{% trans %}
Source edit
{% endtrans %}
{% endblock %}

View File

@@ -1 +0,0 @@
{{ source.name }}

View File

@@ -1 +0,0 @@
{% include "source/view/content/name." ~ app.request.requestFormat ~ ".twig" with {'source':source.nameSource}%}

View File

@@ -1,5 +0,0 @@
{% extends "source/view/source.html.twig" %}
{% block content %}
<h1>{% trans %} Name {% endtrans %}</h1>
{% include "source/view/content/name." ~ app.request.requestFormat ~ ".twig" %}
{% endblock %}

View File

@@ -1,7 +0,0 @@
{% extends "source/source.html.twig" %}
{% block title %}
{% trans %}
Source
{% endtrans %}
#{{ source.id }}
{% endblock %}

View File

@@ -1,5 +0,0 @@
{% extends "source/view/source.html.twig" %}
{% block content %}
<h1>{% trans %} User {% endtrans %}</h1>
{% include "source/view/content/user." ~ app.request.requestFormat ~ ".twig" %}
{% endblock %}