mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add context to MyEvaluations (action and course containers)
This commit is contained in:
parent
a2063ab13b
commit
e98b1b049b
@ -1,34 +1,71 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="accompanying_course_work">
|
||||||
<div class="alert alert-light">{{ $t('my_evaluations.description') }}</div>
|
<div class="alert alert-light">{{ $t('my_evaluations.description') }}</div>
|
||||||
<span v-if="noResults" class="chill-no-data-statement">{{ $t('no_data') }}</span>
|
<span v-if="noResults" class="chill-no-data-statement">{{ $t('no_data') }}</span>
|
||||||
<tab-table v-else>
|
<tab-table v-else>
|
||||||
<template v-slot:thead>
|
<template v-slot:thead>
|
||||||
<th scope="col">{{ $t('max_date') }}</th>
|
<th scope="col">{{ $t('max_date') }}</th>
|
||||||
<th scope="col">{{ $t('evaluation') }}</th>
|
<th scope="col">{{ $t('evaluation') }}</th>
|
||||||
|
<th scope="col">{{ $t('SocialAction') }}</th>
|
||||||
<th scope="col"></th>
|
<th scope="col"></th>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:tbody>
|
<template v-slot:tbody>
|
||||||
<tr v-for="(e, i) in evaluations.results" :key="`evaluation-${i}`">
|
<tr v-for="(e, i) in evaluations.results" :key="`evaluation-${i}`">
|
||||||
<td>{{ $d(e.maxDate.datetime, 'short') }}</td>
|
<td>{{ $d(e.maxDate.datetime, 'short') }}</td>
|
||||||
<td>{{ e.evaluation.title.fr }}</td>
|
|
||||||
<td>
|
<td>
|
||||||
<a class="btn btn-sm btn-show" :href="getUrl(e)">
|
{{ e.evaluation.title.fr }}
|
||||||
{{ $t('show_entity', { entity: $t('the_evaluation') }) }}
|
</td>
|
||||||
</a>
|
<td>
|
||||||
|
<span class="chill-entity entity-social-issue">
|
||||||
|
<span class="badge bg-chill-l-gray text-dark">
|
||||||
|
{{ e.accompanyingPeriodWork.socialAction.issue.text }}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<h4 class="badge-title">
|
||||||
|
<span class="title_label"></span>
|
||||||
|
<span class="title_action">
|
||||||
|
{{ e.accompanyingPeriodWork.socialAction.text }}
|
||||||
|
</span>
|
||||||
|
</h4>
|
||||||
|
<span v-for="person in e.accompanyingPeriodWork.persons" class="me-1" :key="person.id">
|
||||||
|
<on-the-fly
|
||||||
|
:type="person.type"
|
||||||
|
:id="person.id"
|
||||||
|
:buttonText="person.textAge"
|
||||||
|
:displayBadge="'true' === 'true'"
|
||||||
|
action="show">
|
||||||
|
</on-the-fly>
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="btn-group-vertical" role="group" aria-label="Actions">
|
||||||
|
<a class="btn btn-sm btn-show" :href="getUrl(e)">
|
||||||
|
{{ $t('show_entity', { entity: $t('the_evaluation') }) }}
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-sm btn-update" :href="getUrl(e.accompanyingPeriodWork)">
|
||||||
|
{{ $t('show_entity', { entity: $t('the_action') }) }}
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-sm btn-show" :href="getUrl(e.accompanyingPeriodWork.accompanyingPeriod)">
|
||||||
|
{{ $t('show_entity', { entity: $t('the_course') }) }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
</tab-table>
|
</tab-table>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapGetters } from "vuex";
|
import { mapState, mapGetters } from "vuex";
|
||||||
import TabTable from "./TabTable";
|
import TabTable from "./TabTable";
|
||||||
|
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "MyEvaluations",
|
name: "MyEvaluations",
|
||||||
components: {
|
components: {
|
||||||
TabTable
|
TabTable,
|
||||||
|
OnTheFly,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState([
|
...mapState([
|
||||||
@ -47,8 +84,17 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getUrl(e) {
|
getUrl(e) {
|
||||||
let anchor = '#evaluations';
|
switch (e.type) {
|
||||||
return `/fr/person/accompanying-period/work/${e.id}/edit${anchor}`
|
case 'accompanying_period_work_evaluation':
|
||||||
|
let anchor = '#evaluations';
|
||||||
|
return `/fr/person/accompanying-period/work/${e.accompanyingPeriodWork.id}/edit${anchor}`;
|
||||||
|
case 'accompanying_period_work':
|
||||||
|
return `/fr/person/accompanying-period/work/${e.id}/edit`
|
||||||
|
case 'accompanying_period':
|
||||||
|
return `/fr/parcours/${e.id}`
|
||||||
|
default:
|
||||||
|
throw 'entity type unknown';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group" role="group" aria-label="Actions">
|
<div class="btn-group-vertical" role="group" aria-label="Actions">
|
||||||
<a class="btn btn-sm btn-update" :href="getUrl(w)">
|
<a class="btn btn-sm btn-update" :href="getUrl(w)">
|
||||||
{{ $t('show_entity', { entity: $t('the_action') }) }}
|
{{ $t('show_entity', { entity: $t('the_action') }) }}
|
||||||
</a>
|
</a>
|
||||||
|
@ -45,6 +45,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues
|
|||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class)
|
* @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class)
|
||||||
* @Serializer\Groups({"read","read:accompanyingPeriodWork:light"})
|
* @Serializer\Groups({"read","read:accompanyingPeriodWork:light"})
|
||||||
|
* @Serializer\Context(normalizationContext={"groups"={"read"}}, groups={"read:accompanyingPeriodWork:light"})
|
||||||
*/
|
*/
|
||||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user