fix show page

This commit is contained in:
2015-11-05 23:49:22 +01:00
parent bb1e690bec
commit 043f5a1eaf
3 changed files with 107 additions and 26 deletions

View File

@@ -16,37 +16,85 @@
#}
{% extends "ChillCustomFieldsBundle::Admin/layout.html.twig" %}
{% block title%}{{ 'CustomFieldsGroup details'|trans }}{% endblock %}
{% block admin_content %}
<h1>CustomFieldsGroup</h1>
<h1>{{ 'CustomFieldsGroup details'|trans }}</h1>
<table class="record_properties">
<tbody>
<tr>
<th>Id</th>
<td>{{ entity.id }}</td>
<th>{{ 'Name'|trans }}</th>
<td>{{ entity.getName|localize_translatable_string }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ entity.getName(app.request.locale) }}</td>
</tr>
<tr>
<th>Entity</th>
<td>{{ entity.entity }}</td>
<th>{{ 'Entity'|trans }}</th>
<td>{{ entity.entity|trans }}</td>
</tr>
</tbody>
</table>
<ul class="record_actions">
<li>
<a href="{{ path('customfieldsgroup') }}">
Back to the list
</a>
</li>
<li>
<a href="{{ path('customfieldsgroup_edit', { 'id': entity.id }) }}">
Edit
</a>
</li>
<li>{{ form(delete_form) }}</li>
</ul>
<ul class="record_actions">
<li>
<a href="{{ path('customfieldsgroup') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
<a href="{{ path('customfieldsgroup_edit', { 'id': entity.id }) }}" class="sc-button bt-edit">
{{ 'Edit'|trans }}
</a>
</li>
</ul>
<h2>{{ 'Fields associated with this group'|trans }}</h2>
{%- if entity.customFields|length > 0 -%}
<table>
<thead>
<tr>
<th>{{ 'ordering'|trans|capitalize }}</th>
<th>{{ 'label_field'|trans|capitalize }}</th>
<th>{{ 'type'|trans|capitalize }}</th>
<th>{{ 'active'|trans|capitalize }}</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{%- for field in entity.customFields -%}
<tr>
<td>{{ field.ordering }}</td>
<td>{{ field.name|localize_translatable_string }}</td>
<td>{{ field.type|trans }}</td>
<td style="text-align:center;">
{%- if field.active -%}
<i class="fa fa-check-square-o"></i>
{%- else -%}
<i class="fa fa-square-o"></i>
{%- endif -%}
</td>
<td style="text-align:center">
<a href="{{ path('customfield_edit', { 'id' : field.id }) }}" class="sc-button bt-edit">{{ 'edit'|trans|capitalize }}</a>
</td>
</tr>
{%- endfor -%}
</tbody>
</table>
{{ form_start(create_field_form) }}
<div class="grid-4">
{{ form_widget(create_field_form.type) }}
</div>
{{ form_widget(create_field_form.submit, { 'attr': { 'class': 'sc-button bt-create' }, 'label': 'Add a new field' } ) }}
{{ form_end(create_field_form) }}
{%- else -%}
<p>
{{ 'Any field is currently associated with this group'|trans }}
</p>
{{ form_start(create_field_form) }}
<div class="grid-4">
{{ form_widget(create_field_form.type) }}
</div>
{{ form_widget(create_field_form.submit, { 'attr': { 'class': 'sc-button bt-create' }, 'label': 'Create a new field' } ) }}
{{ form_end(create_field_form) }}
{%- endif -%}
{% endblock %}