11<script setup>
2- import { computed , ref , watch , onMounted } from " vue"
2+ import { computed , onMounted , ref , watch } from " vue"
33import { useRoute } from " vue-router"
44import Draggable from " vuedraggable"
55import LpCardItem from " ./LpCardItem.vue"
@@ -20,6 +20,7 @@ const props = defineProps({
2020 ringDash: { type: Function , required: true },
2121 ringValue: { type: Function , required: true },
2222 buildDates: { type: Function , required: false },
23+ isSessionCategory: { type: Boolean , default: false },
2324})
2425const emit = defineEmits ([
2526 " open" ,
@@ -117,22 +118,22 @@ const toggleOpen = () => {
117118 <section class="relative ml-2 rounded-2xl shadow-lg">
118119 <header class="relative bg-support-6 rounded-t-2xl flex items-center justify-between pl-0 pr-4 py-3">
119120 <span
120- class="pointer-events-none absolute inset-y-0 -left-1.5 w-1.5 bg-support-5 rounded-l-2xl"
121121 aria-hidden
122+ class="pointer-events-none absolute inset-y-0 -left-1.5 w-1.5 bg-support-5 rounded-l-2xl"
122123 />
123124 <div class="flex items-center gap-3">
124125 <template v-if="canEdit">
125126 <button
126- class="w-8 h-8 grid place-content-center rounded-lg text-gray-50 hover:bg-gray-15 hover:text-gray-90"
127- :title="t('Drag to reorder')"
128127 :aria-label="t('Drag to reorder')"
128+ :title="t('Drag to reorder')"
129+ class="w-8 h-8 grid place-content-center rounded-lg text-gray-50 hover:bg-gray-15 hover:text-gray-90"
129130 >
130131 <svg
131- width="14"
132+ aria-hidden
133+ fill="currentColor"
132134 height="14"
133135 viewBox="0 0 14 14"
134- fill="currentColor"
135- aria-hidden
136+ width="14"
136137 >
137138 <circle
138139 cx="4"
@@ -169,12 +170,21 @@ const toggleOpen = () => {
169170 </template>
170171 <template v-else>
171172 <span
172- class="inline-block w-8 h-8"
173173 aria-hidden
174+ class="inline-block w-8 h-8"
174175 ></span>
175176 </template>
176177
177- <h2 class="text-body-1 font-semibold text-gray-90">{{ displayTitle }}</h2>
178+ <h2 class="text-body-1 font-semibold text-gray-90">
179+ <span>{{ displayTitle }}</span>
180+ <!-- Display the star if it's a session category; remove the check on category.type -->
181+ <span
182+ v-if="isSessionCategory"
183+ class="ml-2 text-warning"
184+ title="Category created for a session"
185+ >★</span
186+ >
187+ </h2>
178188 </div>
179189
180190 <div class="flex items-center gap-2">
@@ -187,13 +197,13 @@ const toggleOpen = () => {
187197 >
188198 <template #button>
189199 <span
190- class="list-none w-8 h-8 grid place-content-center rounded-lg border border-gray-25 hover:bg-gray-15 cursor-pointer"
191- :title="t('Options')"
192200 :aria-label="t('Options')"
201+ :title="t('Options')"
202+ class="list-none w-8 h-8 grid place-content-center rounded-lg border border-gray-25 hover:bg-gray-15 cursor-pointer"
193203 >
194204 <i
195- class="mdi mdi-dots-vertical text-lg"
196205 aria-hidden
206+ class="mdi mdi-dots-vertical text-lg"
197207 ></i>
198208 </span>
199209 </template>
@@ -239,26 +249,26 @@ const toggleOpen = () => {
239249
240250 <button
241251 v-if="localList.length"
242- :aria-expanded="isOpen ? 'true' : 'false'"
243252 :aria-controls="panelId"
244- class="w-8 h-8 grid place-content-center rounded-lg border border-gray-25 hover:bg-gray-15 transition "
253+ :aria-expanded="isOpen ? 'true' : 'false' "
245254 :title="t('Expand') / t('Collapse')"
255+ class="w-8 h-8 grid place-content-center rounded-lg border border-gray-25 hover:bg-gray-15 transition"
246256 @click="toggleOpen"
247257 >
248258 <svg
249- width="18"
250- height="18"
251- viewBox="0 0 24 24"
259+ :class="isOpen ? 'rotate-180' : ''"
260+ class="transition-transform duration-200"
252261 fill="none"
262+ height="18"
253263 stroke="currentColor"
254- class="transition-transform duration-200 "
255- :class="isOpen ? 'rotate-180' : '' "
264+ viewBox="0 0 24 24 "
265+ width="18 "
256266 >
257267 <path
258268 d="M6 9l6 6 6-6"
259- stroke-width="2"
260269 stroke-linecap="round"
261270 stroke-linejoin="round"
271+ stroke-width="2"
262272 />
263273 </svg>
264274 </button>
@@ -272,41 +282,41 @@ const toggleOpen = () => {
272282 >
273283 <Draggable
274284 v-model="localList"
275- item-key="iid"
276- :disabled="!canEdit"
277- handle=".drag-handle2"
278285 :animation="180"
279- tag="div"
280- class="grid gap-4 lg:grid-cols-2 xl:grid-cols-3 mt-5"
281- ghost-class="ghosting"
286+ :disabled="!canEdit"
287+ :empty-insert-threshold="10"
288+ :fallback-on-body="true"
289+ :force-fallback="true"
290+ :prevent-on-filter="true"
282291 chosen-class="chosen"
292+ class="grid gap-4 lg:grid-cols-2 xl:grid-cols-3 mt-5"
283293 drag-class="dragging"
284- :prevent-on-filter="true"
285- :force-fallback="true"
286- :fallback-on-body="true"
287- :empty-insert-threshold="10"
288- @start="dragging = true"
294+ ghost-class="ghosting"
295+ handle=".drag-handle"
296+ item-key="iid"
297+ tag="div"
289298 @end="onEndCat"
299+ @start="dragging = true"
290300 >
291301 <template #item="{ element }">
292302 <LpCardItem
293- :lp="element"
303+ :buildDates="buildDates"
304+ :canAutoLaunch="canAutoLaunch"
294305 :canEdit="canEdit"
306+ :canExportPdf="canExportPdf"
307+ :canExportScorm="canExportScorm"
308+ :lp="element"
295309 :ringDash="ringDash"
296310 :ringValue="ringValue"
297- :canExportScorm="canExportScorm"
298- :canExportPdf="canExportPdf"
299- :canAutoLaunch="canAutoLaunch"
300- :buildDates="buildDates"
301- @toggle-auto-launch="$emit('toggle-auto-launch', element)"
302- @open="$emit('open', element)"
311+ @build="$emit('build', element)"
312+ @delete="$emit('delete', element)"
303313 @edit="$emit('edit', element)"
314+ @open="$emit('open', element)"
304315 @report="$emit('report', element)"
305316 @settings="$emit('settings', element)"
306- @build ="$emit('build ', element)"
317+ @toggle-auto-launch ="$emit('toggle-auto-launch ', element)"
307318 @toggle-visible="$emit('toggle-visible', element)"
308319 @toggle-publish="$emit('toggle-publish', element)"
309- @delete="$emit('delete', element)"
310320 @export-scorm="$emit('export-scorm', element)"
311321 @export-pdf="$emit('export-pdf', element)"
312322 />
0 commit comments