-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #531 from matematikk-mooc/marius/DIT-33
Marius/dit 33
- Loading branch information
Showing
15 changed files
with
531 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<template> | ||
<div class="dropdown-container desktop-hide"> | ||
<button aria-label="Åpne nedtrekksmeny" @click="handleFocus" class="dropdown-toggle-button"> | ||
<Icon :name="iconType"/> | ||
</button> | ||
<ul class="dropdown-list" v-show="showMenu"> | ||
<li v-if="admin"><a @click="handleLinkClick" class="dropdown-item" :href="adminLink">Administrator <Icon name="chevron_right" size="22"/></a> </li> | ||
<li v-if="logged_in"><a @click="handleLinkClick" class="dropdown-item" :href="settingsLink">Innstillinger <Icon name="chevron_right" size="22"/></a> </li> | ||
<li v-if="!logged_in"><a class="dropdown-item" :href="loginLink"> Logg inn <Icon name="chevron_right" size="22"/></a></li> | ||
<li v-if="logged_in"><a class="dropdown-item" :href="logoutLink"> Logg ut <Icon name="chevron_right" size="22"/></a></li> | ||
</ul> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
import Icon from "../icon/Icon.vue"; | ||
const domain = window.location.origin; | ||
const loginLink = domain + "/login/canvas" | ||
const logoutLink = domain + "/logout" | ||
const settingsLink = domain + "/profile/settings" | ||
const adminLink = domain + "/accounts" | ||
const showMenu = ref(false); | ||
const props = defineProps({ | ||
iconType: String, | ||
backgroundColor: String, | ||
showMenu: Boolean, | ||
logged_in: Boolean, | ||
admin: Boolean, | ||
}); | ||
const handleFocus = () => { | ||
showMenu.value = !showMenu.value; | ||
}; | ||
const handleLinkClick = () => { | ||
showMenu.value = false; | ||
}; | ||
</script> | ||
|
||
<style scoped lang="scss"> | ||
@import "../../design/colors.scss"; | ||
.dropdown-toggle-button { | ||
height: 3.75rem; | ||
width: 3.75rem; | ||
border: none; | ||
padding: 0.125rem; | ||
z-index: 1020; | ||
background-color: v-bind(backgroundColor); | ||
color: $color-black; | ||
font-size: 2rem; | ||
border-radius: 0 !important; | ||
cursor: pointer; | ||
transition: all 0.2s ease; | ||
&:hover { | ||
background-color: #94CAAE; | ||
} | ||
&:focus { | ||
background-color: #7DBF9D; | ||
} | ||
} | ||
.dropdown-list { | ||
position: absolute; | ||
top: 0; | ||
right: 0; | ||
margin: unset !important; | ||
margin-top: 3.6875rem !important; | ||
width: 13.75rem; | ||
z-index: 2000; | ||
box-shadow: rgba(50, 50, 93, 0.25) 0rem .8125rem 1.6875rem -0.3125rem, rgba(0, 0, 0, 0.3) 0rem .5rem 1rem -0.5rem; | ||
transition: all 0.2s ease; | ||
.dropdown-item { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
height: 100%; | ||
padding: 1rem; | ||
background-color: $color-white ; | ||
color: black; | ||
font-size: .875rem; | ||
cursor: pointer; | ||
transition: all 0.2s ease; | ||
&:hover { | ||
background-color: #E3F2EB; | ||
font-weight:bold; | ||
text-decoration:none; | ||
} | ||
.material-icon { | ||
display:flex; | ||
color: #94CAAE; | ||
} | ||
} | ||
} | ||
// Hides the dropdown list when the focus is not within the dropdown or button | ||
div:not(:focus-within) ul { | ||
display: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,20 +12,27 @@ | |
<div class="main-content--header"> | ||
Kompetansepakker er levert av Utdanningsdirektoratet | ||
</div> | ||
|
||
<div class="page-footer--link-container"> | ||
<PageFooterLink :url="'https://kompetanseudirno.azureedge.net/udirdesign/omkompetanseudirno.html'"><template v-slot:footerlink>Om kompetansepakker</template></PageFooterLink> | ||
<div class="page-footer--divider"></div> | ||
<div class="page-footer--divider mobile-hide"></div> | ||
<PageFooterLink :url="'mailto:[email protected]'"><template v-slot:footerlink>Kontakt</template></PageFooterLink> | ||
<div class="page-footer--divider"></div> | ||
<PageFooterLink :url="'https://kompetanseudirno.azureedge.net/udirdesign/privacypolicy.html?v=1_0'"><template v-slot:footerlink>Personvernerklæring</template></PageFooterLink> | ||
<div class="page-footer--divider"></div> | ||
<span class="page-footer--accessibility-declaration"> | ||
<div class="page-footer--divider mobile-hide"></div> | ||
<PageFooterLink :url="'https://kompetanseudirno.azureedge.net/udirdesign/privacypolicy.html?v=1_0'"><template v-slot:footerlink>Personvernerklæring</template></PageFooterLink> | ||
<div class="page-footer--divider mobile-hide"></div> | ||
<span class="mobile-hide"> | ||
<span class="page-footer--accessibility-declaration mobile-accessibility-container "> | ||
Tilgjengelighetserklæring på | ||
</span> | ||
<PageFooterLink aria-label="Tilgjengelighetserklæring på bokmål" :type="'open-in-new'" :url="'https://uustatus.no/nb/erklaringer/publisert/2796ebc6-161f-4dc9-9429-70d7dd136431'"><template v-slot:footerlink>Bokmål</template></PageFooterLink> | ||
<PageFooterLink aria-label="Tilgjengelighetserklæring på nynorsk" :type="'open-in-new'" :url="'https://uustatus.no/nn/erklaringer/publisert/2796ebc6-161f-4dc9-9429-70d7dd136431'"><template v-slot:footerlink>Nynorsk</template></PageFooterLink> | ||
</span> | ||
</div> | ||
<div class="mobile-accessibility-container page-footer--link-container desktop-hide"> | ||
Tilgjengelighetserklæring på | ||
<span class="mobile-accessibility-links"> | ||
<PageFooterLink aria-label="Tilgjengelighetserklæring på bokmål" :type="'open-in-new'" :url="'https://uustatus.no/nb/erklaringer/publisert/2796ebc6-161f-4dc9-9429-70d7dd136431'"><template v-slot:footerlink>Bokmål</template></PageFooterLink> | ||
<PageFooterLink aria-label="Tilgjengelighetserklæring på nynorsk" :type="'open-in-new'" :url="'https://uustatus.no/nn/erklaringer/publisert/2796ebc6-161f-4dc9-9429-70d7dd136431'"><template v-slot:footerlink>Nynorsk</template></PageFooterLink> | ||
</span> | ||
|
||
<PageFooterLink aria-label="Tilgjengelighetserklæring på bokmål" :type="'open-in-new'" :url="'https://uustatus.no/nb/erklaringer/publisert/2796ebc6-161f-4dc9-9429-70d7dd136431'"><template v-slot:footerlink>Bokmål</template></PageFooterLink> | ||
<PageFooterLink aria-label="Tilgjengelighetserklæring på nynorsk" :type="'open-in-new'" :url="'https://uustatus.no/nn/erklaringer/publisert/2796ebc6-161f-4dc9-9429-70d7dd136431'"><template v-slot:footerlink>Nynorsk</template></PageFooterLink> | ||
</div> | ||
</div> | ||
</div> | ||
|
@@ -38,8 +45,8 @@ import License from './License.vue' | |
const server = SERVER; | ||
const { hasLicense } = defineProps(['hasLicense']); | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '../../design/colors.scss'; | ||
|
@@ -107,5 +114,8 @@ const { hasLicense } = defineProps(['hasLicense']); | |
margin: 0 1.5rem -0.25rem 1.5rem; | ||
border-right: 0.0625rem solid $color-white; | ||
} | ||
.page-footer--link { | ||
text-underline-offset: 2px; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.