|
6 | 6 | class="btn-secondary" |
7 | 7 | @click="openPanel" |
8 | 8 | > |
9 | | - {{ $t('event.details_button') }} <Settings class="h-4 w-4 shrink-0" /> |
| 9 | + {{ $t('event.details_button') }} <Info class="h-4 w-4 shrink-0" /> |
10 | 10 | </button> |
11 | 11 |
|
12 | 12 | <Teleport to="body"> |
|
29 | 29 | id="event-details-title" |
30 | 30 | class="flex items-center gap-2 text-lg font-semibold text-theme" |
31 | 31 | > |
32 | | - <Settings class="h-5 w-5 text-meshtastic" /> |
| 32 | + <Info class="h-5 w-5 text-meshtastic" /> |
33 | 33 | {{ $t('event.details_title') }} |
34 | 34 | </h3> |
35 | 35 | <button |
|
43 | 43 | </button> |
44 | 44 | </div> |
45 | 45 |
|
46 | | - <!-- Body: radio settings from the event branch's userPrefs.jsonc --> |
| 46 | + <!-- Body --> |
47 | 47 | <div class="flex-1 space-y-4 overflow-y-auto p-4"> |
48 | | - <!-- LoRa --> |
| 48 | + <!-- Event --> |
| 49 | + <div class="rounded-lg border border-theme bg-surface-primary p-3 text-sm"> |
| 50 | + <p class="mb-2 text-xs font-semibold uppercase tracking-wide text-theme-muted"> |
| 51 | + {{ $t('event.section_event') }} |
| 52 | + </p> |
| 53 | + <dl class="grid grid-cols-[auto,1fr] gap-x-3 gap-y-1"> |
| 54 | + <dt class="text-theme-muted"> |
| 55 | + {{ $t('event.label_name') }} |
| 56 | + </dt> |
| 57 | + <dd>{{ eventMode.eventName }}</dd> |
| 58 | + <template v-if="dateRange"> |
| 59 | + <dt class="text-theme-muted"> |
| 60 | + {{ $t('event.label_dates') }} |
| 61 | + </dt> |
| 62 | + <dd>{{ dateRange }}</dd> |
| 63 | + </template> |
| 64 | + <template v-if="edition?.location"> |
| 65 | + <dt class="text-theme-muted"> |
| 66 | + {{ $t('event.label_location') }} |
| 67 | + </dt> |
| 68 | + <dd>{{ edition.location }}</dd> |
| 69 | + </template> |
| 70 | + <template v-if="edition?.timeZone"> |
| 71 | + <dt class="text-theme-muted"> |
| 72 | + {{ $t('event.label_timezone') }} |
| 73 | + </dt> |
| 74 | + <dd>{{ edition.timeZone }}</dd> |
| 75 | + </template> |
| 76 | + </dl> |
| 77 | + <p |
| 78 | + v-if="edition?.welcomeMessage" |
| 79 | + class="mt-2 text-theme-muted" |
| 80 | + > |
| 81 | + {{ edition.welcomeMessage }} |
| 82 | + </p> |
| 83 | + </div> |
| 84 | + |
| 85 | + <!-- Firmware --> |
| 86 | + <div |
| 87 | + v-if="eventMode.firmware.title || firmwareVersion" |
| 88 | + class="rounded-lg border border-theme bg-surface-primary p-3 text-sm" |
| 89 | + > |
| 90 | + <p class="mb-2 text-xs font-semibold uppercase tracking-wide text-theme-muted"> |
| 91 | + {{ $t('event.section_firmware') }} |
| 92 | + </p> |
| 93 | + <dl class="grid grid-cols-[auto,1fr] gap-x-3 gap-y-1"> |
| 94 | + <template v-if="eventMode.firmware.title"> |
| 95 | + <dt class="text-theme-muted"> |
| 96 | + {{ $t('event.label_build') }} |
| 97 | + </dt> |
| 98 | + <dd>{{ eventMode.firmware.title }}</dd> |
| 99 | + </template> |
| 100 | + <template v-if="firmwareVersion"> |
| 101 | + <dt class="text-theme-muted"> |
| 102 | + {{ $t('event.label_version') }} |
| 103 | + </dt> |
| 104 | + <dd class="break-all font-mono text-theme-accent"> |
| 105 | + {{ firmwareVersion }} |
| 106 | + </dd> |
| 107 | + </template> |
| 108 | + </dl> |
| 109 | + </div> |
| 110 | + |
| 111 | + <!-- LoRa (from the event branch's userPrefs.jsonc) --> |
49 | 112 | <div |
50 | 113 | v-if="hasLora" |
51 | 114 | class="rounded-lg border border-theme bg-surface-primary p-3 text-sm" |
|
182 | 245 | </dl> |
183 | 246 | </div> |
184 | 247 |
|
185 | | - <!-- Fetch status + source link --> |
| 248 | + <!-- Settings fetch status + source link --> |
186 | 249 | <p |
187 | 250 | v-if="prefsState === 'loading'" |
188 | 251 | class="text-sm text-theme-muted" |
189 | 252 | > |
190 | 253 | {{ $t('event.settings_loading') }} |
191 | 254 | </p> |
192 | 255 | <p |
193 | | - v-else-if="prefsState === 'error' || !firmwareSlug" |
| 256 | + v-else-if="prefsState === 'error'" |
194 | 257 | class="text-sm text-theme-muted" |
195 | 258 | > |
196 | 259 | {{ $t('event.settings_unavailable') }} |
|
205 | 268 | {{ $t('event.view_userprefs') }} |
206 | 269 | <ExternalLink class="h-3.5 w-3.5 shrink-0" /> |
207 | 270 | </a> |
| 271 | + |
| 272 | + <!-- Links --> |
| 273 | + <div |
| 274 | + v-if="edition?.links?.length" |
| 275 | + class="rounded-lg border border-theme bg-surface-primary p-3 text-sm" |
| 276 | + > |
| 277 | + <p class="mb-2 text-xs font-semibold uppercase tracking-wide text-theme-muted"> |
| 278 | + {{ $t('event.section_links') }} |
| 279 | + </p> |
| 280 | + <ul class="space-y-1"> |
| 281 | + <li |
| 282 | + v-for="link in edition.links" |
| 283 | + :key="link.url" |
| 284 | + > |
| 285 | + <a |
| 286 | + :href="link.url" |
| 287 | + target="_blank" |
| 288 | + rel="noopener noreferrer" |
| 289 | + class="inline-flex items-center gap-1.5 text-meshtastic underline underline-offset-2" |
| 290 | + > |
| 291 | + {{ link.label }} |
| 292 | + <ExternalLink class="h-3.5 w-3.5 shrink-0" /> |
| 293 | + </a> |
| 294 | + </li> |
| 295 | + </ul> |
| 296 | + </div> |
208 | 297 | </div> |
209 | 298 | </div> |
210 | 299 | </div> |
|
216 | 305 | <script lang="ts" setup> |
217 | 306 | import { computed, nextTick, ref, watch } from 'vue' |
218 | 307 | import { onKeyStroke } from '@vueuse/core' |
219 | | -import { ExternalLink, Settings, X } from 'lucide-vue-next' |
| 308 | +import { ExternalLink, Info, X } from 'lucide-vue-next' |
| 309 | +import { useI18n } from 'vue-i18n' |
220 | 310 | import type { EventUserPrefs } from '~/utils/eventUserPrefs' |
221 | 311 | import { useSerialMonitorStore } from '~/stores/serialMonitorStore' |
222 | 312 |
|
223 | 313 | const { eventMode } = useEventMode() |
224 | 314 | const edition = useEventEdition() |
225 | 315 | const serialMonitorStore = useSerialMonitorStore() |
| 316 | +const { locale } = useI18n() |
226 | 317 |
|
227 | 318 | const open = ref(false) |
228 | 319 | const triggerButton = ref<HTMLButtonElement | null>(null) |
229 | 320 | const closeButton = ref<HTMLButtonElement | null>(null) |
230 | 321 |
|
| 322 | +const dateRange = computed(() => formatEventDateRange(edition.value?.eventStart, edition.value?.eventEnd, locale.value)) |
| 323 | +const firmwareVersion = computed(() => edition.value?.firmware?.version || eventMode.value.firmware.id) |
| 324 | +
|
231 | 325 | // Radio settings from the event branch's userPrefs.jsonc, fetched lazily on |
232 | 326 | // first open so non-event visitors and closed sheets cost nothing. |
233 | 327 | const prefs = ref<EventUserPrefs | null>(null) |
|
0 commit comments