|
1 | 1 | <template> |
2 | 2 | <q-layout view="lHh Lpr lFf"> |
3 | | - <q-header elevated class="bg-white" :class="$q.screen.gt.xs ? 'q-px-xl' : ''"> |
4 | | - <q-toolbar class="text-primary row items-stretch"> |
| 3 | + <q-header elevated class="bg-white"> |
| 4 | + <div class="col-12 bg-grey-3 text-black text-body2 text-center"> |
| 5 | + This repository is under review for potential modification in compliance with Administration |
| 6 | + directives. |
| 7 | + </div> |
| 8 | + <q-toolbar class="text-primary row items-stretch" :class="$q.screen.gt.sm ? 'q-px-xl' : ''"> |
5 | 9 | <q-btn |
6 | 10 | to="/" |
7 | 11 | class="q-py-md" |
|
11 | 15 | icon-right="img:ember-logo.png" |
12 | 16 | /> |
13 | 17 | <q-space /> |
14 | | - <q-tabs v-if="$q.screen.gt.xs" class="row items-stretch"> |
15 | | - <q-btn |
16 | | - v-for="tab in tabs" |
17 | | - :key="tab.name" |
18 | | - :label="tab.name" |
19 | | - :to="tab.route" |
20 | | - :href="tab.external ? tab.route : undefined" |
21 | | - :target="tab.external ? '_blank' : undefined" |
22 | | - flat |
23 | | - class="full-height" |
24 | | - > |
25 | | - <q-icon v-if="tab.external" class="q-ml-sm" size="xs" name="launch" /> |
26 | | - </q-btn> |
| 18 | + <!-- Large screens: display tabs acorss the top --> |
| 19 | + <q-tabs v-if="$q.screen.gt.sm" class="row items-stretch"> |
| 20 | + <div v-for="tab in tabs" :key="tab.name" class="full-height"> |
| 21 | + <q-route-tab |
| 22 | + :label="tab.name" |
| 23 | + :to="tab.external ? undefined : tab.route" |
| 24 | + :href="tab.external ? tab.route : undefined" |
| 25 | + :target="tab.external ? '_blank' : undefined" |
| 26 | + @mouseenter=" |
| 27 | + () => { |
| 28 | + if (tab.dropdown) tab.dropdown.show = true; |
| 29 | + } |
| 30 | + " |
| 31 | + flat |
| 32 | + class="full-height" |
| 33 | + > |
| 34 | + <q-icon v-if="tab.external" class="q-ml-sm" size="xs" name="launch" /> |
| 35 | + <q-menu |
| 36 | + v-if="tab.dropdown" |
| 37 | + v-model="tab.dropdown.show" |
| 38 | + fit |
| 39 | + auto-close |
| 40 | + anchor="bottom middle" |
| 41 | + self="top middle" |
| 42 | + @mouseleave=" |
| 43 | + () => { |
| 44 | + if (tab.dropdown) tab.dropdown.show = false; |
| 45 | + } |
| 46 | + " |
| 47 | + > |
| 48 | + <q-list> |
| 49 | + <q-item |
| 50 | + v-for="subtab in tab.dropdown.children" |
| 51 | + :key="subtab.name" |
| 52 | + :to="subtab.route" |
| 53 | + :href="subtab.external ? subtab.route : undefined" |
| 54 | + :target="subtab.external ? '_blank' : undefined" |
| 55 | + class="text-primary items-center" |
| 56 | + > |
| 57 | + {{ subtab.name }} |
| 58 | + </q-item> |
| 59 | + </q-list> |
| 60 | + </q-menu> |
| 61 | + </q-route-tab> |
| 62 | + </div> |
27 | 63 | </q-tabs> |
28 | | - <q-btn-dropdown v-if="$q.screen.lt.sm" auto-close stretch flat label="Menu"> |
| 64 | + <!-- Small Screens: display tabs in a menu dropdown --> |
| 65 | + <q-btn-dropdown v-if="$q.screen.lt.md" auto-close stretch flat label="Menu"> |
29 | 66 | <q-list> |
30 | 67 | <q-item |
31 | 68 | v-for="tab in tabs" |
32 | 69 | :key="tab.name" |
33 | | - :to="tab.route" |
| 70 | + :to="tab.external ? undefined : tab.route" |
| 71 | + :href="tab.external ? tab.route : undefined" |
| 72 | + @mouseenter=" |
| 73 | + () => { |
| 74 | + if (tab.dropdown) tab.dropdown.show = true; |
| 75 | + } |
| 76 | + " |
34 | 77 | clickable |
35 | | - class="toolbar-link" |
| 78 | + class="toolbar-link items-center" |
36 | 79 | > |
37 | | - <q-item-section>{{ tab.name }}</q-item-section> |
| 80 | + {{ tab.name }} |
| 81 | + <q-icon v-if="tab.external" class="q-ml-sm" size="xs" name="launch" /> |
| 82 | + <q-menu |
| 83 | + v-if="tab.dropdown" |
| 84 | + v-model="tab.dropdown.show" |
| 85 | + fit |
| 86 | + auto-close |
| 87 | + anchor="center left" |
| 88 | + self="center right" |
| 89 | + @mouseleave=" |
| 90 | + () => { |
| 91 | + if (tab.dropdown) tab.dropdown.show = false; |
| 92 | + } |
| 93 | + " |
| 94 | + > |
| 95 | + <q-list> |
| 96 | + <q-item |
| 97 | + v-for="subtab in tab.dropdown.children" |
| 98 | + :key="subtab.name" |
| 99 | + :to="subtab.route" |
| 100 | + :href="subtab.external ? subtab.route : undefined" |
| 101 | + :target="subtab.external ? '_blank' : undefined" |
| 102 | + class="text-primary items-center" |
| 103 | + > |
| 104 | + {{ subtab.name }} |
| 105 | + </q-item> |
| 106 | + </q-list> |
| 107 | + </q-menu> |
38 | 108 | </q-item> |
39 | 109 | </q-list> |
40 | 110 | </q-btn-dropdown> |
|
66 | 136 | </template> |
67 | 137 |
|
68 | 138 | <script setup lang="ts"> |
| 139 | +import { defaultTabs } from 'src/constants/mainLayout'; |
69 | 140 | import { Tab } from 'src/models/mainLayout'; |
| 141 | +import { ref } from 'vue'; |
70 | 142 |
|
71 | | -const tabs: Tab[] = [ |
72 | | - { name: 'Projects', route: '/projects' }, |
73 | | - { name: 'Data', route: 'https://dandi.emberarchive.org/', external: true }, |
74 | | - { name: 'Documentation', route: '/documentation' }, |
75 | | - { name: 'Getting Started', route: '/getting-started' }, |
76 | | - { name: 'Tools', route: '/tools' }, |
77 | | - { name: 'Metadata', route: '/metadata' }, |
78 | | - { name: 'About', route: '/about' }, |
79 | | -]; |
| 143 | +const tabs = ref<Tab[]>(defaultTabs); |
80 | 144 | </script> |
81 | 145 |
|
82 | | -<style> |
| 146 | +<style lang="scss"> |
83 | 147 | .q-icon > img { |
84 | 148 | width: auto; |
85 | 149 | } |
| 150 | +
|
| 151 | +.q-tab__content { |
| 152 | + flex-direction: row; |
| 153 | + flex-wrap: nowrap; |
| 154 | +} |
| 155 | +
|
| 156 | +.bg-primary-opacity-15 { |
| 157 | + background-color: rgba($primary, 0.15); |
| 158 | +} |
| 159 | +
|
| 160 | +.q-list > .q-item { |
| 161 | + font-size: 0.9rem; |
| 162 | +} |
86 | 163 | </style> |
0 commit comments