-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refacto planning template to add another header
- Loading branch information
Showing
6 changed files
with
127 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
templates/organization/planning/_availabilities_assets.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% extends 'organization/planning/_availabilities_base.html.twig' %} | ||
|
||
{% block type %}{{ type }}{% endblock type %} | ||
|
||
{# columns number of blocks itemDataHeader and itemDataDetails should be the same than in _availabilities_users.html.twig #} | ||
{% block itemDataHeader %} | ||
<th class="item-data">Radio mobile?</th> | ||
<th class="item-data" colspan="2">Kit de premiers soins?</th> | ||
<th class="item-data">Contact</th> | ||
<th class="item-data" colspan="2">Lieu de stationnement</th> | ||
<th class="item-data">Places</th> | ||
<th class="item-data">Immatriculation</th> | ||
{% endblock itemDataHeader %} | ||
|
||
{% block itemDataDetails %} | ||
<td class="item-data">{{ item.entity.hasMobileRadio ? 'Oui' : '-' }}</td> | ||
<td class="item-data" colspan="2">{{ item.entity.hasFirstAidKit ? 'Oui' : '-' }}</td> | ||
<td class="item-data">{{ item.entity.contact }}</td> | ||
<td class="item-data" colspan="2">{{ item.entity.parkingLocation }}</td> | ||
<td class="item-data">{{ item.entity.seatingCapacity }}</td> | ||
<td class="item-data">{{ item.entity.licensePlate }}</td> | ||
{% endblock itemDataDetails %} |
50 changes: 50 additions & 0 deletions
50
templates/organization/planning/_availabilities_base.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<thead> | ||
<tr class="days"> | ||
<th rowspan="2"></th> | ||
<th colspan="{{ itemDataRow }}" class="item-data">{{ 'common.informations' | trans }}</th> | ||
{% for item in periodCalculator.days %} | ||
<th colspan="{{ item.slots }}" data-day="{{ item.date|date("Y-m-d") }}" title="{{ 'calendar.sortByDayAvailabilities' | trans }}"> | ||
{{ item.date|format_date(pattern="eeee dd MMMM") }} | ||
</th> | ||
{% endfor %} | ||
</tr> | ||
<tr class="hours"> | ||
{% block itemDataHeader %}{% endblock itemDataHeader %} | ||
|
||
{% for item in periodCalculator.slots %} | ||
<th class="slot-name"> | ||
{{ item|format_date(pattern="HH") }} | ||
</th> | ||
{% endfor %} | ||
</tr> | ||
</thead> | ||
|
||
{% for type, list in availabilities %} | ||
<tbody> | ||
<tr> | ||
<th class="separator bg-dark"> | ||
{% block type %}{% endblock type %} | ||
({{ list|length }}) | ||
</th> | ||
<td colspan="{{ itemDataRow + periodCalculator.slots|length }}"></td> | ||
</tr> | ||
</tbody> | ||
|
||
<tbody class="item-rows"> | ||
{% for item in list %} | ||
<tr data-type="{{ entityType }}" data-id="{{ item.entity.id }}"> | ||
<th class="item-detail"> | ||
{{ item.entity }} | ||
{% block importantSkills %}{% endblock importantSkills %} | ||
</th> | ||
|
||
{% block itemDataDetails %}{% endblock itemDataDetails %} | ||
|
||
{% autoescape false %} | ||
{# Table td are rendered in php in order to avoid twig performance issue #} | ||
{{ renderPlanningTable(item.availabilities, displayActions) }} | ||
{% endautoescape %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
{% endfor %} |
35 changes: 35 additions & 0 deletions
35
templates/organization/planning/_availabilities_users.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{% extends 'organization/planning/_availabilities_base.html.twig' %} | ||
|
||
{% block type %}{{ usersSkills[type] | default('organization.users' | trans) }}{% endblock type %} | ||
|
||
{# columns number of blocks itemDataHeader and itemDataDetails should be the same than in _availabilities_assets.html.twig #} | ||
{% block itemDataHeader %} | ||
<th class="item-data">{{ 'user.identificationNumber' | trans }}</th> | ||
<th class="item-data">{{ 'common.phoneNumberShort' | trans }}</th> | ||
<th class="item-data">{{ 'user.email' | trans }}</th> | ||
<th class="item-data">{{ 'common.occupation' | trans }}</th> | ||
<th class="item-data">{{ 'common.manager' | trans }}</th> | ||
<th class="item-data">{{ 'user.skills' | trans }}</th> | ||
<th class="item-data">{{ 'user.uniform' | trans }}</th> | ||
<th class="item-data">{{ 'user.detail.vulnerable.label' | trans }}</th> | ||
{% endblock itemDataHeader %} | ||
|
||
{% block importantSkills %} | ||
{{ item.entity.skillSet | filter(skill => skill != type and skill in importantSkillsToDisplay) | map(skill => '<span class="badge badge-secondary">' ~skill~ '</span>') | join | raw }} | ||
{% endblock importantSkills %} | ||
|
||
{% block itemDataDetails %} | ||
<td class="item-data">{{ item.entity.identificationNumber }}</td> | ||
<td class="item-data">{{ item.entity.phoneNumber }}</td> | ||
<td class="item-data">{{ item.entity.emailAddress }}</td> | ||
<td class="item-data">{{ item.entity.occupation }}</td> | ||
<td class="item-data">{{ item.entity.organizationOccupation }}</td> | ||
<td class="item-data"> | ||
{% for skill in item.entity.skillSet -%} | ||
<span | ||
class="badge badge-{{ skill in importantSkills ? 'primary' : 'secondary' }}">{{ skill }}</span> | ||
{%- endfor %} | ||
</td> | ||
<td class="item-data">{{ item.entity.fullyEquipped ? 'common.yes' | trans : '-' }}</td> | ||
<td class="item-data">{{ item.entity.vulnerable ? 'common.yes' | trans : '-' }}</td> | ||
{% endblock itemDataDetails %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters