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 { div.action {
padding: 0 0 1em 1em; padding: 0 0 1em 1em;
} }
// avoid a position relative that make links unclickable // avoid a position relative that make links unclickable
.fa-ul > li { .fa-ul > li {
position: initial; position: initial;

View File

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