@icvdeveloper/common-module 0.0.127 → 0.0.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +6 -6
  2. package/dist/module.json +1 -1
  3. package/dist/runtime/assets/svg/answer.svg +14 -14
  4. package/dist/runtime/assets/svg/avatar.svg +1 -1
  5. package/dist/runtime/assets/svg/bell-icon.svg +3 -3
  6. package/dist/runtime/assets/svg/checkmark-icon.svg +1 -1
  7. package/dist/runtime/assets/svg/close-icon.svg +1 -1
  8. package/dist/runtime/assets/svg/icon-avatar.svg +1 -1
  9. package/dist/runtime/assets/svg/icon-chevron.svg +4 -4
  10. package/dist/runtime/assets/svg/icon-circle-plus.svg +1 -1
  11. package/dist/runtime/assets/svg/icon-close.svg +1 -1
  12. package/dist/runtime/assets/svg/icon-info.svg +2 -2
  13. package/dist/runtime/assets/svg/icon-new-window.svg +11 -11
  14. package/dist/runtime/assets/svg/icon-offline.svg +3 -3
  15. package/dist/runtime/assets/svg/icon-online.svg +3 -3
  16. package/dist/runtime/assets/svg/icon-person.svg +2 -2
  17. package/dist/runtime/assets/svg/icon-play.svg +2 -2
  18. package/dist/runtime/assets/svg/icon-star-filled.svg +29 -29
  19. package/dist/runtime/assets/svg/icon-star.svg +24 -24
  20. package/dist/runtime/assets/svg/icon-video-chat.svg +14 -14
  21. package/dist/runtime/assets/svg/icon-website.svg +2 -2
  22. package/dist/runtime/assets/svg/icon-zoom.svg +10 -10
  23. package/dist/runtime/assets/svg/notification-icon.svg +32 -32
  24. package/dist/runtime/assets/svg/offline-icon.svg +1 -1
  25. package/dist/runtime/assets/svg/online-icon.svg +3 -3
  26. package/dist/runtime/assets/svg/peer2peer.svg +3 -3
  27. package/dist/runtime/assets/svg/phone.svg +1 -1
  28. package/dist/runtime/assets/svg/plus-icon.svg +1 -1
  29. package/dist/runtime/assets/svg/red-icon.svg +3 -3
  30. package/dist/runtime/assets/svg/reject.svg +14 -14
  31. package/dist/runtime/assets/svg/search-icon.svg +3 -3
  32. package/dist/runtime/components/affiliates/AffiliatePage.vue +329 -329
  33. package/dist/runtime/components/agenda/AgendaList.vue +259 -259
  34. package/dist/runtime/components/agenda/AgendaTabbed.vue +305 -305
  35. package/dist/runtime/components/agenda/components/AgendaListAccordion.vue +67 -67
  36. package/dist/runtime/components/agenda/components/Calendar.vue +67 -67
  37. package/dist/runtime/components/agenda/components/InfoLink.vue +56 -56
  38. package/dist/runtime/components/agenda/components/PlayIcon.vue +49 -49
  39. package/dist/runtime/components/agenda/components/PresentationLink.vue +137 -137
  40. package/dist/runtime/components/agenda/components/Sponsor.vue +132 -132
  41. package/dist/runtime/components/auth/LoginFullWidth.vue +78 -78
  42. package/dist/runtime/components/auth/PasswordReset.vue +60 -60
  43. package/dist/runtime/components/auth/Registration.vue +27 -27
  44. package/dist/runtime/components/auth/Ucc.vue +129 -129
  45. package/dist/runtime/components/core/Accordion.vue +97 -97
  46. package/dist/runtime/components/core/CountdownTimer.vue +336 -336
  47. package/dist/runtime/components/core/DynamicHtml.vue +1 -1
  48. package/dist/runtime/components/core/Modal.vue +111 -111
  49. package/dist/runtime/components/core/Navbar.vue +154 -154
  50. package/dist/runtime/components/core/SvgIcon.vue +157 -157
  51. package/dist/runtime/components/core/ZoomModal.vue +37 -37
  52. package/dist/runtime/components/events/EventHeader.vue +133 -133
  53. package/dist/runtime/components/events/ListEvents.vue +554 -554
  54. package/dist/runtime/components/forms/AlertBox.vue +21 -21
  55. package/dist/runtime/components/forms/ErrorField.vue +17 -17
  56. package/dist/runtime/components/forms/Message.vue +27 -27
  57. package/dist/runtime/components/forms/SearchInput.vue +38 -38
  58. package/dist/runtime/components/forms/SupportForm.vue +112 -112
  59. package/dist/runtime/components/forms/SwitchInput.vue +42 -42
  60. package/dist/runtime/components/forms/TextArea.vue +26 -26
  61. package/dist/runtime/components/forms/TextInput.vue +28 -28
  62. package/dist/runtime/components/layouts/Accordion.vue +78 -78
  63. package/dist/runtime/components/media/ArchivePlayerAndContentContainer.vue +160 -160
  64. package/dist/runtime/components/media/ArchiveVideoPlayer.vue +186 -186
  65. package/dist/runtime/components/media/PlayerAndContentContainer.vue +183 -183
  66. package/dist/runtime/components/media/WebcastVideoPlayer.vue +140 -140
  67. package/dist/runtime/components/media/components/AgendaPanel.vue +43 -43
  68. package/dist/runtime/components/media/components/ArchiveMediaContainer.vue +91 -91
  69. package/dist/runtime/components/media/components/CeCreditNotification.vue +95 -95
  70. package/dist/runtime/components/media/components/ContentAccordion.vue +63 -63
  71. package/dist/runtime/components/media/components/ContentArea.vue +158 -158
  72. package/dist/runtime/components/media/components/ContentTabs.vue +231 -231
  73. package/dist/runtime/components/media/components/DocumentsPanel.vue +31 -31
  74. package/dist/runtime/components/media/components/JsonApi.vue +31 -31
  75. package/dist/runtime/components/media/components/MediaContainer.vue +63 -63
  76. package/dist/runtime/components/media/components/OverviewPanel.vue +52 -52
  77. package/dist/runtime/components/media/components/PresentersPanel.vue +52 -52
  78. package/dist/runtime/components/media/components/SessionReporting.vue +102 -102
  79. package/dist/runtime/components/media/components/SponsorsPanel.vue +71 -71
  80. package/dist/runtime/components/media/components/WindowContent.vue +92 -92
  81. package/dist/runtime/components/media/components/WindowSlide.vue +72 -72
  82. package/dist/runtime/components/presenters/PresenterListing.vue +164 -164
  83. package/dist/runtime/components/presenters/PresenterModal.vue +223 -223
  84. package/dist/runtime/components/profile/Profile.vue +149 -149
  85. package/dist/runtime/components/profile/components/Sidebar.vue +27 -27
  86. package/dist/runtime/components/profile/components/SidebarNavItem.vue +39 -39
  87. package/dist/runtime/components/profile/tabs/Favorites.vue +21 -21
  88. package/dist/runtime/components/profile/tabs/GeneralInformation.vue +122 -122
  89. package/dist/runtime/components/profile/tabs/ProfileImage.vue +75 -75
  90. package/dist/runtime/components/support/FAQAccordion.vue +140 -140
  91. package/dist/runtime/composables/useApi.mjs +3 -1
  92. package/package.json +1 -1
@@ -1,556 +1,556 @@
1
- <script lang="ts" setup>
2
- import { ref, toRefs, computed } from "vue";
3
- import { storeToRefs } from "pinia";
4
- import { get } from "lodash-es";
5
- import { useRuntimeConfig } from "#app";
6
- import { useConferencesStore } from "../../store/conferences";
7
- import { useTemplateConfigsStore } from "../../store/templateConfigs";
8
- import { useConferenceHelpers } from "../../composables/useConferenceHelpers";
9
- import { useEvents } from "../../composables/useEvents";
10
- import { useClassBinding } from "../../composables/useClassBinding";
11
- import CommonSponsor from "../agenda/components/Sponsor.vue";
12
- import { Conference, ConferenceState } from "../../models/conference";
13
- import { Position } from "../../enums/general";
14
- import {
15
- listEventsClassObj,
16
- listEventsCompObj,
17
- countdownTimerClassObj,
18
- sponsorClassObj,
19
- } from "../../@types/components";
20
-
21
- interface Props {
22
- showSponsors?: boolean;
23
- showBrand?: boolean;
24
- showCountdown?: boolean;
25
- liveButton?: boolean;
26
- mediaButton?: boolean;
27
- registerButton?: boolean;
28
- loginButton?: boolean;
29
- viewInfoButton?: boolean;
30
- registerPathPrefix?: string;
31
- liveButtonOpensStream?: boolean;
32
- isUpcoming?: boolean;
33
- showEventImage?: boolean;
34
- sponsorPosition?: Position;
35
- borderPosition?: Position;
36
- countdownPosition?: Position;
37
- classObject?: listEventsClassObj;
38
- }
39
-
40
- const props = withDefaults(defineProps<Props>(), {
41
- showSponsors: true,
42
- showBrand: true,
43
- showCountdown: true,
44
- liveButton: false,
45
- mediaButton: true,
46
- registerButton: true,
47
- loginButton: true,
48
- viewInfoButton: true,
49
- registerPathPrefix: "",
50
- liveButtonOpensStream: true,
51
- isUpcoming: true,
52
- showEventImage: true,
53
- sponsorPosition: Position.RIGHT,
54
- borderPosition: Position.MIDDLE,
55
- countdownPosition: Position.BOTTOM,
56
- classObject: () => {
57
- return {
58
- components: ref<listEventsCompObj>({
59
- countdownTimer: ref<countdownTimerClassObj>({}),
60
- sponsor: ref<sponsorClassObj>({}),
61
- }),
62
- };
63
- },
64
- });
65
-
66
- const {
67
- showSponsors,
68
- showBrand,
69
- showCountdown,
70
- liveButton,
71
- mediaButton,
72
- registerButton,
73
- registerPathPrefix,
74
- loginButton,
75
- viewInfoButton,
76
- isUpcoming,
77
- showEventImage,
78
- sponsorPosition,
79
- borderPosition,
80
- countdownPosition,
81
- classObject,
82
- } = toRefs(props);
83
-
84
- // data
85
- const config = useRuntimeConfig();
86
- const { pastEvents, upcomingEvents } = storeToRefs(useConferencesStore());
87
-
88
- // methods
89
- const { globalConfigValue, pagesConfigValue } = storeToRefs(
90
- useTemplateConfigsStore()
91
- );
92
- const {
93
- showConferenceViewButton,
94
- getConferenceWebcastUrl,
95
- getConferenceWebcastButtonText,
96
- showViewArchiveButton,
97
- getViewArchiveUrl,
98
- getViewArchiveButtonText,
99
- getConferenceDisplayDate,
100
- getConferenceRegUrl,
101
- getConferenceRegText,
102
- showConferenceRegButton,
103
- } = useConferenceHelpers();
104
-
105
- const {
106
- isLoggedIn,
107
- loginModalVisible,
108
- conferenceToLoginTo,
109
- goEventPage,
110
- setConferenceToLoginTo,
111
- buttonClass,
112
- getSponsors,
113
- getBrand,
114
- isHomePage,
115
- } = useEvents();
116
-
117
- const { classBinding } = useClassBinding();
118
-
119
- const showViewButton = (_conference: Conference): boolean => {
120
- return isUpcoming.value
121
- ? showConferenceViewButton(_conference)
122
- : showViewArchiveButton(_conference);
123
- };
124
-
125
- const getVideoUrl = (_conference: Conference): string => {
126
- return isUpcoming.value
127
- ? getConferenceWebcastUrl(_conference)
128
- : getViewArchiveUrl(_conference);
129
- };
130
-
131
- const getVideoButtonText = (_conference: Conference): string => {
132
- return isUpcoming.value
133
- ? getConferenceWebcastButtonText(_conference)
134
- : getViewArchiveButtonText(_conference);
135
- };
136
-
137
- // computed
138
- const eventPathPrefix = computed(() => {
139
- return (get(config.public, "eventPathPrefix.length", 0) > 0) ? config.public.eventPathPrefix : null;
140
- });
141
-
142
- const eventType = computed((): Conference[] => {
143
- return isUpcoming.value ? upcomingEvents.value : pastEvents.value;
144
- });
145
-
146
- const showLoginButton = computed((): boolean => {
147
- const archivedHomepage: boolean =
148
- isUpcoming.value || (!isUpcoming.value && isHomePage.value);
149
- return (
150
- archivedHomepage &&
151
- loginButton.value &&
152
- !isLoggedIn.value &&
153
- !globalConfigValue.value("townhall_registration_enabled")
154
- );
155
- });
156
- </script>
157
-
158
- <template>
159
- <!-- list container -->
160
- <div class="flex w-full flex-col">
161
- <!-- list container -->
162
- <div
163
- :class="
164
- classBinding(classObject, 'listContainer', 'container flex-1 mx-auto')
165
- "
166
- >
167
- <!-- individual event container -->
168
- <div
169
- v-for="conference in eventType"
170
- :key="conference.id"
171
- :class="[
172
- {
173
- 'border-1 border-t border-color-accent-2':
174
- borderPosition === Position.TOP,
175
- },
176
- classBinding(
177
- classObject,
178
- 'eventContainer',
179
- 'flex flex-col items-center md:flex-row py-4'
180
- ),
181
- ]"
182
- >
183
- <!-- event image -->
184
- <div
185
- v-if="showEventImage"
186
- :class="
187
- classBinding(
188
- classObject,
189
- 'eventImageContainer',
190
- 'flex w-full md:w-1/3 pb-3 px-3 md:px-6 overflow-hidden'
191
- )
192
- "
193
- >
194
- <img
195
- :class="
196
- classBinding(
197
- classObject,
198
- 'eventImage',
199
- 'flex-1 self-center mx-auto w-full'
200
- )
201
- "
202
- :src="conference.photo"
203
- />
204
- </div>
205
- <!-- event details container -->
206
- <div
207
- :class="[
208
- { 'md:w-2/3': showEventImage },
209
- classBinding(
210
- classObject,
211
- 'eventContentContainer',
212
- 'flex flex-col justify-center text-center w-full md:pr-6 md:text-left md:justify-start md:items-start'
213
- ),
214
- ]"
215
- >
216
- <!-- event brand, name, date and countdown container -->
217
- <div
218
- :class="[
219
- {
220
- 'border-1 border-b border-color-accent-2 mb-6':
221
- borderPosition === Position.MIDDLE,
222
- },
223
- classBinding(
224
- classObject,
225
- 'eventDetailsContainer',
226
- 'w-full flex flex-col lg:flex-row'
227
- ),
228
- ]"
229
- >
230
- <!-- event details -->
231
- <div
232
- :class="classBinding(classObject, 'eventDetails', 'flex-grow')"
233
- >
234
- <template v-if="showBrand && getBrand(conference.affiliates)">
235
- <a
236
- :class="classBinding(classObject, 'eventBrandLink', '')"
237
- :href="getBrand(conference.affiliates).website"
238
- :target="(getBrand(conference.affiliates).website) ? '_blank' : null"
239
- >
240
- <h3
241
- :class="
242
- classBinding(
243
- classObject,
244
- 'eventBrand',
245
- 'text-base font-bold leading-tight tracking-wide mb-3'
246
- )
247
- "
248
- >
249
- {{ getBrand(conference.affiliates).name }}
250
- </h3>
251
- </a>
252
- </template>
253
- <nuxt-link
254
- :to="
255
- eventPathPrefix
256
- ? eventPathPrefix + conference.id
257
- : `/${isUpcoming ? 'upcoming-events' : 'past-events'}/${
258
- conference.id
259
- }`
260
- "
261
- class="no-underline"
262
- >
263
- <h2
264
- :class="
265
- classBinding(
266
- classObject,
267
- 'eventName',
268
- 'text-2xl lg:text-3xl font-medium mb-2 conf-name-alignment'
269
- )
270
- "
271
- >
272
- {{ conference.name }}
273
- </h2>
274
- </nuxt-link>
275
- <p
276
- :class="
277
- classBinding(
278
- classObject,
279
- 'eventDate',
280
- 'text-base leading-normal tracking-wide font-light uppercase md:text-md lg:text-lg'
281
- )
282
- "
283
- >
284
- {{ getConferenceDisplayDate(conference,true,false,false,true) }}
285
- </p>
286
- </div>
287
- <!-- countdown timer - top-aligned -->
288
- <div
289
- v-if="
290
- isUpcoming &&
291
- showCountdown &&
292
- countdownPosition === Position.TOP &&
293
- pagesConfigValue('main.countdown_timer')
294
- "
295
- :class="
296
- classBinding(
297
- classObject,
298
- 'countdownContainerTop',
299
- 'flex-auto flex items-center self-center mb-4 lg:mb-0'
300
- )
301
- "
302
- >
303
- <CommonCountdownTimer
304
- :date="conference.start_date"
305
- :is-compact="true"
306
- :class-object="classObject.components.countdownTimer"
307
- ></CommonCountdownTimer>
308
- </div>
309
- </div>
310
- <!-- event button, countdown timer, and sponsors container -->
311
- <div
312
- :class="
313
- classBinding(
314
- classObject,
315
- 'buttonCountdownSponsorsContainer',
316
- 'flex flex-col w-full'
317
- )
318
- "
319
- >
320
- <div
321
- :class="
322
- classBinding(
323
- classObject,
324
- 'buttonCountdownContainer',
325
- 'flex-1 flex flex-col justify-between xl:flex-row w-full'
326
- )
327
- "
328
- >
329
- <div
330
- :class="
331
- classBinding(
332
- classObject,
333
- 'buttonContainer',
334
- 'flex-auto mr-0 xl:mr-4'
335
- )
336
- "
337
- >
338
- <!-- live event button - if enabled, hide all other buttons if event is live -->
339
- <template
340
- v-if="liveButton && conference.state === ConferenceState.LIVE"
341
- >
342
- <!-- go to video -->
343
- <a
344
- v-if="liveButtonOpensStream"
345
- :href="getVideoUrl(conference)"
346
- :target="
347
- /^http/.test(!isUpcoming && getVideoUrl(conference))
348
- ? '_blank'
349
- : '_self'
350
- "
351
- >
352
- <button
353
- :class="
354
- classBinding(classObject, 'liveButtonItem', buttonClass)
355
- "
356
- >
357
- {{ getVideoButtonText(conference) }}
358
- </button>
359
- </a>
360
- <!-- go to event page -->
361
- <button
362
- v-else
363
- :class="
364
- classBinding(classObject, 'liveButtonItem', buttonClass)
365
- "
366
- @click="goEventPage(conference)"
367
- >
368
- {{ getVideoButtonText(conference) }}
369
- </button>
370
- </template>
371
-
372
- <template v-else>
373
- <!-- view info button -->
374
- <button
375
- v-if="viewInfoButton"
376
- :class="
377
- classBinding(classObject, 'buttonItem', buttonClass)
378
- "
379
- @click="goEventPage(conference)"
380
- >
381
- More Info
382
- </button>
383
- <!-- view live/preview archive button -->
384
- <a
385
- v-if="mediaButton && showViewButton(conference)"
386
- :href="getVideoUrl(conference)"
387
- :target="
388
- /^http/.test(!isUpcoming && getVideoUrl(conference))
389
- ? '_blank'
390
- : '_self'
391
- "
392
- >
393
- <button
394
- :class="
395
- classBinding(classObject, 'buttonItem', buttonClass)
396
- "
397
- >
398
- {{ getVideoButtonText(conference) }}
399
- </button>
400
- </a>
401
-
402
- <!-- login button -->
403
- <button
404
- v-if="showLoginButton"
405
- :class="
406
- classBinding(classObject, 'buttonItem', buttonClass)
407
- "
408
- @click="setConferenceToLoginTo(conference)"
409
- >
410
- Log In
411
- </button>
412
-
413
- <!-- register button -->
414
- <a
415
- v-if="registerButton && showConferenceRegButton(conference)"
416
- :href="getConferenceRegUrl(conference, registerPathPrefix)"
417
- :target="
418
- /^http/.test(getConferenceRegUrl(conference))
419
- ? '_blank'
420
- : '_self'
421
- "
422
- >
423
- <button
424
- :class="
425
- classBinding(classObject, 'buttonItem', buttonClass)
426
- "
427
- >
428
- {{ getConferenceRegText(conference) }}
429
- </button>
430
- </a>
431
- </template>
432
- </div>
433
- <!-- countdown timer - right-aligned -->
434
- <div
435
- v-if="
436
- isUpcoming &&
437
- showCountdown &&
438
- countdownPosition === Position.RIGHT &&
439
- pagesConfigValue('main.countdown_timer')
440
- "
441
- class="flex-auto md:flex mt-3 md:mt-2"
442
- :class="
443
- classBinding(
444
- classObject,
445
- 'countdownContainerRight',
446
- 'flex-auto flex items-center self-center mb-4 lg:mb-0'
447
- )
448
- "
449
- >
450
- <CommonCountdownTimer
451
- :date="conference.start_date"
452
- :is-compact="true"
453
- :class-object="classObject.components.countdownTimer"
454
- ></CommonCountdownTimer>
455
- </div>
456
- </div>
457
- <!-- countdown timer - bottom-aligned -->
458
- <div
459
- v-if="
460
- isUpcoming &&
461
- showCountdown &&
462
- countdownPosition === Position.BOTTOM &&
463
- pagesConfigValue('main.countdown_timer')
464
- "
465
- :class="
466
- classBinding(
467
- classObject,
468
- 'countdownContainerBottom',
469
- 'flex-auto md:flex my-3 md:my-2'
470
- )
471
- "
472
- >
473
- <CommonCountdownTimer
474
- :date="conference.start_date"
475
- :is-compact="true"
476
- :class-object="classObject.components.countdownTimer"
477
- ></CommonCountdownTimer>
478
- </div>
479
- <!-- sponsors container - bottom-aligned -->
480
- <div
481
- v-if="showSponsors && sponsorPosition === Position.BOTTOM"
482
- class=""
483
- :class="
484
- classBinding(
485
- classObject,
486
- 'sponsorsContainer',
487
- 'grid grid-cols-1 md:grid-cols-3 lg:grid-cols-5 gap-y-1.5 gap-x-3'
488
- )
489
- "
490
- >
491
- <!-- individual sponsor -->
492
- <template
493
- v-for="(affiliate, index) in getSponsors(conference.affiliates)"
494
- :key="index"
495
- >
496
- <h3
497
- v-if="index === 0"
498
- :class="
499
- classBinding(classObject, 'sponsoredByText', 'hidden')
500
- "
501
- >
502
- Sponsored by:
503
- </h3>
504
- <CommonSponsor
505
- v-if="affiliate.photo"
506
- :sponsor="affiliate"
507
- :class-object="classObject.components.sponsor"
508
- ></CommonSponsor>
509
- </template>
510
- </div>
511
- </div>
512
- </div>
513
- <!-- sponsors container - right-aligned -->
514
- <div
515
- v-if="showSponsors && sponsorPosition === Position.RIGHT"
516
- class="flex flex-col"
517
- >
518
- <!-- individual sponsor -->
519
- <template
520
- v-for="(affiliate, index) in getSponsors(conference.affiliates)"
521
- :key="index"
522
- >
523
- <h3
524
- v-if="index === 0"
525
- :class="classBinding(classObject, 'sponsoredByText', 'hidden')"
526
- >
527
- Sponsored by:
528
- </h3>
529
- <CommonSponsor
530
- v-if="affiliate.photo"
531
- :sponsor="affiliate"
532
- :class-object="classObject.components.sponsor"
533
- ></CommonSponsor>
534
- </template>
535
- </div>
536
- </div>
537
- </div>
538
- <!-- login modal -->
539
- <CommonModal
540
- :visible="loginModalVisible"
541
- :class="classObject.components.modal"
542
- @trigger="loginModalVisible = false"
543
- >
544
- <template #modal-body>
545
- <CommonLoginFullWidth
546
- :conference="conferenceToLoginTo"
547
- :class="classObject.components.login"
548
- />
549
- </template>
550
- </CommonModal>
551
- </div>
552
- </template>
553
-
1
+ <script lang="ts" setup>
2
+ import { ref, toRefs, computed } from "vue";
3
+ import { storeToRefs } from "pinia";
4
+ import { get } from "lodash-es";
5
+ import { useRuntimeConfig } from "#app";
6
+ import { useConferencesStore } from "../../store/conferences";
7
+ import { useTemplateConfigsStore } from "../../store/templateConfigs";
8
+ import { useConferenceHelpers } from "../../composables/useConferenceHelpers";
9
+ import { useEvents } from "../../composables/useEvents";
10
+ import { useClassBinding } from "../../composables/useClassBinding";
11
+ import CommonSponsor from "../agenda/components/Sponsor.vue";
12
+ import { Conference, ConferenceState } from "../../models/conference";
13
+ import { Position } from "../../enums/general";
14
+ import {
15
+ listEventsClassObj,
16
+ listEventsCompObj,
17
+ countdownTimerClassObj,
18
+ sponsorClassObj,
19
+ } from "../../@types/components";
20
+
21
+ interface Props {
22
+ showSponsors?: boolean;
23
+ showBrand?: boolean;
24
+ showCountdown?: boolean;
25
+ liveButton?: boolean;
26
+ mediaButton?: boolean;
27
+ registerButton?: boolean;
28
+ loginButton?: boolean;
29
+ viewInfoButton?: boolean;
30
+ registerPathPrefix?: string;
31
+ liveButtonOpensStream?: boolean;
32
+ isUpcoming?: boolean;
33
+ showEventImage?: boolean;
34
+ sponsorPosition?: Position;
35
+ borderPosition?: Position;
36
+ countdownPosition?: Position;
37
+ classObject?: listEventsClassObj;
38
+ }
39
+
40
+ const props = withDefaults(defineProps<Props>(), {
41
+ showSponsors: true,
42
+ showBrand: true,
43
+ showCountdown: true,
44
+ liveButton: false,
45
+ mediaButton: true,
46
+ registerButton: true,
47
+ loginButton: true,
48
+ viewInfoButton: true,
49
+ registerPathPrefix: "",
50
+ liveButtonOpensStream: true,
51
+ isUpcoming: true,
52
+ showEventImage: true,
53
+ sponsorPosition: Position.RIGHT,
54
+ borderPosition: Position.MIDDLE,
55
+ countdownPosition: Position.BOTTOM,
56
+ classObject: () => {
57
+ return {
58
+ components: ref<listEventsCompObj>({
59
+ countdownTimer: ref<countdownTimerClassObj>({}),
60
+ sponsor: ref<sponsorClassObj>({}),
61
+ }),
62
+ };
63
+ },
64
+ });
65
+
66
+ const {
67
+ showSponsors,
68
+ showBrand,
69
+ showCountdown,
70
+ liveButton,
71
+ mediaButton,
72
+ registerButton,
73
+ registerPathPrefix,
74
+ loginButton,
75
+ viewInfoButton,
76
+ isUpcoming,
77
+ showEventImage,
78
+ sponsorPosition,
79
+ borderPosition,
80
+ countdownPosition,
81
+ classObject,
82
+ } = toRefs(props);
83
+
84
+ // data
85
+ const config = useRuntimeConfig();
86
+ const { pastEvents, upcomingEvents } = storeToRefs(useConferencesStore());
87
+
88
+ // methods
89
+ const { globalConfigValue, pagesConfigValue } = storeToRefs(
90
+ useTemplateConfigsStore()
91
+ );
92
+ const {
93
+ showConferenceViewButton,
94
+ getConferenceWebcastUrl,
95
+ getConferenceWebcastButtonText,
96
+ showViewArchiveButton,
97
+ getViewArchiveUrl,
98
+ getViewArchiveButtonText,
99
+ getConferenceDisplayDate,
100
+ getConferenceRegUrl,
101
+ getConferenceRegText,
102
+ showConferenceRegButton,
103
+ } = useConferenceHelpers();
104
+
105
+ const {
106
+ isLoggedIn,
107
+ loginModalVisible,
108
+ conferenceToLoginTo,
109
+ goEventPage,
110
+ setConferenceToLoginTo,
111
+ buttonClass,
112
+ getSponsors,
113
+ getBrand,
114
+ isHomePage,
115
+ } = useEvents();
116
+
117
+ const { classBinding } = useClassBinding();
118
+
119
+ const showViewButton = (_conference: Conference): boolean => {
120
+ return isUpcoming.value
121
+ ? showConferenceViewButton(_conference)
122
+ : showViewArchiveButton(_conference);
123
+ };
124
+
125
+ const getVideoUrl = (_conference: Conference): string => {
126
+ return isUpcoming.value
127
+ ? getConferenceWebcastUrl(_conference)
128
+ : getViewArchiveUrl(_conference);
129
+ };
130
+
131
+ const getVideoButtonText = (_conference: Conference): string => {
132
+ return isUpcoming.value
133
+ ? getConferenceWebcastButtonText(_conference)
134
+ : getViewArchiveButtonText(_conference);
135
+ };
136
+
137
+ // computed
138
+ const eventPathPrefix = computed(() => {
139
+ return (get(config.public, "eventPathPrefix.length", 0) > 0) ? config.public.eventPathPrefix : null;
140
+ });
141
+
142
+ const eventType = computed((): Conference[] => {
143
+ return isUpcoming.value ? upcomingEvents.value : pastEvents.value;
144
+ });
145
+
146
+ const showLoginButton = computed((): boolean => {
147
+ const archivedHomepage: boolean =
148
+ isUpcoming.value || (!isUpcoming.value && isHomePage.value);
149
+ return (
150
+ archivedHomepage &&
151
+ loginButton.value &&
152
+ !isLoggedIn.value &&
153
+ !globalConfigValue.value("townhall_registration_enabled")
154
+ );
155
+ });
156
+ </script>
157
+
158
+ <template>
159
+ <!-- list container -->
160
+ <div class="flex w-full flex-col">
161
+ <!-- list container -->
162
+ <div
163
+ :class="
164
+ classBinding(classObject, 'listContainer', 'container flex-1 mx-auto')
165
+ "
166
+ >
167
+ <!-- individual event container -->
168
+ <div
169
+ v-for="conference in eventType"
170
+ :key="conference.id"
171
+ :class="[
172
+ {
173
+ 'border-1 border-t border-color-accent-2':
174
+ borderPosition === Position.TOP,
175
+ },
176
+ classBinding(
177
+ classObject,
178
+ 'eventContainer',
179
+ 'flex flex-col items-center md:flex-row py-4'
180
+ ),
181
+ ]"
182
+ >
183
+ <!-- event image -->
184
+ <div
185
+ v-if="showEventImage"
186
+ :class="
187
+ classBinding(
188
+ classObject,
189
+ 'eventImageContainer',
190
+ 'flex w-full md:w-1/3 pb-3 px-3 md:px-6 overflow-hidden'
191
+ )
192
+ "
193
+ >
194
+ <img
195
+ :class="
196
+ classBinding(
197
+ classObject,
198
+ 'eventImage',
199
+ 'flex-1 self-center mx-auto w-full'
200
+ )
201
+ "
202
+ :src="conference.photo"
203
+ />
204
+ </div>
205
+ <!-- event details container -->
206
+ <div
207
+ :class="[
208
+ { 'md:w-2/3': showEventImage },
209
+ classBinding(
210
+ classObject,
211
+ 'eventContentContainer',
212
+ 'flex flex-col justify-center text-center w-full md:pr-6 md:text-left md:justify-start md:items-start'
213
+ ),
214
+ ]"
215
+ >
216
+ <!-- event brand, name, date and countdown container -->
217
+ <div
218
+ :class="[
219
+ {
220
+ 'border-1 border-b border-color-accent-2 mb-6':
221
+ borderPosition === Position.MIDDLE,
222
+ },
223
+ classBinding(
224
+ classObject,
225
+ 'eventDetailsContainer',
226
+ 'w-full flex flex-col lg:flex-row'
227
+ ),
228
+ ]"
229
+ >
230
+ <!-- event details -->
231
+ <div
232
+ :class="classBinding(classObject, 'eventDetails', 'flex-grow')"
233
+ >
234
+ <template v-if="showBrand && getBrand(conference.affiliates)">
235
+ <a
236
+ :class="classBinding(classObject, 'eventBrandLink', '')"
237
+ :href="getBrand(conference.affiliates).website"
238
+ :target="(getBrand(conference.affiliates).website) ? '_blank' : null"
239
+ >
240
+ <h3
241
+ :class="
242
+ classBinding(
243
+ classObject,
244
+ 'eventBrand',
245
+ 'text-base font-bold leading-tight tracking-wide mb-3'
246
+ )
247
+ "
248
+ >
249
+ {{ getBrand(conference.affiliates).name }}
250
+ </h3>
251
+ </a>
252
+ </template>
253
+ <nuxt-link
254
+ :to="
255
+ eventPathPrefix
256
+ ? eventPathPrefix + conference.id
257
+ : `/${isUpcoming ? 'upcoming-events' : 'past-events'}/${
258
+ conference.id
259
+ }`
260
+ "
261
+ class="no-underline"
262
+ >
263
+ <h2
264
+ :class="
265
+ classBinding(
266
+ classObject,
267
+ 'eventName',
268
+ 'text-2xl lg:text-3xl font-medium mb-2 conf-name-alignment'
269
+ )
270
+ "
271
+ >
272
+ {{ conference.name }}
273
+ </h2>
274
+ </nuxt-link>
275
+ <p
276
+ :class="
277
+ classBinding(
278
+ classObject,
279
+ 'eventDate',
280
+ 'text-base leading-normal tracking-wide font-light uppercase md:text-md lg:text-lg'
281
+ )
282
+ "
283
+ >
284
+ {{ getConferenceDisplayDate(conference,true,false,false,true) }}
285
+ </p>
286
+ </div>
287
+ <!-- countdown timer - top-aligned -->
288
+ <div
289
+ v-if="
290
+ isUpcoming &&
291
+ showCountdown &&
292
+ countdownPosition === Position.TOP &&
293
+ pagesConfigValue('main.countdown_timer')
294
+ "
295
+ :class="
296
+ classBinding(
297
+ classObject,
298
+ 'countdownContainerTop',
299
+ 'flex-auto flex items-center self-center mb-4 lg:mb-0'
300
+ )
301
+ "
302
+ >
303
+ <CommonCountdownTimer
304
+ :date="conference.start_date"
305
+ :is-compact="true"
306
+ :class-object="classObject.components.countdownTimer"
307
+ ></CommonCountdownTimer>
308
+ </div>
309
+ </div>
310
+ <!-- event button, countdown timer, and sponsors container -->
311
+ <div
312
+ :class="
313
+ classBinding(
314
+ classObject,
315
+ 'buttonCountdownSponsorsContainer',
316
+ 'flex flex-col w-full'
317
+ )
318
+ "
319
+ >
320
+ <div
321
+ :class="
322
+ classBinding(
323
+ classObject,
324
+ 'buttonCountdownContainer',
325
+ 'flex-1 flex flex-col justify-between xl:flex-row w-full'
326
+ )
327
+ "
328
+ >
329
+ <div
330
+ :class="
331
+ classBinding(
332
+ classObject,
333
+ 'buttonContainer',
334
+ 'flex-auto mr-0 xl:mr-4'
335
+ )
336
+ "
337
+ >
338
+ <!-- live event button - if enabled, hide all other buttons if event is live -->
339
+ <template
340
+ v-if="liveButton && conference.state === ConferenceState.LIVE"
341
+ >
342
+ <!-- go to video -->
343
+ <a
344
+ v-if="liveButtonOpensStream"
345
+ :href="getVideoUrl(conference)"
346
+ :target="
347
+ /^http/.test(!isUpcoming && getVideoUrl(conference))
348
+ ? '_blank'
349
+ : '_self'
350
+ "
351
+ >
352
+ <button
353
+ :class="
354
+ classBinding(classObject, 'liveButtonItem', buttonClass)
355
+ "
356
+ >
357
+ {{ getVideoButtonText(conference) }}
358
+ </button>
359
+ </a>
360
+ <!-- go to event page -->
361
+ <button
362
+ v-else
363
+ :class="
364
+ classBinding(classObject, 'liveButtonItem', buttonClass)
365
+ "
366
+ @click="goEventPage(conference)"
367
+ >
368
+ {{ getVideoButtonText(conference) }}
369
+ </button>
370
+ </template>
371
+
372
+ <template v-else>
373
+ <!-- view info button -->
374
+ <button
375
+ v-if="viewInfoButton"
376
+ :class="
377
+ classBinding(classObject, 'buttonItem', buttonClass)
378
+ "
379
+ @click="goEventPage(conference)"
380
+ >
381
+ More Info
382
+ </button>
383
+ <!-- view live/preview archive button -->
384
+ <a
385
+ v-if="mediaButton && showViewButton(conference)"
386
+ :href="getVideoUrl(conference)"
387
+ :target="
388
+ /^http/.test(!isUpcoming && getVideoUrl(conference))
389
+ ? '_blank'
390
+ : '_self'
391
+ "
392
+ >
393
+ <button
394
+ :class="
395
+ classBinding(classObject, 'buttonItem', buttonClass)
396
+ "
397
+ >
398
+ {{ getVideoButtonText(conference) }}
399
+ </button>
400
+ </a>
401
+
402
+ <!-- login button -->
403
+ <button
404
+ v-if="showLoginButton"
405
+ :class="
406
+ classBinding(classObject, 'buttonItem', buttonClass)
407
+ "
408
+ @click="setConferenceToLoginTo(conference)"
409
+ >
410
+ Log In
411
+ </button>
412
+
413
+ <!-- register button -->
414
+ <a
415
+ v-if="registerButton && showConferenceRegButton(conference)"
416
+ :href="getConferenceRegUrl(conference, registerPathPrefix)"
417
+ :target="
418
+ /^http/.test(getConferenceRegUrl(conference))
419
+ ? '_blank'
420
+ : '_self'
421
+ "
422
+ >
423
+ <button
424
+ :class="
425
+ classBinding(classObject, 'buttonItem', buttonClass)
426
+ "
427
+ >
428
+ {{ getConferenceRegText(conference) }}
429
+ </button>
430
+ </a>
431
+ </template>
432
+ </div>
433
+ <!-- countdown timer - right-aligned -->
434
+ <div
435
+ v-if="
436
+ isUpcoming &&
437
+ showCountdown &&
438
+ countdownPosition === Position.RIGHT &&
439
+ pagesConfigValue('main.countdown_timer')
440
+ "
441
+ class="flex-auto md:flex mt-3 md:mt-2"
442
+ :class="
443
+ classBinding(
444
+ classObject,
445
+ 'countdownContainerRight',
446
+ 'flex-auto flex items-center self-center mb-4 lg:mb-0'
447
+ )
448
+ "
449
+ >
450
+ <CommonCountdownTimer
451
+ :date="conference.start_date"
452
+ :is-compact="true"
453
+ :class-object="classObject.components.countdownTimer"
454
+ ></CommonCountdownTimer>
455
+ </div>
456
+ </div>
457
+ <!-- countdown timer - bottom-aligned -->
458
+ <div
459
+ v-if="
460
+ isUpcoming &&
461
+ showCountdown &&
462
+ countdownPosition === Position.BOTTOM &&
463
+ pagesConfigValue('main.countdown_timer')
464
+ "
465
+ :class="
466
+ classBinding(
467
+ classObject,
468
+ 'countdownContainerBottom',
469
+ 'flex-auto md:flex my-3 md:my-2'
470
+ )
471
+ "
472
+ >
473
+ <CommonCountdownTimer
474
+ :date="conference.start_date"
475
+ :is-compact="true"
476
+ :class-object="classObject.components.countdownTimer"
477
+ ></CommonCountdownTimer>
478
+ </div>
479
+ <!-- sponsors container - bottom-aligned -->
480
+ <div
481
+ v-if="showSponsors && sponsorPosition === Position.BOTTOM"
482
+ class=""
483
+ :class="
484
+ classBinding(
485
+ classObject,
486
+ 'sponsorsContainer',
487
+ 'grid grid-cols-1 md:grid-cols-3 lg:grid-cols-5 gap-y-1.5 gap-x-3'
488
+ )
489
+ "
490
+ >
491
+ <!-- individual sponsor -->
492
+ <template
493
+ v-for="(affiliate, index) in getSponsors(conference.affiliates)"
494
+ :key="index"
495
+ >
496
+ <h3
497
+ v-if="index === 0"
498
+ :class="
499
+ classBinding(classObject, 'sponsoredByText', 'hidden')
500
+ "
501
+ >
502
+ Sponsored by:
503
+ </h3>
504
+ <CommonSponsor
505
+ v-if="affiliate.photo"
506
+ :sponsor="affiliate"
507
+ :class-object="classObject.components.sponsor"
508
+ ></CommonSponsor>
509
+ </template>
510
+ </div>
511
+ </div>
512
+ </div>
513
+ <!-- sponsors container - right-aligned -->
514
+ <div
515
+ v-if="showSponsors && sponsorPosition === Position.RIGHT"
516
+ class="flex flex-col"
517
+ >
518
+ <!-- individual sponsor -->
519
+ <template
520
+ v-for="(affiliate, index) in getSponsors(conference.affiliates)"
521
+ :key="index"
522
+ >
523
+ <h3
524
+ v-if="index === 0"
525
+ :class="classBinding(classObject, 'sponsoredByText', 'hidden')"
526
+ >
527
+ Sponsored by:
528
+ </h3>
529
+ <CommonSponsor
530
+ v-if="affiliate.photo"
531
+ :sponsor="affiliate"
532
+ :class-object="classObject.components.sponsor"
533
+ ></CommonSponsor>
534
+ </template>
535
+ </div>
536
+ </div>
537
+ </div>
538
+ <!-- login modal -->
539
+ <CommonModal
540
+ :visible="loginModalVisible"
541
+ :class="classObject.components.modal"
542
+ @trigger="loginModalVisible = false"
543
+ >
544
+ <template #modal-body>
545
+ <CommonLoginFullWidth
546
+ :conference="conferenceToLoginTo"
547
+ :class="classObject.components.login"
548
+ />
549
+ </template>
550
+ </CommonModal>
551
+ </div>
552
+ </template>
553
+
554
554
  <style scoped>
555
555
  .leading-tight {
556
556
  line-height: 1.25rem;
@@ -559,4 +559,4 @@ const showLoginButton = computed((): boolean => {
559
559
  .mr-4 {
560
560
  margin-right: 1rem;
561
561
  }
562
- </style>
562
+ </style>