mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
layout for rendering list
This commit is contained in:
parent
1f1ebb6adb
commit
909d2dfb60
@ -1,5 +1,7 @@
|
||||
// Access to Bootstrap variables and mixins
|
||||
@import '~ChillMainAssets/module/bootstrap/shared';
|
||||
@import '~ChillPersonAssets/chill/scss/mixins.scss';
|
||||
@import 'bootstrap/scss/_badge.scss';
|
||||
|
||||
//// ACTIVITY CREATION
|
||||
// first step: select type page
|
||||
@ -96,3 +98,25 @@ li.document-list-item {
|
||||
justify-content: space-between;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -20,8 +20,25 @@
|
||||
{% elseif document.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% 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>
|
||||
{% 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">
|
||||
{{ document.title }}
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.hasTemplate %}
|
||||
<div>
|
||||
@ -39,19 +56,6 @@
|
||||
</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-col item-meta">
|
||||
|
@ -17,6 +17,7 @@ use Chill\ActivityBundle\Service\GenericDoc\Providers\PersonActivityGenericDocPr
|
||||
use Chill\DocStoreBundle\GenericDoc\GenericDocDTO;
|
||||
use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface;
|
||||
use Chill\DocStoreBundle\Repository\StoredObjectRepository;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
|
||||
final class AccompanyingPeriodActivityGenericDocRenderer implements GenericDocRendererInterface
|
||||
{
|
||||
@ -44,7 +45,8 @@ final class AccompanyingPeriodActivityGenericDocRenderer implements GenericDocRe
|
||||
{
|
||||
return [
|
||||
'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(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -372,3 +372,8 @@ export:
|
||||
is sent: envoyé
|
||||
is received: 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
|
||||
|
@ -0,0 +1 @@
|
||||
import './scss/badge.scss';
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -17,4 +17,4 @@ span.calendarRangeItems {
|
||||
text-decoration: none;
|
||||
padding: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -12,11 +12,31 @@
|
||||
{% elseif document.storedObject.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
<div class="denomination h2">
|
||||
{{ document.storedObject.title }}
|
||||
</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>
|
||||
{% 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>
|
||||
{% if document.storedObject.hasTemplate %}
|
||||
<div>
|
||||
@ -34,20 +54,6 @@
|
||||
</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-col item-meta">
|
||||
{{ mmm.createdBy(document) }}
|
||||
|
@ -39,7 +39,8 @@ final class AccompanyingPeriodCalendarGenericDocRenderer implements GenericDocRe
|
||||
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array
|
||||
{
|
||||
return [
|
||||
'document' => $this->repository->find($genericDocDTO->identifiers['id'])
|
||||
'document' => $this->repository->find($genericDocDTO->identifiers['id']),
|
||||
'context' => $genericDocDTO->getContext(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
// this file loads all assets from the Chill calendar bundle
|
||||
module.exports = function(encore, entries) {
|
||||
|
||||
entries.push(__dirname + '/Resources/public/chill/chill.js');
|
||||
|
||||
encore.addAliases({
|
||||
ChillCalendarAssets: __dirname + '/Resources/public'
|
||||
});
|
||||
|
@ -151,5 +151,5 @@ CHILL_CALENDAR_CALENDAR_SEE: Voir les rendez-vous
|
||||
generic_doc:
|
||||
filter:
|
||||
keys:
|
||||
accompanying_period_calendar_document: Document des rendez-vous
|
||||
person_calendar_document: Document des rendez-vous de la personne
|
||||
accompanying_period_calendar_document: Document des rendez-vous des parcours
|
||||
person_calendar_document: Document des rendez-vous de l'usager
|
||||
|
@ -23,4 +23,9 @@ final readonly class GenericDocDTO
|
||||
public AccompanyingPeriod|Person $linked,
|
||||
) {
|
||||
}
|
||||
|
||||
public function getContext(): string
|
||||
{
|
||||
return $this->linked instanceof AccompanyingPeriod ? 'accompanying-period' : 'person';
|
||||
}
|
||||
}
|
||||
|
@ -40,19 +40,20 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen
|
||||
|
||||
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array
|
||||
{
|
||||
dump($genericDocDTO);
|
||||
if (AccompanyingCourseDocumentGenericDocProvider::KEY === $genericDocDTO->key) {
|
||||
return [
|
||||
'document' => $doc = $this->accompanyingCourseDocumentRepository->find($genericDocDTO->identifiers['id']),
|
||||
'accompanyingCourse' => $doc->getCourse(),
|
||||
'options' => $options,
|
||||
'context' => $genericDocDTO->getContext(),
|
||||
];
|
||||
}
|
||||
// this is a person
|
||||
return [
|
||||
'document' => $doc = dump($this->personDocumentRepository->find($genericDocDTO->identifiers['id'])),
|
||||
'document' => $doc = $this->personDocumentRepository->find($genericDocDTO->identifiers['id']),
|
||||
'person' => $doc->getPerson(),
|
||||
'options' => $options,
|
||||
'context' => $genericDocDTO->getContext(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,16 @@
|
||||
{% elseif document.object.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if context == 'person' and accompanyingCourse is defined %}
|
||||
<div>
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ accompanyingCourse.id }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="denomination h2">
|
||||
{{ document.title }}
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.object.type is not empty %}
|
||||
<div>
|
||||
|
@ -42,6 +42,7 @@ by_user: "par "
|
||||
lifecycleUpdate: Evenements de création et mise à jour
|
||||
address_fields: Données liées à l'adresse
|
||||
Datas: Données
|
||||
No title: Aucun titre
|
||||
|
||||
inactive: inactif
|
||||
|
||||
|
@ -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
|
||||
div.accompanying-course-work {
|
||||
|
||||
|
@ -12,8 +12,19 @@
|
||||
{% elseif document.storedObject.isFailure %}
|
||||
<div class="badge text-bg-warning">{{ 'docgen.Doc generation failed'|trans }}</div>
|
||||
{% endif %}
|
||||
<div>
|
||||
{% if context == 'person' %}
|
||||
<span class="badge bg-primary">
|
||||
<i class="fa fa-random"></i> {{ w.accompanyingPeriod.id }}
|
||||
</span>
|
||||
{% 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">
|
||||
{{ document.title }}
|
||||
{{ document.title|chill_print_or_message("No title") }}
|
||||
</div>
|
||||
{% if document.storedObject.type is not empty %}
|
||||
<div>
|
||||
@ -36,16 +47,6 @@
|
||||
</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-col item-meta">
|
||||
{{ mmm.createdBy(document) }}
|
||||
|
@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Service\GenericDoc\Renderer;
|
||||
|
||||
use Chill\DocStoreBundle\GenericDoc\GenericDocDTO;
|
||||
use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocumentRepository;
|
||||
use Chill\PersonBundle\Service\GenericDoc\Providers\AccompanyingPeriodWorkEvaluationGenericDocProvider;
|
||||
|
||||
@ -36,7 +37,8 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocRenderer implemen
|
||||
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array
|
||||
{
|
||||
return [
|
||||
'document' => $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($genericDocDTO->identifiers['id'])
|
||||
'document' => $this->accompanyingPeriodWorkEvaluationDocumentRepository->find($genericDocDTO->identifiers['id']),
|
||||
'context' => $genericDocDTO->getContext(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user