{# * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} {% extends "ChillCustomFieldsBundle::Admin/layout.html.twig" %} {% block title %}{{ 'CustomFieldsGroup details'|trans }}{% endblock %} {% block admin_content %}

{{ 'CustomFieldsGroup details'|trans }}

{%- for key in options -%} {%- else -%} {%- endfor -%}
{{ 'Name'|trans }} {{ entity.getName|localize_translatable_string }}
{{ 'Entity'|trans }} {{ entity.entity|trans }}
{{ key ~ '_label'|trans }} {%- if entity.options[key] is not defined -%} {{ 'No value defined for this option'|trans }} {%- elseif entity.options[key] is iterable -%} {{ entity.options[key]|join(', ') }} {% else %} {{ entity.options[key] }} {%- endif -%}

{{ 'Fields associated with this group'|trans }}

{%- if entity.customFields|length > 0 -%} {%- for field in entity.customFields -%} {%- endfor -%}
{{ 'ordering'|trans|capitalize }} {{ 'label_field'|trans|capitalize }} {{ 'type'|trans|capitalize }} {{ 'active'|trans|capitalize }}  
{{ field.ordering }} {{ field.name|localize_translatable_string }} {{ field.type|trans }} {%- if field.active -%} {%- else -%} {%- endif -%} {{ 'edit'|trans|capitalize }}
{{ form_start(create_field_form) }}
{{ form_widget(create_field_form.type) }}
{{ form_widget(create_field_form.submit, { 'attr': { 'class': 'sc-button bt-create' }, 'label': 'Add a new field' } ) }} {{ form_end(create_field_form) }} {%- else -%}

{{ 'Any field is currently associated with this group'|trans }}

{{ form_start(create_field_form) }}
{{ form_widget(create_field_form.type) }}
{{ form_widget(create_field_form.submit, { 'attr': { 'class': 'sc-button bt-create' }, 'label': 'Create a new field' } ) }} {{ form_end(create_field_form) }} {%- endif -%} {% endblock %}