From 7d0348e4dee36984643e6f8ad888207e59d8e52b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 5 Nov 2013 13:25:25 +0100 Subject: [PATCH] work on style and view and layout --- DataFixtures/ORM/LoadPeople.php | 33 ++++++--- Resources/config/routing.yml | 59 +++++++++++++++- Resources/translations/messages.fr.yml | 36 +++++++++- Resources/views/Person/view.html.twig | 96 ++++++++++++++++++++------ Resources/views/menu.html.twig | 6 +- 5 files changed, 193 insertions(+), 37 deletions(-) diff --git a/DataFixtures/ORM/LoadPeople.php b/DataFixtures/ORM/LoadPeople.php index d5688abaa..adea9e99e 100644 --- a/DataFixtures/ORM/LoadPeople.php +++ b/DataFixtures/ORM/LoadPeople.php @@ -59,6 +59,8 @@ class LoadPeople extends AbstractFixture { echo "add a person..."; $i++; + $sex = $this->genres[array_rand($this->genres)]; + if ($choose_name_or_tri[array_rand($choose_name_or_tri)] === 'tri' ) { $length = rand(2, 3); $name = ''; @@ -71,14 +73,21 @@ class LoadPeople extends AbstractFixture { $name = $this->names[array_rand($this->names)]; } + if ($sex === Person::GENRE_MAN) { + $surname = $this->surnames_male[array_rand($this->surnames_male)]; + } else { + $surname = $this->surnames_female[array_rand($this->surnames_female)]; + } + + $person = array( 'Name' => $name, - 'Surname' => $this->surnames[array_rand($this->surnames)], + 'Surname' => $surname, 'DateOfBirth' => "1960-10-12", 'PlaceOfBirth' => "Ottignies Louvain-La-Neuve", - 'Genre' => Person::GENRE_MAN, - 'CivilUnion' => Person::CIVIL_DIVORCED, - 'NbOfChild' => 0, + 'Genre' => $sex, + 'CivilUnion' => $this->CivilUnions[array_rand($this->CivilUnions)], + 'NbOfChild' => $this->NbOfChild[array_rand($this->NbOfChild)], 'BelgianNationalNumber' => '12-10-16-269-24', 'Email' => "Email d'un ami: roger@tt.com", 'CountryOfBirth' => 'France', @@ -109,16 +118,20 @@ class LoadPeople extends AbstractFixture { } - private $surnames = array("Jean", "Mohamed", "Alfred", "Robert", "Svedana", "Sevlatina", - "Irène", "Marcelle", "Compère", "Jean-de-Dieu", "Corentine", "Alfonsine", - "Caroline", "Charles", "Pierre", "Luc", "Mathieu", "Alain", "Etienne", "Eric", - "Solange", "Corentin", "Gaston", "Spirou", "Fantasio", "Mahmadou", "Mohamidou", - "Vursuv", "Gostine"); + private $surnames_male = array("Jean", "Mohamed", "Alfred", "Robert", + "Compère", "Jean-de-Dieu", + "Charles", "Pierre", "Luc", "Mathieu", "Alain", "Etienne", "Eric", + "Corentin", "Gaston", "Spirou", "Fantasio", "Mahmadou", "Mohamidou", + "Vursuv" ); + private $surnames_female = array("Svedana", "Sevlatina","Irène", "Marcelle", + "Corentine", "Alfonsine","Caroline","Solange","Gostine", "Fatoumata", + "Groseille", "Chana", "Oxana", "Ivana"); private $names = array("Diallo", "Bah", "Gaillot"); private $names_trigrams = array("fas", "tré", "hu", 'blart', 'van', 'der', 'lin', 'den', 'ta', 'mi', 'gna', 'bol', 'sac', 'ré', 'jo', 'du', 'pont', 'cas', 'tor', 'rob', 'al', - 'ma', 'gone', 'car'); + 'ma', 'gone', 'car',"fu", "ka", "lot", "no", "va", "du", "bu", "su", + "lo", 'to', "cho", "car", 'mo','zu', 'qi', 'mu'); private $genres = array(Person::GENRE_MAN, Person::GENRE_WOMAN); diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index 534d931be..4a02729d0 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -19,4 +19,61 @@ chill_person_view_history: options: menu: person order: 100 - label: menu.person.history \ No newline at end of file + label: menu.person.history + +#sample +chill_appointment_list: + pattern: /view/{id}/appointment/list + defaults: {_controller: CLChillPersonBundle:Person:view} + options: + menu: person + order: 200 + label: "Rendez-vous" + +chill_prof_status_view: + pattern: /view/{id}/prof/list + defaults: {_controller: CLChillPersonBundle:Person:view} + options: + menu: person + order: 300 + label: "Statut Professionnel" + +chill_admin_view: + pattern: /view/{id}/administrative + defaults: {_controller: CLChillPersonBundle:Person:view} + options: + menu: person + order: 400 + label: "Statut administratif" + +chill_language: + pattern: /view/{id}/language/list + defaults: {_controller: CLChillPersonBundle:Person:view} + options: + menu: person + order: 500 + label: "Langues" + +chill_studies: + pattern: /view/{id}/studies + defaults: {_controller: CLChillPersonBundle:Person:view} + options: + menu: person + order: 600 + label: "Études" + +chill_notes: + pattern: /view/{id}/notes + defaults: {_controller: CLChillPersonBundle:Person:view} + options: + menu: person + order: 700 + label: "Informations" + +chill_docs: + pattern: /view/{id}/docs + defaults: {_controller: CLChillPersonBundle:Person:view} + options: + menu: person + order: 800 + label: "Documents" \ No newline at end of file diff --git a/Resources/translations/messages.fr.yml b/Resources/translations/messages.fr.yml index f05e2acd4..7d0873d3a 100644 --- a/Resources/translations/messages.fr.yml +++ b/Resources/translations/messages.fr.yml @@ -3,14 +3,48 @@ person: surname: Prénom dateOfBirth: Date de naissance nationality: Nationalité + civil_union: + divorced: Divorcé + separated: Séparé + widow: Veuf + unknow: Inconnu + cohab: Cohabitation légale + single: Célibataire + + search: q_is_empty: Votre requête est vide. Veuillez introduire un terme de recherche no_results: La requête %q% ne renvoie aucun résultat. + + views: + layout: + born: '{0} Né le %date% | {1} Née le %date%' + without_nationality: Nationalité inconnue Person: view: - born: '{0} Né le %date% | {1} Née le %date%' + birth: Naissance + dateOfBirth: Date de naissance + placeOfBirth: Lieu de Naissance + country_of_birth_unknow: Pays inconnu without_nationality: Nationalité inconnue + family: Famille + civil_union: État civil + nb_of_childs: Nombre d'enfants + nb_of_childs_count: '{0} Aucun enfant|{1} Un enfant | ]1,Inf] %nb% enfants' + nationality: Nationalité + national_number: Numéro national + contact: Informations de contact + email: Courrer électronique + address: Adresse + administrative: Administratif list: without_nationality: Nationalité inconnue + + + +menu: + person: + history: Historique + general_view: Informations personnelles diff --git a/Resources/views/Person/view.html.twig b/Resources/views/Person/view.html.twig index 9e0480d38..109ff6cb5 100644 --- a/Resources/views/Person/view.html.twig +++ b/Resources/views/Person/view.html.twig @@ -1,4 +1,4 @@ -{% extends "CLChillMainBundle::layout.html.twig" %} +{% extends "CLChillPersonBundle::layout.html.twig" %} {# @@ -11,29 +11,81 @@ This view should receive those arguments: {% block title %}CLChillPersonBundle:Person:see{% endblock %} -{% block content %} -

- {{ person.surname }} - {{ person.name }} -

+{% block personcontent %} -

{% transchoice person.genreNumeric - with {'%date%' : person.dateOfBirth.format('d-m-Y')} %}views.Person.view.born{% endtranschoice %}

-{% if person.nationality is not null %} -

{{ person.nationality.label }}

-{% else %} -

{% trans %}views.Person.view.without_nationality{% endtrans %}

-{% endif %} - -
- {{ include("CLChillPersonBundle::menu.html.twig", -{'person': person, 'menu_composer' : menu_composer, 'route_active': 'chill_person_view' }) }} - -
-

My tab is active so I'll show up first! Inb4 tab 3!

-
+
+

{{ 'views.Person.view.birth'|trans }}

-
+
+
{{ 'views.Person.view.dateOfBirth'|trans }}
+
{{ person.dateOfBirth.format(date_format) }}
+ +
{{ 'views.Person.view.placeOfBirth'|trans }}
+
{{ person.placeOfBirth }}
+
{% spaceless %} + + {% if person.countryOfBirth is not null %} + {{ person.countryOfBirth.label }} + {% else %} + {{ 'views.Person.view.country_of_birth_unknow'|trans }} + {% endif %} + +{% endspaceless %}
+ + +
+ + +
+

{{ 'views.Person.view.family'|trans }}

+ +
+
{{ 'views.Person.view.civil_union'|trans }}
+
{{ ('person.civil_union.' ~ person.civilUnion)|trans }}
+ +
{{ 'views.Person.view.nb_of_childs'|trans }}
+
{% transchoice person.nbOfChild with { '%nb%': person.nbOfChild } %}views.Person.view.nb_of_childs_count{% endtranschoice %}
+ + +
+
+ +
+

{{ 'views.Person.view.administrative'|trans }}

+ +
+
{{ 'views.Person.view.nationality'|trans }}
+
+ {% if person.nationality is not null %} + {{ person.nationality.label }} + {% else %} + {{ 'views.Person.view.without_nationality'|trans }} + {% endif %} + +
+ +
{{ 'views.Person.view.national_number'|trans }}
+
{{ person.belgianNationalNumber }}
+ + + +
+
+ +
+

{{ 'views.Person.view.contact'|trans }}

+ +
+
{{ 'views.Person.view.address'|trans }}
+
{{ person.address}} 
+ +
{{ 'views.Person.view.email'|trans }}
+
{{ person.email}} 
+ + + +
+
{% endblock %} diff --git a/Resources/views/menu.html.twig b/Resources/views/menu.html.twig index 9246123d4..30c871f67 100644 --- a/Resources/views/menu.html.twig +++ b/Resources/views/menu.html.twig @@ -1,12 +1,12 @@ -
-