show memo in person details + minor fixes

The memo is shown only if not empty.

minor fixes :

- re-add label 'country of birth' on view page
- set title to pages
This commit is contained in:
Julien Fastré 2016-01-18 21:32:22 +01:00
parent 4e4f45e2bc
commit 90f579d88a
3 changed files with 25 additions and 3 deletions

View File

@ -68,6 +68,7 @@ Reset: 'Remise à zéro'
'Create accompanying period': 'Nouvelle ouverture-fermeture à une autre date'
'Closing motive': 'Motif de clôture'
'Person details': 'Détails de la personne'
'Update details for %name%': 'Modifier détails de %name%'
Accompanying period list: Périodes d'accompagnement
#timeline

View File

@ -18,14 +18,21 @@
{% set activeRouteKey = '' %}
{% block title %}ChillPersonBundle:Person:see{% endblock %}
{% block title %}{{ 'Update details for %name%'|trans({ '%name%': person.firstName|capitalize ~ ' ' ~ person.lastName } )|capitalize }}{% endblock %}
{% block personcontent %}
<h1>{{ 'Update details for %name%'|trans({ '%name%': person.firstName|capitalize ~ ' ' ~ person.lastName|capitalize } ) }}</h1>
{% form_theme form 'ChillMainBundle:Form:fields.html.twig' %}
{{ form_start(form) }}
<fieldset>
<legend><h2>{{ 'Memo'|trans }}</h2></legend>
{{ form_row(form.memo, {'label' : 'Memo'} ) }}
</fieldset>
<fieldset>
<legend><h2>{{ 'General information'|trans }}</h2></legend>
{{ form_row(form.firstName, {'label' : 'First name'}) }}
@ -54,7 +61,6 @@
</fieldset>
{{ form_row(form.memo, {'label' : 'Memo'} ) }}
{{ form_rest(form) }}

View File

@ -23,7 +23,8 @@ This view should receive those arguments:
- person
#}
{% block title %}ChillPersonBundle:Person:see{% endblock %}
{% block title %}{{ 'Person details'|trans|capitalize ~ ' ' ~ person.firstName|capitalize ~
' ' ~ person.lastName }}{% endblock %}
{#
we define variables to include an edit form repeated multiple time across
the page
@ -34,8 +35,21 @@ This view should receive those arguments:
{% block personcontent %}
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
{% if person.memo is not empty %}
<div class="grid-12">
<figure class="person-details">
<h2 class="chill-red">{{ 'Memo'|trans|upper }}</h2>
<p>
<blockquote>{{ person.memo|nl2br }}</blockquote>
</p>
</figure>
</div>
{% endif %}
<div class="grid-6">
<figure class="person-details">
<h2 class="chill-red">{{ 'General information'|trans|upper }}</h2>
@ -74,6 +88,7 @@ This view should receive those arguments:
<dt>{{ 'Place of birth'|trans }}&nbsp;:</dt>
<dd>{{ person.placeOfBirth }}</dd>
<dt>{{ 'Country of birth'|trans }}&nbsp;:</dt>
<dd>{% spaceless %}
{% if person.countryOfBirth is not null %}
{{ person.countryOfBirth.name|localize_translatable_string }}