This repository has been archived by the owner on Oct 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #205 from traPtitech/feat/event_detail_page
admin/events/:eventId
- Loading branch information
Showing
6 changed files
with
105 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,6 @@ | |
color: $text-primary; | ||
background-color: $background-primary; | ||
min-height: 100vh; | ||
padding-bottom: 2rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<script setup lang="ts"> | ||
import { onMounted, ref } from 'vue' | ||
import apis, { CreateMeetingRequest, Meeting, Token } from '@/lib/apis' | ||
import EventTokens from '@/components/EventDetail/EventTokens.vue' | ||
import { useRoute, useRouter } from 'vue-router' | ||
import { getMeetingId } from '@/lib/parsePathParams' | ||
import AIcon from '@/components/UI/AIcon.vue' | ||
import EmoineHeader from '@/components/EmoineHeader.vue' | ||
import EventInformation from '@/components/EventDetail/EventInformation.vue' | ||
const route = useRoute() | ||
const router = useRouter() | ||
const eventId = getMeetingId(route.params.eventId) | ||
const eventDetail = ref<Meeting>() | ||
const tokens = ref<Token[]>([]) | ||
const fetchEventInformation = async () => { | ||
const res = (await apis.getMeeting(eventId)).data | ||
eventDetail.value = res | ||
} | ||
const fetchTokens = async () => { | ||
const res = (await apis.getMeetingTokens(eventId)).data | ||
tokens.value = res | ||
} | ||
const updateDescription = async (description: string) => { | ||
if (!eventDetail.value) return | ||
const updateMeetingRequest: CreateMeetingRequest = { | ||
videoId: eventDetail.value.videoId, | ||
description: description | ||
} | ||
await apis.updateMeeting(eventId, updateMeetingRequest) | ||
} | ||
const deleteEvent = async () => { | ||
const result = confirm('本当にこのイベントを削除しますか?') | ||
if (!result) return | ||
await apis.deleteMeeting(eventId) | ||
router.push({ name: 'AdminMeetings' }) | ||
} | ||
onMounted(async () => { | ||
await fetchEventInformation() | ||
await fetchTokens() | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div :class="$style.container"> | ||
<emoine-header /> | ||
<section> | ||
<h2 :class="$style.heading"> | ||
<a-icon name="akar-icons:youtube-fill" :size="56" color="#ff007f" /> | ||
<p>Event Information</p> | ||
</h2> | ||
<event-information | ||
v-if="eventDetail" | ||
:meeting="eventDetail" | ||
@update-description="updateDescription($event)" | ||
@delete="deleteEvent" | ||
/> | ||
</section> | ||
<section :class="$style.tokensSection"> | ||
<h2 :class="$style.heading"> | ||
<a-icon name="tabler:certificate" :size="56" color="#ff007f" /> | ||
<p>Tokens</p> | ||
</h2> | ||
<event-tokens :tokens="tokens" @add-new-token="tokens.unshift($event)" /> | ||
</section> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" module> | ||
.container { | ||
padding: 0 15%; | ||
} | ||
.heading { | ||
display: flex; | ||
align-items: center; | ||
font-size: 2rem; | ||
gap: 0.5rem; | ||
margin-bottom: 0.5rem; | ||
} | ||
.tokensSection { | ||
margin-top: 1rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters