layout for rendering list

This commit is contained in:
Julien Fastré 2023-06-13 15:00:16 +02:00
parent 1f1ebb6adb
commit 909d2dfb60
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
18 changed files with 162 additions and 52 deletions

View File

@ -1,5 +1,7 @@
// Access to Bootstrap variables and mixins // Access to Bootstrap variables and mixins
@import '~ChillMainAssets/module/bootstrap/shared'; @import '~ChillMainAssets/module/bootstrap/shared';
@import '~ChillPersonAssets/chill/scss/mixins.scss';
@import 'bootstrap/scss/_badge.scss';
//// ACTIVITY CREATION //// ACTIVITY CREATION
// first step: select type page // first step: select type page
@ -96,3 +98,25 @@ li.document-list-item {
justify-content: space-between; justify-content: space-between;
margin-bottom: 0.3rem; margin-bottom: 0.3rem;
} }
.badge-activity-type {
display: inline-block;
background-color: #f3f3f3;
.title_label {
@include chill_badge(#9acd32);
}
.title_action {
padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
margin-right: 1rem;
font-size: var(--bs-badge-font-size);
font-weight: var(--bs-badge-font-weight);
line-height: 1;
color: var(--bs-badge-color);
text-align: center;
white-space: nowrap;
vertical-align: baseline;
}
}

View File

@ -20,8 +20,25 @@
{% elseif document.isFailure %} {% elseif document.isFailure %}
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div> <div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
{% endif %} {% endif %}
<div>
{% if activity.accompanyingPeriod is not null and context == 'person' %}
<span class="badge bg-primary">
<i class="fa fa-random"></i> {{ activity.accompanyingPeriod.id }}
</span>&nbsp;
{% endif %}
<div class="badge-activity-type">
<span class="title_label"></span>
<span class="title_action">
{{ activity.type.name | localize_translatable_string }}
{% if activity.emergency %}
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
{% endif %}
</span>
</div>
</div>
<div class="denomination h2"> <div class="denomination h2">
{{ document.title }} {{ document.title|chill_print_or_message("No title") }}
</div> </div>
{% if document.hasTemplate %} {% if document.hasTemplate %}
<div> <div>
@ -39,19 +56,6 @@
</div> </div>
</div> </div>
<div class="item-row separator">
<div class="item-col">
<h2 class="badge-title">
<span class="title_label"></span>
<span class="title_action">
{{ activity.type.name | localize_translatable_string }}
{% if activity.emergency %}
<span class="badge bg-danger rounded-pill fs-6 float-end">{{ 'Emergency'|trans|upper }}</span>
{% endif %}
</span>
</h2>
</div>
</div>
<div class="item-row separator"> <div class="item-row separator">
<div class="item-col item-meta"> <div class="item-col item-meta">

View File

@ -17,6 +17,7 @@ use Chill\ActivityBundle\Service\GenericDoc\Providers\PersonActivityGenericDocPr
use Chill\DocStoreBundle\GenericDoc\GenericDocDTO; use Chill\DocStoreBundle\GenericDoc\GenericDocDTO;
use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface; use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface;
use Chill\DocStoreBundle\Repository\StoredObjectRepository; use Chill\DocStoreBundle\Repository\StoredObjectRepository;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
final class AccompanyingPeriodActivityGenericDocRenderer implements GenericDocRendererInterface final class AccompanyingPeriodActivityGenericDocRenderer implements GenericDocRendererInterface
{ {
@ -44,7 +45,8 @@ final class AccompanyingPeriodActivityGenericDocRenderer implements GenericDocRe
{ {
return [ return [
'activity' => $this->activityRepository->find($genericDocDTO->identifiers['activity_id']), 'activity' => $this->activityRepository->find($genericDocDTO->identifiers['activity_id']),
'document' => $this->objectRepository->find($genericDocDTO->identifiers['id']) 'document' => $this->objectRepository->find($genericDocDTO->identifiers['id']),
'context' => $genericDocDTO->getContext(),
]; ];
} }
} }

View File

@ -372,3 +372,8 @@ export:
is sent: envoyé is sent: envoyé
is received: reçu is received: reçu
Group activity by sentreceived: Grouper les échanges par envoyé / reçu Group activity by sentreceived: Grouper les échanges par envoyé / reçu
generic_doc:
filter:
keys:
accompanying_period_activity_document: Document des échanges des parcours

View File

@ -0,0 +1 @@
import './scss/badge.scss';

View File

@ -0,0 +1,25 @@
@import '~ChillPersonAssets/chill/scss/mixins.scss';
@import '~ChillMainAssets/module/bootstrap/shared';
.badge-calendar {
display: inline-block;
background-color: #f3f3f3;
.title_label {
@include chill_badge($chill-l-gray);
}
.title_action {
padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
margin-right: 1rem;
font-size: var(--bs-badge-font-size);
font-weight: var(--bs-badge-font-weight);
line-height: 1;
color: var(--bs-badge-color);
text-align: center;
white-space: nowrap;
vertical-align: baseline;
}
}

View File

@ -17,4 +17,4 @@ span.calendarRangeItems {
text-decoration: none; text-decoration: none;
padding: 3px; padding: 3px;
} }
} }

View File

@ -12,11 +12,31 @@
{% elseif document.storedObject.isFailure %} {% elseif document.storedObject.isFailure %}
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div> <div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
{% endif %} {% endif %}
<div class="denomination h2">
{{ document.storedObject.title }}
</div>
<div> <div>
{{ 'chill_calendar.Document'|trans }} {% if c.accompanyingPeriod is not null and context == 'person' %}
<span class="badge bg-primary">
<i class="fa fa-random"></i> {{ c.accompanyingPeriod.id }}
</span>&nbsp;
{% endif %}
<span class="badge-calendar">
<span class="title_label"></span>
<span class="title_action">
{{ 'Calendar'|trans }}
{% if c.endDate.diff(c.startDate).days >= 1 %}
{{ c.startDate|format_datetime('short', 'short') }}
- {{ c.endDate|format_datetime('short', 'short') }}
{% else %}
{{ c.startDate|format_datetime('short', 'short') }}
- {{ c.endDate|format_datetime('none', 'short') }}
{% endif %}
</span>
</span>
</div>
<div class="denomination h2">
{{ document.storedObject.title|chill_print_or_message("No title") }}
</div> </div>
{% if document.storedObject.hasTemplate %} {% if document.storedObject.hasTemplate %}
<div> <div>
@ -34,20 +54,6 @@
</div> </div>
</div> </div>
<div class="item-row separator">
<div class="item-col">
<p class="date-label">
{% if c.endDate.diff(c.startDate).days >= 1 %}
{{ c.startDate|format_datetime('short', 'short') }}
- {{ c.endDate|format_datetime('short', 'short') }}
{% else %}
{{ c.startDate|format_datetime('short', 'short') }}
- {{ c.endDate|format_datetime('none', 'short') }}
{% endif %}
</p>
</div>
</div>
<div class="item-row separator"> <div class="item-row separator">
<div class="item-col item-meta"> <div class="item-col item-meta">
{{ mmm.createdBy(document) }} {{ mmm.createdBy(document) }}

View File

@ -39,7 +39,8 @@ final class AccompanyingPeriodCalendarGenericDocRenderer implements GenericDocRe
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array
{ {
return [ return [
'document' => $this->repository->find($genericDocDTO->identifiers['id']) 'document' => $this->repository->find($genericDocDTO->identifiers['id']),
'context' => $genericDocDTO->getContext(),
]; ];
} }
} }

View File

@ -1,6 +1,8 @@
// this file loads all assets from the Chill calendar bundle // this file loads all assets from the Chill calendar bundle
module.exports = function(encore, entries) { module.exports = function(encore, entries) {
entries.push(__dirname + '/Resources/public/chill/chill.js');
encore.addAliases({ encore.addAliases({
ChillCalendarAssets: __dirname + '/Resources/public' ChillCalendarAssets: __dirname + '/Resources/public'
}); });

View File

@ -151,5 +151,5 @@ CHILL_CALENDAR_CALENDAR_SEE: Voir les rendez-vous
generic_doc: generic_doc:
filter: filter:
keys: keys:
accompanying_period_calendar_document: Document des rendez-vous accompanying_period_calendar_document: Document des rendez-vous des parcours
person_calendar_document: Document des rendez-vous de la personne person_calendar_document: Document des rendez-vous de l'usager

View File

@ -23,4 +23,9 @@ final readonly class GenericDocDTO
public AccompanyingPeriod|Person $linked, public AccompanyingPeriod|Person $linked,
) { ) {
} }
public function getContext(): string
{
return $this->linked instanceof AccompanyingPeriod ? 'accompanying-period' : 'person';
}
} }

View File

@ -40,19 +40,20 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array
{ {
dump($genericDocDTO);
if (AccompanyingCourseDocumentGenericDocProvider::KEY === $genericDocDTO->key) { if (AccompanyingCourseDocumentGenericDocProvider::KEY === $genericDocDTO->key) {
return [ return [
'document' => $doc = $this->accompanyingCourseDocumentRepository->find($genericDocDTO->identifiers['id']), 'document' => $doc = $this->accompanyingCourseDocumentRepository->find($genericDocDTO->identifiers['id']),
'accompanyingCourse' => $doc->getCourse(), 'accompanyingCourse' => $doc->getCourse(),
'options' => $options, 'options' => $options,
'context' => $genericDocDTO->getContext(),
]; ];
} }
// this is a person // this is a person
return [ return [
'document' => $doc = dump($this->personDocumentRepository->find($genericDocDTO->identifiers['id'])), 'document' => $doc = $this->personDocumentRepository->find($genericDocDTO->identifiers['id']),
'person' => $doc->getPerson(), 'person' => $doc->getPerson(),
'options' => $options, 'options' => $options,
'context' => $genericDocDTO->getContext(),
]; ];
} }
} }

View File

@ -10,8 +10,16 @@
{% elseif document.object.isFailure %} {% elseif document.object.isFailure %}
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div> <div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
{% endif %} {% endif %}
{% if context == 'person' and accompanyingCourse is defined %}
<div>
<span class="badge bg-primary">
<i class="fa fa-random"></i> {{ accompanyingCourse.id }}
</span>&nbsp;
</div>
{% endif %}
<div class="denomination h2"> <div class="denomination h2">
{{ document.title }} {{ document.title|chill_print_or_message("No title") }}
</div> </div>
{% if document.object.type is not empty %} {% if document.object.type is not empty %}
<div> <div>

View File

@ -42,6 +42,7 @@ by_user: "par "
lifecycleUpdate: Evenements de création et mise à jour lifecycleUpdate: Evenements de création et mise à jour
address_fields: Données liées à l'adresse address_fields: Données liées à l'adresse
Datas: Données Datas: Données
No title: Aucun titre
inactive: inactif inactive: inactif

View File

@ -1,3 +1,25 @@
.badge-accompanying-work-type {
display: inline-block;
background-color: #f3f3f3;
.title_label {
@include chill_badge(#e2793d);
}
.title_action {
padding: var(--bs-badge-padding-y) var(--bs-badge-padding-x);
margin-right: 1rem;
font-size: var(--bs-badge-font-size);
font-weight: var(--bs-badge-font-weight);
line-height: 1;
color: var(--bs-badge-color);
text-align: center;
white-space: nowrap;
vertical-align: baseline;
}
}
/// AccompanyingCourse Work Pages /// AccompanyingCourse Work Pages
div.accompanying-course-work { div.accompanying-course-work {

View File

@ -12,8 +12,19 @@
{% elseif document.storedObject.isFailure %} {% elseif document.storedObject.isFailure %}
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div> <div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
{% endif %} {% endif %}
<div>
{% if context == 'person' %}
<span class="badge bg-primary">
<i class="fa fa-random"></i> {{ w.accompanyingPeriod.id }}
</span>&nbsp;
{% endif %}
<div class="badge-accompanying-work-type">
<span class="title_label"></span>
<span class="title_action">{{ w.socialAction|chill_entity_render_string }} > {{ document.accompanyingPeriodWorkEvaluation.evaluation.title|localize_translatable_string }}</span>
</div>
</div>
<div class="denomination h2"> <div class="denomination h2">
{{ document.title }} {{ document.title|chill_print_or_message("No title") }}
</div> </div>
{% if document.storedObject.type is not empty %} {% if document.storedObject.type is not empty %}
<div> <div>
@ -36,16 +47,6 @@
</div> </div>
</div> </div>
<div class="item-row separator accompanying-course-work">
<div class="item-col">
<h2 class="badge-title">
<span class="title_label"></span>
<span class="title_action">{{ w.socialAction|chill_entity_render_string }} > {{ document.accompanyingPeriodWorkEvaluation.evaluation.title|localize_translatable_string }}
</span>
</h2>
</div>
</div>
<div class="item-row separator"> <div class="item-row separator">
<div class="item-col item-meta"> <div class="item-col item-meta">
{{ mmm.createdBy(document) }} {{ mmm.createdBy(document) }}

View File

@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Service\GenericDoc\Renderer;
use Chill\DocStoreBundle\GenericDoc\GenericDocDTO; use Chill\DocStoreBundle\GenericDoc\GenericDocDTO;
use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface; use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocumentRepository; use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocumentRepository;
use Chill\PersonBundle\Service\GenericDoc\Providers\AccompanyingPeriodWorkEvaluationGenericDocProvider; use Chill\PersonBundle\Service\GenericDoc\Providers\AccompanyingPeriodWorkEvaluationGenericDocProvider;
@ -36,7 +37,8 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocRenderer implemen
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array
{ {
return [ return [
'document' => $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($genericDocDTO->identifiers['id']) 'document' => $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($genericDocDTO->identifiers['id']),
'context' => $genericDocDTO->getContext(),
]; ];
} }
} }