Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard update #47

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ declare namespace DB {
work: string
location: string
message: string

field: string
kakao: string
dinner: string
}

interface Email {
Expand Down
28 changes: 23 additions & 5 deletions src/lib/components/AdminTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,33 @@
<th>신청일</th>
<th>이름</th>
<th>Email</th>
<th>거주지</th>
<th>직업</th>
<th>직장</th>
<th>거주지</th>

<!-- for event 밴쿠버 IT회사 옆 대나무숲 -->
<th>필드</th>
<th>카톡</th>
<th>2차 참석?</th>

<th>처음 참여?</th>
<th class="w-[40rem] text-left">비고</th>
</tr>
{#each $activeTickets as ticket, index (ticket.id)}
{#each $activeTickets.slice().reverse() as ticket, index (ticket.id)}
<tr class="border text-center">
<td>{index + 1}</td>
<td>{ticket.createdAt.toDate().toLocaleDateString()}</td>
<td>{ticket.name}</td>
<td>{ticket.email}</td>
<td>{ticket.location}</td>
<td>{ticket.occupation}</td>
<td>{ticket.work}</td>
<td>{ticket.location}</td>

<!-- for event 밴쿠버 IT회사 옆 대나무숲 -->
<td>{ticket.field ? ticket.field : '해당없음'}</td>
<td>{ticket.kakao ? ticket.kakao : '해당없음'}</td>
<td>{ticket.dinner ? ticket.dinner : '해당없음'}</td>

<td>{ticket.firstTime}</td>
<td class="text-left">{ticket.message}</td>
</tr>
Expand All @@ -55,15 +67,21 @@
<th class="text-lg font-semibold"></th>
</tr>

{#each $cancelledTickets as ticket, index (ticket.id)}
{#each $cancelledTickets.slice().reverse() as ticket, index (ticket.id)}
<tr class="border text-center">
<td>{index + 1}</td>
<td>{ticket.createdAt.toDate().toLocaleDateString()}</td>
<td>{ticket.name}</td>
<td>{ticket.email}</td>
<td>{ticket.location}</td>
<td>{ticket.occupation}</td>
<td>{ticket.work}</td>
<td>{ticket.location}</td>

<!-- for event 밴쿠버 IT회사 옆 대나무숲 -->
<td>{ticket.field ? ticket.field : '해당없음'}</td>
<td>{ticket.kakao ? ticket.kakao : '해당없음'}</td>
<td>{ticket.dinner ? ticket.dinner : '해당없음'}</td>

<td>{ticket.firstTime}</td>
<td class="text-left">{ticket.message}</td>
</tr>
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/Drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import {AdminTable} from './index'
import {selectedEventId} from '$lib/store'
import {twMerge} from 'tailwind-merge'

export let events: DB.Event[]
export let ticketValue: Map<string, DB.Ticket>
</script>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/server/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ export async function handleKofiWebhook(data: Omit<App.KoFiWebhookData, 'verific
message: {
subject: `[Vancouver KDD] Purchase Complete for ${ticketData.eventName}`,
text: `Congratulations, we received payment ${data.amount}.
See you at ${ticketData.eventName}!
To view your ticket, please visit this link https://vancouverkdd.com/myTicket?ticketId=${ticketData.id}`,
See you at ${ticketData.eventName}!
To view your ticket, please visit this link https://vancouverkdd.com/myTicket?ticketId=${ticketData.id}`,
},
} satisfies DB.Email)
} else {
Expand Down
5 changes: 5 additions & 0 deletions src/routes/checkout/[eventId]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export const actions = {
location: userData.location,
message: userData.message,
status: isFree ? 'free' : 'unpaid',

//for event 밴쿠버 IT회사 옆 대나무숲
field: userData.field,
kakao: userData.kakao,
dinner: userData.dinner,
} satisfies Omit<DB.Ticket, 'createdAt'>

await createTicket(ticketData)
Expand Down
178 changes: 138 additions & 40 deletions src/routes/checkout/[eventId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
work: '',
location: '',
message: '',

field: '',
kakao: '',
dinner: '',
}

$: isFree = event?.price === '0.00'
Expand Down Expand Up @@ -59,11 +63,21 @@
{event && event.location}
</div>
<h3 class="font-semibold text-lg text-royalBlue-700">Summary</h3>
<button
class="pt-0.5 text-left text-sm cursor-pointer text-gray-600 hover:text-royalBlue-800"
on:click={() => dialog?.showModal()}>
{@html Marked.parse(_.truncate(event?.description, {length: 322}))}
</button>

<!-- for event 밴쿠버 IT회사 옆 대나무숲 -->
{#if event?.id === 'recCay7Taim9hFJbF'}
<button
class="pt-0.5 text-left text-sm cursor-pointer text-gray-600 hover:text-royalBlue-800"
on:click={() => dialog?.showModal()}>
{@html Marked.parse(_.truncate(event?.description, {length: 500}))}
</button>
{:else}
<button
class="pt-0.5 text-left text-sm cursor-pointer text-gray-600 hover:text-royalBlue-800"
on:click={() => dialog?.showModal()}>
{@html Marked.parse(_.truncate(event?.description, {length: 322}))}
</button>
{/if}
</div>
</div>

Expand Down Expand Up @@ -151,46 +165,88 @@
class="w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:border-royalBlue-500" />
</div>

<div class="mb-4">
<label for="occupation" class="block text-sm font-medium text-gray-700">
Occupation: <span class="required">*</span>
</label>
<div class="flex">
<select
<!-- for event 밴쿠버 IT회사 옆 대나무숲 -->
{#if event?.id === 'recCay7Taim9hFJbF'}
<div class="mb-4">
<label for="occupation" class="block text-sm font-medium text-gray-700">
Occupation: <span class="required">*</span>
</label>
<input
type="text"
name="occupation"
bind:value={formData.occupation}
required
class="w-full mr-2 px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500">
<option value="" selected disabled hidden>Select an option</option>
<option value="developer">개발자</option>
<option value="designer">디자이너</option>
<option value="student">학생</option>
<option value="other">기타</option>
</select>
{#if formData.occupation === 'other'}
<input
placeholder="Software Engineer II, Product Designer I"
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
</div>

<div class="mb-4">
<label for="occupation" class="block text-sm font-medium text-gray-700">
Field: <span class="required">*</span>
</label>
<input
type="text"
name="field"
bind:value={formData.field}
required
placeholder="Front-End, Full-stack, Android, UI, Animation"
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
</div>

<div class="mb-4">
<label for="work" class="block text-sm font-medium text-gray-700">
Work: <span class="required">*</span>
</label>
<input
type="text"
name="work"
bind:value={formData.work}
required
placeholder="회사명, 프리랜서, 기타"
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
</div>
{:else}
<div class="mb-4">
<label for="occupation" class="block text-sm font-medium text-gray-700">
Occupation: <span class="required">*</span>
</label>
<div class="flex">
<select
name="occupation"
bind:value={formData.occupation}
required
type="text"
name="customOccupation"
bind:value={formData.customOccupation}
placeholder="직업을 입력해주세요"
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
{/if}
class="w-full mr-2 px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500">
<option value="" selected disabled hidden>Select an option</option>
<option value="developer">개발자</option>
<option value="designer">디자이너</option>
<option value="student">학생</option>
<option value="other">기타</option>
</select>
{#if formData.occupation === 'other'}
<input
required
type="text"
name="customOccupation"
bind:value={formData.customOccupation}
placeholder="직업을 입력해주세요"
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
{/if}
</div>
</div>
</div>

<div class="mb-4">
<label for="work" class="block text-sm font-medium text-gray-700">
Work: <span class="required">*</span>
</label>
<input
type="text"
name="work"
bind:value={formData.work}
required
placeholder="학교명, 회사명, 프리랜서, 기타"
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
</div>
<div class="mb-4">
<label for="work" class="block text-sm font-medium text-gray-700">
Work: <span class="required">*</span>
</label>
<input
type="text"
name="work"
bind:value={formData.work}
required
placeholder="학교명, 회사명, 프리랜서, 기타"
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
</div>
{/if}

<div class="mb-4">
<label for="work" class="block text-sm font-medium text-gray-700">
Expand All @@ -205,6 +261,47 @@
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
</div>

<!-- for event 밴쿠버 IT회사 옆 대나무숲 -->
{#if event?.id === 'recCay7Taim9hFJbF'}
<div class="mb-4">
<label for="work" class="block text-sm font-medium text-gray-700">
카톡아이디:
</label>
<textarea
rows="2"
name="kakao"
bind:value={formData.kakao}
placeholder={'현직자분들을 위한 카톡방을 운영하려고 합니다. \r\n참여 원하시면 카톡 아이디를 남겨주세요.'}
class="w-full px-3 py-2 border border-gray-300 text-sm rounded-md focus:outline-none focus:border-royalBlue-500" />
</div>

<div class="flex flex-col mb-4">
<h3 class="text-sm text-gray-700 font-medium">
2차(저녁) 참가여부 <span class="required">*</span>
</h3>
<div class="flex items-center gap-5">
<span>
<input
type="radio"
name="dinner"
bind:group={formData.dinner}
value="Yes"
required
class="form-radio text-royalBlue-500" />
<label for="yes" class="text-sm text-gray-700 font-medium">Yes</label>
</span>
<span>
<input
type="radio"
name="dinner"
bind:group={formData.dinner}
value="No"
class="form-radio text-royalBlue-500" />
<label for="no" class="text-sm text-gray-700 font-medium">No</label></span>
</div>
</div>
{/if}

{#if !isFree}
<div class="mb-4">
<label for="work" class="flex items-center gap-2">
Expand Down Expand Up @@ -245,7 +342,8 @@
{/if}

<div class="mb-4">
<label for="message" class="block text-sm font-medium text-gray-700">Message: <span class="required">*</span></label>
<label for="message" class="block text-sm font-medium text-gray-700"
>Message: <span class="required">*</span></label>

<!-- placeholder="본 이벤트에 대한 건의사항이나 KDD 운영진에 하시고 싶은 말이 있으시면 남겨주세요. 행사 운영에 적극 반영할 예정입니다." -->
<textarea
Expand Down