mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
add an icon when the file is opened / closed in result list, and in person rendering macro
This commit is contained in:
parent
2aecaae749
commit
0ccc998e52
@ -46,3 +46,4 @@ Branche master
|
|||||||
|
|
||||||
- fix error on macro renderPerson / withLink not taken into account
|
- fix error on macro renderPerson / withLink not taken into account
|
||||||
- add a link between accompanying person and user
|
- add a link between accompanying person and user
|
||||||
|
- add an icon when the file is opened / closed in result list, and in person rendering macro
|
||||||
|
@ -128,7 +128,12 @@ class AccompanyingPeriod
|
|||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function isOpen() {
|
public function isOpen(): bool
|
||||||
|
{
|
||||||
|
if ($this->getOpeningDate() > new \DateTime('now')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->getClosingDate() === null) {
|
if ($this->getClosingDate() === null) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -120,6 +120,8 @@ Update accompanying period: Mettre à jour une période d'accompagnement
|
|||||||
'Closing motive': 'Motif de clôture'
|
'Closing motive': 'Motif de clôture'
|
||||||
'Person details': 'Détails de la personne'
|
'Person details': 'Détails de la personne'
|
||||||
'Update details for %name%': 'Modifier détails de %name%'
|
'Update details for %name%': 'Modifier détails de %name%'
|
||||||
|
Any accompanying periods are open: Aucune période d'accompagnement ouverte
|
||||||
|
An accompanying period is open: Une période d'accompagnement est ouverte
|
||||||
Accompanying period list: Périodes d'accompagnement
|
Accompanying period list: Périodes d'accompagnement
|
||||||
Choose a motive: Motif de fermeture
|
Choose a motive: Motif de fermeture
|
||||||
Re-open accompanying period: Ré-ouvrir la période d'accompagnement
|
Re-open accompanying period: Ré-ouvrir la période d'accompagnement
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="chill-red">{% trans %}Name{% endtrans %}</th>
|
<th class="chill-red">{% trans %}Name{% endtrans %}</th>
|
||||||
<th class="chill-green">{% trans %}Date of birth{% endtrans %}</th>
|
<th class="chill-green">{% trans %}Date of birth{% endtrans %}</th>
|
||||||
<th class="chill-orange">{% trans %}Nationality{% endtrans %}</th>
|
<th class="chill-orange">{% trans %}Nationality{% endtrans %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -39,11 +39,16 @@
|
|||||||
{% for person in persons %}
|
{% for person in persons %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="{{ path('chill_person_view', {person_id : person.getId}) }}">
|
{% set is_open = person.isOpen() %}
|
||||||
|
<a href="{{ path('chill_person_view', { person_id : person.getId }) }}" {% if chill_person.fields.accompanying_period == 'visible' %}{% if is_open %} alt="{{ 'An accompanying period is open'|trans|e('html_attr') }}"{% else %} alt="{{ 'Any accompanying periods are open'|trans|e('html_attr') }}" {% endif %}{% endif %}>
|
||||||
{{person.firstName}} {{person.lastName}}
|
{{person.firstName}} {{person.lastName}}
|
||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
{% if person.isOpen == false %}
|
{% if chill_person.fields.accompanying_period == 'visible' %}
|
||||||
<i class="icon-lock"></i>
|
{% if is_open == false %}
|
||||||
|
<i class="fa fa-folder" ></i>
|
||||||
|
{% else %}
|
||||||
|
<i class="fa fa-folder-open" ></i>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
</a>
|
</a>
|
||||||
|
@ -1 +1,19 @@
|
|||||||
{% macro render(p, withLink=true) %}<span class="entity entity-person person-person">{% if withLink %}<a href="{{ path('chill_person_view', { 'person_id' : p.id } ) }}">{% endif %}{{ p.firstName }} {{ p.lastName }}{% if withLink %}</a>{% endif %}</span>{% endmacro %}
|
{% macro render(p, withLink=true, withClosingInfo=false) %}{%spaceless %}
|
||||||
|
<span class="entity entity-person person-person">
|
||||||
|
{% if withLink %}
|
||||||
|
<a href="{{ path('chill_person_view', { 'person_id' : p.id } ) }}">
|
||||||
|
{% endif %}
|
||||||
|
{{ p.firstName }} {{ p.lastName }}
|
||||||
|
{% if withClosingInfo %}
|
||||||
|
{% if chill_person.fields.accompanying_period == 'visible' %}
|
||||||
|
{% set is_open = p.isOpen() %}
|
||||||
|
{% if is_open == false %}
|
||||||
|
<i class="fa fa-folder" ></i>
|
||||||
|
{% else %}
|
||||||
|
<i class="fa fa-folder-open" ></i>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% if withLink %}</a>{% endif %}
|
||||||
|
</span>{% endspaceless %}
|
||||||
|
{% endmacro %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user