mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
layout for rendering list
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user