Skip to content

Commit 1bf9d35

Browse files
authored
Merge pull request #53 from GoGaucho/chore/courseRedirectHome
chore(daySummary): add course redirect to info page functionality to today's courses
2 parents 0768846 + 76b9ac1 commit 1bf9d35

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

src/components/DaySummary.vue

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { onActivated, watch } from 'vue'
33
import { state, cache } from '../model.js'
44
import { classrooms } from '../utils/locations.js'
5-
import { MapPinIcon, AcademicCapIcon } from '@heroicons/vue/24/outline'
5+
import { MapPinIcon, AcademicCapIcon, BookOpenIcon } from '@heroicons/vue/24/outline'
66
import { useRouter } from 'vue-router'
77
88
const router = useRouter()
@@ -144,21 +144,31 @@ tick()
144144
</div>
145145
<div class="grow flex items-center m-2"><!-- course list -->
146146
<div v-if="displayTime && targetClass" class="mx-2 flex flex-col items-start">
147-
<span class="text-sm">{{ targetClass.course }}<span v-if="targetClass.session">(session {{ targetClass.session }})</span></span>
147+
<div class="text-sm flex items-center justify-between w-full">
148+
<span>{{ targetClass.course }}<span v-if="targetClass.session">(session {{ targetClass.session }})</span></span>
149+
<div class="flex items-center cursor-pointer">
150+
<BookOpenIcon class="w-5 text-gray-600" v-if="targetClass.course" @click="router.push({ path: '/course', query: { courseId: targetClass.course, quarter: state.quarter } })" />
151+
<MapPinIcon class="w-5 text-gray-600" v-if="classrooms[targetClass.location]" @click="locate(targetClass.location)"/>
152+
</div>
153+
</div>
148154
<span class="font-mono text-4xl font-bold">{{ displayTime }}</span>
149-
<div class="text-sm flex items-center" :class="classrooms[targetClass.location] && 'cursor-pointer'" @click="locate(targetClass.location)">
155+
<div class="text-sm" :class="classrooms[targetClass.location] && 'cursor-pointer'">
150156
{{ targetClass.location }}
151-
<MapPinIcon class="ml-1 w-5 text-gray-500" v-if="classrooms[targetClass.location]" />
152157
</div>
153158
</div>
154159
<div v-for="c in classes" class="relative rounded-r-sm p-2 mx-1 h-full overflow-hidden w-40 all-transition" :class="c.current ? 'bg-red-50' : (c.next ? 'bg-yellow-50' : 'bg-blue-50')"><!-- course card -->
155-
<div>
156-
<b>{{ c.course }}</b>
157-
<span class="text-xs ml-1" v-if="c.session">(session {{ c.session }})</span>
160+
<div class="flex items-center justify-between w-full">
161+
<div class="flex items-center">
162+
<b>{{ c.course }}</b>
163+
<span class="text-xs ml-1" v-if="c.session">(session {{ c.session }})</span>
164+
</div>
165+
<div class="flex items-center cursor-pointer">
166+
<BookOpenIcon class="w-5" :class="c.current ? 'text-red-500' : (c.next ? 'text-yellow-500' : 'text-blue-500')" v-if="c.course" @click="router.push({ path: '/course', query: { courseId: c.course, quarter: state.quarter } })" />
167+
<MapPinIcon class="w-5" :class="c.current ? 'text-red-500' : (c.next ? 'text-yellow-500' : 'text-blue-500')" v-if="classrooms[c.location]" @click="locate(c.location)"/>
168+
</div>
158169
</div>
159-
<div class="text-sm flex items-center" :class="classrooms[c.location] && 'cursor-pointer'" @click="locate(c.location)">
170+
<div class="text-sm">
160171
{{ c.location }}
161-
<MapPinIcon class="ml-1 w-5 text-gray-500" v-if="classrooms[c.location]" />
162172
</div>
163173
<div class="text-sm">{{ c.time }}</div>
164174
<div class="all-transition absolute bottom-0 top-0 left-0 w-0.5" :class="c.current ? 'bg-red-500' : (c.next ? 'bg-yellow-500' : 'bg-blue-500')" />

0 commit comments

Comments
 (0)