fix folder name

This commit is contained in:
2021-03-18 13:37:13 +01:00
parent a2f6773f5a
commit eaa0ad925f
1578 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* 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 <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %}
{% block title %}{{ 'CustomFieldsGroup edit'|trans }}{% endblock %}
{% block admin_content %}
<h1>{{ 'CustomFieldsGroup edit'|trans }}</h1>
{{ form_start(edit_form) }}
{{ form_row(edit_form.name) }}
{{ form_row(edit_form.entity) }}
{% if edit_form.options is defined %}
{{ form_row(edit_form.options) }}
{% endif %}
{{ form_row(edit_form.submit, { 'attr': { 'class': 'sc-button bt-edit' } } ) }}
{{ form_end(edit_form) }}
<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_show', { 'id' : entity.id }) }}" class="sc-button bt-cancel">
{{ 'show'|trans|capitalize }}
</a>
</li>
</ul>
{% endblock %}

View File

@@ -0,0 +1,67 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* 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 <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %}
{% block title %}{{ 'CustomFieldsGroup list'|trans }}{% endblock %}
{% block admin_content %}
<h1>{{ 'CustomFieldsGroup list'|trans }}</h1>
<table class="records_list">
<thead>
<tr>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Entity'|trans }}</th>
<th>{{ 'Is default ?'|trans }} <i class="fa fa-info-circle" title="{{ 'Some module select default groups for some usage. Example: the default person group is shown under person page.'|trans|escape('html_attr') }}"></i></th>
<th>{{ 'Actions'|trans }}</th>
</tr>
</thead>
<tbody>
{% for entity in entities %}
<tr>
<td><a href="{{ path('customfieldsgroup_show', { 'id': entity.id }) }}">{{ entity.name|localize_translatable_string }}</a></td>
<td>{{ entity.entity|trans }}</td>
<td style="text-align: center;">
{%- if entity.id in default_groups -%}
<i class="fa fa-star"></i>
{%- else -%}
{{ form_start(make_default_forms[entity.id]) }}
{{ form_widget(make_default_forms[entity.id].submit, { 'attr' : { 'class' : 'sc-button bt-action' } } ) }}
{{ form_end(make_default_forms[entity.id]) }}
{%- endif -%}
</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ path('customfieldsgroup_show', { 'id': entity.id }) }}" class="sc-button">{{ 'show'|trans|capitalize }}</a>
</li>
<li>
<a href="{{ path('customfieldsgroup_edit', { 'id': entity.id }) }}" class="sc-button btn-edit">{{ 'edit'|trans|capitalize }}</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<p>
<a href="{{ path('customfieldsgroup_new') }}" class="sc-button bt-create">
{{ 'Create a new group'|trans }}
</a>
</p>
{% endblock %}

View File

@@ -0,0 +1,32 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* 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 <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %}
{% block admin_content %}
<h1>{{ 'CustomFieldsGroup creation'|trans }}</h1>
{{ form_start(form) }}
{{ form_row(form.name) }}
{{ form_row(form.entity) }}
<p>
{{ form_widget(form.submit, { 'attr' : { 'class': 'sc-button bt-create' } } ) }}
<a href="{{ path('customfieldsgroup') }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</p>
{{ form_end(form) }}
{% endblock %}

View File

@@ -0,0 +1,86 @@
{#- a customField element will be stored in title variable -#}
{%- set title = null -%}
{#- a customField element will be stored in subtitle variable -#}
{%- set subtitle = null -%}
{%- set type = constant('Chill\\CustomFieldsBundle\\CustomFields\\CustomFieldTitle::TYPE') -%}
{%- set type_subtitle = constant('Chill\\CustomFieldsBundle\\CustomFields\\CustomFieldTitle::TYPE_SUBTITLE') -%}
{%- set type_title = constant('Chill\\CustomFieldsBundle\\CustomFields\\CustomFieldTitle::TYPE_TITLE') -%}
{# a variable to store that "something has been printed #}
{%- set something_has_been_printed = false -%}
{%- set title_div_opened = false -%}
{%- set subtitle_div_opened = false -%}
{% for customField in cFGroup.activeCustomFields %}
{% if customField.type == 'title' %}
{%- if show_empty == true %}
{%- if customField.options[type] == type_title -%}
{%- if title_div_opened == false -%}
<div class="cf_title_box">
{%- set title_div_opened = true -%}
{%- else -%}
{%- if subtitle_div_opened == true -%}
</div> <!-- closing cf_subtitle_box -->
{%- set title_div_opened = false -%}
{%- endif -%}
</div><div class="cf_title_box">
{%- endif -%}
{%- else -%}
{%- if subtitle_div_opened == false -%}
<div class="cf_subtitle_box">
{%- set subtitle_div_opened = true -%}
{%- else -%}
</div><div class="cf_subtitle_box">
{%- endif -%}
{%- endif -%}
{{ chill_custom_field_widget(cFData , customField) }}
{%- else -%}
{# we keep the customfield in memory, and print it only if 'something' has been filled after the title #}
{%- if customField.options[type] == type_title -%}
{%- set title = customField -%}
{# we have to reset the title hierarchy if we misused titles hierarchy #}
{%- set subtitle = null -%}
{%- elseif customField.options[type] == type_subtitle -%}
{%- set subtitle = customField -%}
{%- endif -%}
{%- endif -%}
{% else %}
{%- if show_empty == true or (chill_custom_field_is_empty(cFData, customField) == false) -%}
{%- if title is not empty -%}
{%- if title_div_opened == false -%}
<div class="cf_title_box">
{%- set title_div_opened = true -%}
{%- else -%}
{%- if subtitle_div_opened == true -%}
</div> <!-- closing cf_subtitle_box -->
{%- set title_div_opened = false -%}
{%- endif -%}
</div><div class="cf_title_box">
{%- endif -%}
{{ chill_custom_field_widget(cFData, title) }}
{%- set title = null -%}
{%- endif -%}
{%- if subtitle is not empty -%}
{%- if subtitle_div_opened == false -%}
<div class="cf_subtitle_box">
{%- set subtitle_div_opened = true -%}
{%- else -%}
</div><div class="cf_subtitle_box">
{%- endif -%}
{{ chill_custom_field_widget(cFData, subtitle) }}
{%- set subtitle = null -%}
{%- endif -%}
<dt class="custom_fields_group_rendering">{{ chill_custom_field_label(customField) }}</dt>
<dd class="custom_fields_group_rendering">{{ chill_custom_field_widget(cFData , customField) }}</dd>
{%- set something_has_been_printed = true -%}
{%- endif -%}
{%- endif -%}
{% endfor %}
{%- if subtitle_div_opened == true -%}
</div> <!-- closing cf_subtitle_box -->
{%- endif -%}
{%- if title_div_opened == true -%}
</div> <!-- closing cf_title_box -->
{%- endif -%}
{% if something_has_been_printed == false %}
<dt class="custom_field_no_data custom_fields_group_rendering">{{ 'Empty data'|trans }}</dt>
<dd class="custom_field_no_data custom_fields_group_rendering">{{ 'No data to show' | trans }}</dd>
{% endif %}

View File

@@ -0,0 +1,7 @@
<dl class="custom_fields_group_rendering">
<span class="custom_fields_group_name">{{ customFieldsGroup.name(app.request.locale) }}</span>
{% for customField in customFieldsGroup.customFields %}
<dt>{{ chill_custom_field_label(customField) }}</dt>
<dd>{{ chill_custom_field_widget(fields, customField) }}</dd>
{% endfor %}
</dl>

View File

@@ -0,0 +1,116 @@
{#
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* 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 <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %}
{% block title %}{{ 'CustomFieldsGroup details'|trans }}{% endblock %}
{% block admin_content %}
<h1>{{ 'CustomFieldsGroup details'|trans }}</h1>
<table class="record_properties">
<tbody>
<tr>
<th>{{ 'Name'|trans }}</th>
<td>{{ entity.getName|localize_translatable_string }}</td>
</tr>
<tr>
<th>{{ 'Entity'|trans }}</th>
<td>{{ entity.entity|trans }}</td>
</tr>
{%- for key in options -%}
<tr>
<th>{{ key ~ '_label'|trans }}</th>
<td>
{%- 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 -%}
</td>
</tr>
{%- else -%}
<!-- no option available for this entity -->
{%- endfor -%}
</tbody>
</table>
<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 %}