mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
mise en forme formulaire et lien edition-view
This commit is contained in:
parent
574d1d4dcf
commit
e390c891d8
@ -31,9 +31,9 @@ class PersonType extends AbstractType
|
||||
->add('nbOfChild', 'integer', array('required' => false))
|
||||
->add('belgian_national_number', new BelgianNationalNumberType(),
|
||||
array('required' => false))
|
||||
->add('memo', 'text', array('required' => false))
|
||||
->add('address', 'text', array('required' => false))
|
||||
->add('email', 'text', array('required' => false))
|
||||
->add('memo', 'textarea', array('required' => false))
|
||||
->add('address', 'textarea', array('required' => false))
|
||||
->add('email', 'textarea', array('required' => false))
|
||||
->add('countryOfBirth', 'entity', array(
|
||||
'required' => false,
|
||||
'class' => 'CL\Chill\MainBundle\Entity\Country'
|
||||
|
@ -35,6 +35,25 @@ div#person_wrapper {
|
||||
margin: 0 0 0 199px;
|
||||
padding: 0 0 0.5em 0;
|
||||
}
|
||||
|
||||
label {
|
||||
color: green;
|
||||
}
|
||||
|
||||
label:not(.radio) {
|
||||
min-width: 190px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
label.radio{
|
||||
margin-left: 0.2em;
|
||||
}
|
||||
|
||||
div.form_control {
|
||||
.controls {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,3 +4,7 @@ div#person_wrapper div#person_details dl { padding: 0.5em; }
|
||||
div#person_wrapper div#person_details dt { float: left; clear: left; width: 190px; text-align: right; font-weight: bold; color: green; }
|
||||
div#person_wrapper div#person_details dt:after { content: " :"; }
|
||||
div#person_wrapper div#person_details dd { margin: 0 0 0 199px; padding: 0 0 0.5em 0; }
|
||||
div#person_wrapper div#person_details label { color: green; }
|
||||
div#person_wrapper div#person_details label:not(.radio) { min-width: 190px; font-weight: bold; }
|
||||
div#person_wrapper div#person_details label.radio { margin-left: 0.2em; }
|
||||
div#person_wrapper div#person_details div.form_control .controls { float: right; }
|
||||
|
@ -31,6 +31,8 @@ views:
|
||||
layout:
|
||||
born: '{0} Né le %date% | {1} Née le %date%'
|
||||
without_nationality: Nationalité inconnue
|
||||
common:
|
||||
edit: Modifier
|
||||
Person:
|
||||
view:
|
||||
general: Généralités
|
||||
@ -54,6 +56,10 @@ views:
|
||||
name: Nom
|
||||
gender: Genre
|
||||
memo: Mémo
|
||||
edit:
|
||||
cancel: Retour
|
||||
reset: Remise à zéro
|
||||
submit: Envoi
|
||||
list:
|
||||
without_nationality: Nationalité inconnue
|
||||
|
||||
|
9
Resources/views/Form/form_control.html.twig
Normal file
9
Resources/views/Form/form_control.html.twig
Normal file
@ -0,0 +1,9 @@
|
||||
<div class="form_control">
|
||||
<div class="medium default btn icon-left entypo icon-cancel"><a href="{{ path(return_key, return_args ) }}" >{{ 'views.Person.edit.cancel'|trans }}</a></div>
|
||||
|
||||
<div class="controls">
|
||||
<div class="medium default btn"><button type="reset">{{ 'views.Person.edit.reset'|trans }}</button></div>
|
||||
<div class="medium warning btn icon-right entypo icon-pencil"><button type="submit">{{ 'views.Person.edit.submit'|trans }}</button></div>
|
||||
</div>
|
||||
|
||||
</div>
|
6
Resources/views/Form/go_to_form.html.twig
Normal file
6
Resources/views/Form/go_to_form.html.twig
Normal file
@ -0,0 +1,6 @@
|
||||
<div class="form_control">
|
||||
<div class="controls">
|
||||
<div class="small warning btn icon-right entypo icon-pencil"><a href="{{ path(form_path_key, form_path_args) }}">{{ 'views.common.edit'|trans }}</a></div>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -9,8 +9,10 @@
|
||||
{% form_theme form 'CLChillMainBundle:Form:fields.html.twig' %}
|
||||
|
||||
{{ form_start(form) }}
|
||||
|
||||
<button type="submit">{{ 'views.Person.edit.submit'|trans }}</button>
|
||||
{% set include_temp = 'CLChillPersonBundle:Form:form_control.html.twig' %}
|
||||
{% set include_args = {'return_key': 'chill_person_view',
|
||||
'return_args' : { 'id' : person.id} } %}
|
||||
{{ include(include_temp, include_args) }}
|
||||
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'views.Person.view.general'|trans }}</h2></legend>
|
||||
@ -19,6 +21,8 @@
|
||||
{{ form_row(form.genre, {'label' : 'views.Person.view.gender'}) }}
|
||||
</fieldset>
|
||||
|
||||
{{ include(include_temp, include_args) }}
|
||||
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'views.Person.view.birth'|trans }}</h2></legend>
|
||||
{{ form_row(form.dateOfBirth, {'label': 'views.Person.view.dateOfBirth'} ) }}
|
||||
@ -26,6 +30,8 @@
|
||||
{{ form_row(form.countryOfBirth, { 'label' : 'views.Person.view.contry_of_birth' } ) }}
|
||||
</fieldset>
|
||||
|
||||
{{ include(include_temp, include_args) }}
|
||||
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'views.Person.view.family'|trans }}</h2></legend>
|
||||
{{ form_row(form.civil_union, {'label' : 'views.Person.view.civil_union'}) }}
|
||||
@ -33,12 +39,16 @@
|
||||
|
||||
</fieldset>
|
||||
|
||||
{{ include(include_temp, include_args) }}
|
||||
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'views.Person.view.administrative'|trans }}</h2></legend>
|
||||
{{ form_row(form.nationality, { 'label' : 'views.Person.view.nationality'|trans} ) }}
|
||||
{{ form_row(form.belgian_national_number, { 'label' : 'views.Person.view.national_number'}) }}
|
||||
</fieldset>
|
||||
|
||||
{{ include(include_temp, include_args) }}
|
||||
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'views.Person.view.contact'|trans }}</h2></legend>
|
||||
{{ form_row(form.address, {'label' : 'views.Person.view.address'}) }}
|
||||
@ -48,6 +58,7 @@
|
||||
|
||||
{{ form_row(form.memo, {'label' : 'views.Person.view.memo'} ) }}
|
||||
|
||||
{{ include(include_temp, include_args) }}
|
||||
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
|
@ -12,8 +12,34 @@ This view should receive those arguments:
|
||||
|
||||
{% block title %}CLChillPersonBundle:Person:see{% endblock %}
|
||||
|
||||
{% set edit_tmp_name = 'CLChillPersonBundle:Form:go_to_form.html.twig' %}
|
||||
{% set edit_tmp_args = { 'form_path_args' : { 'id': person.id },
|
||||
'form_path_key' : 'chill_person_general_edit' } %}
|
||||
|
||||
|
||||
{% block personcontent %}
|
||||
|
||||
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
|
||||
<figure>
|
||||
<h2>{{ 'views.Person.view.general'|trans }}</h2>
|
||||
|
||||
<dl>
|
||||
<dt class="inline">{{ 'views.Person.view.surname'|trans }}</dt>
|
||||
<dd>{{ person.surname }}</dd>
|
||||
|
||||
<dt class="inline">{{ 'views.Person.view.name'|trans }}</dt>
|
||||
<dd>{{ person.surname }}</dd>
|
||||
|
||||
<dt class="inline">{{ 'views.Person.view.gender'|trans }}</dt>
|
||||
<dd>{{ ( 'person.gender.' ~ person.genre|default('undefined'))|trans }}</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
</figure>
|
||||
|
||||
<figure>
|
||||
<h2>{{ 'views.Person.view.birth'|trans }}</h2>
|
||||
|
||||
@ -38,6 +64,8 @@ This view should receive those arguments:
|
||||
</dl>
|
||||
</figure>
|
||||
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
|
||||
<figure>
|
||||
<h2>{{ 'views.Person.view.family'|trans }}</h2>
|
||||
|
||||
@ -52,6 +80,8 @@ This view should receive those arguments:
|
||||
</dl>
|
||||
</figure>
|
||||
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
|
||||
<figure>
|
||||
<h2>{{ 'views.Person.view.administrative'|trans }}</h2>
|
||||
|
||||
@ -74,6 +104,8 @@ This view should receive those arguments:
|
||||
</dl>
|
||||
</figure>
|
||||
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
|
||||
<figure>
|
||||
<h2>{{ 'views.Person.view.contact'|trans }}</h2>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user