accourse: don't display old participations (fix counter)

This commit is contained in:
Mathieu Jaumotte 2021-09-06 16:50:10 +02:00
parent cf78c59e76
commit a94a757ae6
2 changed files with 6 additions and 4 deletions

View File

@ -277,7 +277,7 @@ div.floatbutton {
div.action {
padding: 0 0 1em 1em;
}
// avoid a position relative that make links unclickable
.fa-ul > li {
position: initial;

View File

@ -2,7 +2,7 @@
<div class="vue-component">
<h2><a name="section-10"></a>{{ $t('persons_associated.title')}}</h2>
<div v-if="participations.length > 0">
<div v-if="currentParticipations.length > 0">
<label class="col-form-label">{{ $tc('persons_associated.counter', counter) }}</label>
</div>
<div v-else>
@ -58,11 +58,13 @@ export default {
},
computed: {
...mapState({
participations: state => state.accompanyingCourse.participations,
counter: state => state.accompanyingCourse.participations.length
participations: state => state.accompanyingCourse.participations
}),
currentParticipations() {
return this.participations.filter(p => p.endDate === null)
},
counter() {
return this.currentParticipations.length;
}
},
methods: {