From 3b31acebd612bbe443f11af2d24aa61b9e61f528 Mon Sep 17 00:00:00 2001
From: Joel Takvorian <jtakvori@redhat.com>
Date: Wed, 16 Oct 2019 10:24:02 +0200
Subject: [PATCH] Link to participation from event page

When the organizer sees hiw own event, the number of attendees is now a link to the attendees page

Fixes #221
---
 js/src/views/Event/Event.vue | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/js/src/views/Event/Event.vue b/js/src/views/Event/Event.vue
index 1df1d938b..a0f4d4305 100644
--- a/js/src/views/Event/Event.vue
+++ b/js/src/views/Event/Event.vue
@@ -15,10 +15,18 @@ import {ParticipantRole} from "@/types/event.model";
                 <div class="title-and-informations">
                   <h1 class="title">{{ event.title }}</h1>
                   <span>
-                    <small v-if="event.participantStats.approved > 0 && !actorIsParticipant">
+                    <router-link v-if="actorIsOrganizer" :to="{ name: RouteName.PARTICIPATIONS, params: {eventId: event.uuid}}">
+                      <small v-if="event.participantStats.approved > 0 && !actorIsParticipant">
+                        {{ $tc('One person is going', event.participantStats.approved, {approved: event.participantStats.approved}) }}
+                      </small>
+                      <small v-else-if="event.participantStats.approved > 0 && actorIsParticipant">
+                        {{ $tc('You and one other person are going to this event', event.participantStats.participants, { approved: event.participantStats.participants }) }}
+                      </small>
+                    </router-link>
+                    <small v-if="event.participantStats.approved > 0 && !actorIsParticipant && !actorIsOrganizer">
                       {{ $tc('One person is going', event.participantStats.approved, {approved: event.participantStats.approved}) }}
                     </small>
-                    <small v-else-if="event.participantStats.approved > 0 && actorIsParticipant">
+                    <small v-else-if="event.participantStats.approved > 0 && actorIsParticipant && !actorIsOrganizer">
                       {{ $tc('You and one other person are going to this event', event.participantStats.participants, { approved: event.participantStats.participants }) }}
                     </small>
                     <small v-if="event.options.maximumAttendeeCapacity">