Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Add activity register
Browse files Browse the repository at this point in the history
  • Loading branch information
kikakkz committed Dec 6, 2023
1 parent baeceaa commit ee8d4d1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
15 changes: 14 additions & 1 deletion webui/src/components/ActivityCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
label='Register'
:disable='!registerable()'
color='blue-7'
@click='onRegisterClick'
/>
</div>
<q-separator />
Expand Down Expand Up @@ -174,9 +175,10 @@

<script lang='ts' setup>
import { defineProps, ref, toRef } from 'vue'
import { date } from 'quasar'
import { Cookies, date } from 'quasar'
import { useCollectionStore } from 'src/stores/collection'
import { Activity, useActivityStore, JoinType } from 'src/stores/activity'
import { useRouter } from 'vue-router'

const collection = useCollectionStore()
const splitter = ref(200)
Expand Down Expand Up @@ -211,6 +213,17 @@ const votable = () => {
return activity.value.voteStartAt <= now && activity.value.voteEndAt > now
}

const router = useRouter()
const onRegisterClick = () => {
void router.push({
path: '/activity/register',
query: {
port: Cookies.get('service-port'),
activityId: activity.value.id
}
})
}

</script>

<style scoped lang='sass'>
Expand Down
3 changes: 3 additions & 0 deletions webui/src/components/ActivityRegister.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<template>
<div>HHHHHHHHHHHH</div>
</template>
13 changes: 13 additions & 0 deletions webui/src/pages/ActivityRegister.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div class='row'>
<q-space />
<activity-register />
<q-space />
</div>
</template>

<script lang='ts' setup>
import ActivityRegister from 'src/components/ActivityRegister.vue'
</script>
3 changes: 2 additions & 1 deletion webui/src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ const routes: RouteRecordRaw[] = [
{ path: 'reviewreviewer', component: () => import('pages/ReviewReviewer.vue') },
{ path: 'content', component: () => import('pages/ContentPage.vue') },
{ path: 'create/activity', component: () => import('pages/CreateActivity.vue') },
{ path: 'activity', component: () => import('pages/ActivityPage.vue') }
{ path: 'activity', component: () => import('pages/ActivityPage.vue') },
{ path: 'activity/register', component: () => import('pages/ActivityRegister.vue') }
]
},

Expand Down

0 comments on commit ee8d4d1

Please sign in to comment.