Move Participant role from integer to enum
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
<div v-else>
|
||||
<span v-for="participant in event.participants" :key="participant.actor.uuid">
|
||||
{{ participant.actor.preferredUsername }}
|
||||
<span v-if="participant.role === 4">(organizer)</span>,
|
||||
<span v-if="participant.role === ParticipantRole.CREATOR">(organizer)</span>,
|
||||
<!-- <translate
|
||||
:translate-params="{name: participant.actor.preferredUsername}"
|
||||
> %{name} is in,</translate>-->
|
||||
@@ -33,12 +33,18 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { IEvent } from "@/types/event.model";
|
||||
import {IEvent, ParticipantRole} from "@/types/event.model";
|
||||
import { Component, Prop, Vue } from "vue-property-decorator";
|
||||
|
||||
@Component
|
||||
export default class EventCard extends Vue {
|
||||
@Prop({ required: true }) event!: IEvent;
|
||||
@Prop({ default: false }) hideDetails!: boolean;
|
||||
|
||||
data() {
|
||||
return {
|
||||
ParticipantRole: ParticipantRole
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -20,7 +20,11 @@ export enum EventJoinOptions {
|
||||
}
|
||||
|
||||
export enum ParticipantRole {
|
||||
|
||||
NOT_APPROVED = 'not_approved',
|
||||
PARTICIPANT = 'participant',
|
||||
MODERATOR = 'moderator',
|
||||
ADMINSTRATOR = 'administrator',
|
||||
CREATOR = 'creator'
|
||||
}
|
||||
|
||||
export interface ICategory {
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<a v-if="!actorIsParticipant()" @click="joinEvent" class="button">
|
||||
<translate>Join</translate>
|
||||
</a>
|
||||
<a v-if="actorIsParticipant()" @click="leaveEvent" color="button">Leave</a>
|
||||
<a v-if="actorIsParticipant()" @click="leaveEvent" class="button">Leave</a>
|
||||
</div>
|
||||
<h2 class="subtitle">Details</h2>
|
||||
<p v-if="event.description">
|
||||
|
||||
Reference in New Issue
Block a user