improve layout

This commit is contained in:
Julien Fastré 2017-08-19 21:46:09 +02:00
parent 1afcf75112
commit 47e194b1ed
10 changed files with 69 additions and 30 deletions

View File

@ -29,6 +29,7 @@ use Chill\PersonBundle\Form\CreationPersonType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
class PersonController extends Controller
{
@ -281,9 +282,17 @@ class PersonController extends Controller
if ($this->container
->getParameter('cl_chill_person.search.use_double_metaphone')) {
$dql .= ' OR DOUBLEMETAPHONE(p.lastName) LIKE DOUBLEMETAPHONE(:lastName)';
$dql .= ' OR DOUBLEMETAPHONE(p.lastName) LIKE DOUBLEMETAPHONE(:lastName) ';
}
// add authorized centers
$centers = $this->get('chill.main.security.authorization.helper')
->getReachableCenters($this->getUser(), new Role(PersonVoter::SEE));
$dql.=' and p.center IN (:centers) ';
$query->setParameter('centers', $centers);
// run query
$query->setDql($dql);
$alternatePersons = $query->getResult();

View File

@ -80,7 +80,7 @@ Reset: 'Remise à zéro'
'Add a person': 'Ajout d''une personne'
'Person Menu': 'Menu personne'
'The person data are not valid': 'Les données de votre formulaire sont invalides.'
'%nb% person with similar name. Please verify that this is a new person': '%nb% personnes ont un nom similaire. Vérifiez qu''il ne s''agit pas de l''une d''elles.'
'%nb% person with similar name. Please verify that this is a new person': '{1} Une personne a un nom similaire. Vérifiez qu''il ne s''agit pas d''elle. | ]1, Inf] %nb% personnes ont un nom similaire. Vérifiez qu''il ne s''agit pas de l''une d''elles.'
'The person has been created': 'Le dossier a été créé'
'Person search results': 'Recherche de personnes'
'Search within persons': 'Recherche parmi les personnes'
@ -104,6 +104,7 @@ Update accompanying period: Mettre à jour une période d'accompagnement
'An accompanying period has been closed.': Une période d'accompagnement a été fermée.
'Error! Period not closed!': "Erreur: la période d'accompagnement n'a pas été fermée."
'An accompanying period has been opened.': Une période d'accompagnement a été ouverte.
'No remark': Pas de remarque
'Period not opened': "La période d'accompagnement n'a pas été ouverte"
"Period not opened : form is invalid": "La période n'a pas été ouverte: le formulaire est invalide."
'Closing motive': 'Motif de clôture'

View File

@ -13,6 +13,8 @@
The date of closing is before the date of opening: La période de fermeture est après la période d'ouverture
The birthdate must be before %date%: La date de naissance doit être avant le %date%
Two addresses has the same validFrom date: La date de validité est identique à celle d'une autre adresse
#export list
You must select at least one element: Vous devez sélectionner au moins un élément

View File

@ -44,12 +44,23 @@
{{ form_rest(form) }}
<ul class="record_actions">
<li>
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_person_accompanying_period_list', { 'person_id' : person.id } ) }}" class="sc-button bt-cancel">{{ 'Back to the list'|trans }}</a>
</li>
<li>
<button type="submit" class="sc-button bt-update">{{ 'Submit'|trans }}</button>
<button type="submit" class="sc-button bt-save">
{% if form.vars.action == 'update' %}
{{ 'Update accompanying period'|trans }}
{% elseif form.vars.action == 'open' %}
{{ 'Update accompanying period'|trans }}
{% elseif form.vars.action == 'close' %}
{{'Close accompanying period'|trans }}
{% elseif form.vars.action == 'create' %}
{{ 'Create an accompanying period'|trans }}
{% endif %}
</button>
</li>
</ul>

View File

@ -27,26 +27,30 @@
{% endif %}
{% endspaceless %}</td>
<td>
{{ accompanying_period.remark }}
{% if accompanying_period.remark is empty %}
<p class="chill-no-data-statement">{{ 'No remark'|trans }}</p>
{% else %}
<blockquote class="chill-user-quote">
{{ accompanying_period.remark|nl2br }}
</blockquote>
{% endif %}
</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-update">
{{ 'Edit'|trans }}
</a>
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-update no-content"></a>
</li>
{% if accompanying_period.isOpen == true %}
<li>
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}" class="sc-button bt-update">
<i class="fa fa-lock" aria-hidden="true"></i> {{'Close accompanying period'|trans }}
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}" class="sc-button bt-update has-hidden change-icon">
<i class="fa fa-lock" aria-hidden="true"></i><span class="show-on-hover">{{'Close accompanying period'|trans }}</span>
</a>
</li>
{% endif %}
{% if accompanying_period.canBeReOpened == true %}
<li>
<a href="{{ path('chill_person_accompanying_period_re_open', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-create">
{{'Re-open accompanying period'|trans }}
<a href="{{ path('chill_person_accompanying_period_re_open', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-create change-icon has-hidden">
<i class="fa fa-unlock" aria-hidden="true"></i><span class="show-on-hover">{{'Re-open accompanying period'|trans }}</span>
</a>
</li>
{% endif %}
@ -60,6 +64,11 @@
<div class="form_control">
<ul class="record_actions">
<li class="cancel">
<a href="{{ path ('chill_person_view', {'person_id' : person.id } ) }}" class="sc-button bt-cancel">
{{ 'Person details'|trans }}
</a>
</li>
<li>
<a href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}" class="sc-button bt-create">
{{ 'Add an accompanying period in the past'|trans }}
@ -67,7 +76,7 @@
</li>
{% if person.isOpen == false %}
<li>
<a href="{{ path('chill_person_accompanying_period_open', {'person_id' : person.id} ) }}" class="sc-button bt-create">
<a href="{{ path('chill_person_accompanying_period_open', {'person_id' : person.id} ) }}" class="sc-button bt-create change-icon">
<i class="fa fa-unlock" aria-hidden="true"></i>{{'Begin a new accompanying period'|trans }}
</a>
</li>

View File

@ -11,7 +11,7 @@
<p class="message-confirm">{{ 'Are you sure you want to re-open this period ?'|trans }}<p>
<ul class="record_actions">
<li>
<li class="cancel">
<a href="{{ path('chill_person_accompanying_period_list', { 'person_id' : person.id } ) }}" class="sc-button bt-cancel">
{{ 'Cancel'|trans }}
</a>

View File

@ -31,14 +31,14 @@
{{ form_row(form.postCode) }}
{{ form_row(form.validFrom) }}
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_address_list', { 'person_id' : person.id } ) }}" class="sc-button btn-cancel">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_person_address_list', { 'person_id' : person.id } ) }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
{{ form_row(form.submit, { 'attr' : { 'class': 'sc-button bt-edit' } } ) }}
{{ form_row(form.submit, { 'attr' : { 'class': 'sc-button bt-save' }, 'label': 'Save' } ) }}
</li>
</ul>

View File

@ -56,9 +56,7 @@
<td>
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit">
{{ 'Edit'|trans }}
</a>
<a href="{{ path('chill_person_address_edit', { 'person_id': person.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit"></a>
</li>
</ul>
</td>
@ -69,14 +67,14 @@
</table>
<ul class="record_actions">
<li>
<li class="cancel">
<a href="{{ path('chill_person_view', { 'person_id' : person.id } ) }}" class="sc-button bt-cancel">
<i class="fa fa-arrow-left"></i>{{ 'Back to the person details'|trans }}
{{ 'Back to the person details'|trans }}
</a>
</li>
<li>
<a href="{{ path('chill_person_address_new', { 'person_id' : person.id } ) }}" class="sc-button bt-create">
<i class="fa fa-plus"></i>{{ 'Add an address'|trans }}
{{ 'Add an address'|trans }}
</a>
</li>
</ul>

View File

@ -35,14 +35,14 @@
{{ form_row(form.validFrom) }}
{{ form_errors(form.validFrom) }}
<ul class="record_actions">
<li>
<a href="{{ path('chill_person_address_list', { 'person_id' : person.id } ) }}" class="sc-button btn-cancel">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_person_address_list', { 'person_id' : person.id } ) }}" class="sc-button bt-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
{{ form_row(form.submit, { 'attr' : { 'class': 'sc-button bt-create' } } ) }}
{{ form_row(form.submit, { 'attr' : { 'class': 'sc-button bt-create' }, 'label': 'Create' } ) }}
</li>
</ul>

View File

@ -21,6 +21,15 @@
{% block content %}
<div class="grid-12 parent" >
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
<div class="warning flash_message">
<span>
{% transchoice alternatePersons|length with { '%nb%': alternatePersons|length } %}
%nb% person with similar name. Please verify that this is a new person
{% endtranschoice %}
</span>
</div>
{% if alternatePersons is not empty %}
<table>
<thead>
@ -73,7 +82,7 @@
</dl>
{{ form_rest(form) }}
<button class="sc-button green" type="submit"><i class="fa fa-check"></i> {{ 'Confirm the creation'|trans }}</button>
<button class="sc-button bt-create change-icon" type="submit"><i class="fa fa-check"></i> {{ 'Confirm the creation'|trans }}</button>
{{ form_end(form) }}
</div>
</div>