Update styling

This commit is contained in:
Ramon Wenger 2020-06-04 13:03:25 +02:00
parent 9fedebd42c
commit 1e944f3c1b
6 changed files with 42 additions and 29 deletions

View File

@ -40,12 +40,6 @@
CurrentClass, CurrentClass,
Hamburger Hamburger
}, },
computed: {
showSubnavigation() {
return this.$route.meta.subnavigation;
}
},
} }
</script> </script>
@ -68,6 +62,8 @@
grid-template-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr;
border-bottom: 1px solid $color-silver;
@include desktop { @include desktop {
grid-template-columns: 50px 1fr 200px; grid-template-columns: 50px 1fr 200px;
grid-template-rows: 50px; grid-template-rows: 50px;

View File

@ -5,6 +5,7 @@
:class="{'book-topics__topic--active': topic.active, 'book-subnavigation__item--mobile': mobile}" :class="{'book-topics__topic--active': topic.active, 'book-subnavigation__item--mobile': mobile}"
:key="topic.id" :key="topic.id"
tag="div" tag="div"
active-class="book-subnavigation__item--active"
class="book-topics__topic book-subnavigation__item" class="book-topics__topic book-subnavigation__item"
v-for="topic in topics" v-for="topic in topics"
@click.native="closeSidebar('navigation')"> @click.native="closeSidebar('navigation')">

View File

@ -0,0 +1,14 @@
<template>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100"
class="chevron">
<path d="M74.07,50,30.93,93.14A2.93,2.93,0,0,1,26.79,89l39-39-39-39a2.93,2.93,0,0,1,4.15-4.15Z"/>
</svg>
</template>
<style scoped lang="scss">
.chevron {
transform: rotate(180deg);
}
</style>

View File

@ -2,7 +2,7 @@
<svg <svg
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 100 100" viewBox="0 0 100 100"
id="shape"> class="chevron">
<path d="M74.07,50,30.93,93.14A2.93,2.93,0,0,1,26.79,89l39-39-39-39a2.93,2.93,0,0,1,4.15-4.15Z"/> <path d="M74.07,50,30.93,93.14A2.93,2.93,0,0,1,26.79,89l39-39-39-39a2.93,2.93,0,0,1,4.15-4.15Z"/>
</svg> </svg>
</template> </template>

View File

@ -1,22 +1,12 @@
<template> <template>
<nav <nav
class="module-navigation sub-navigation" class="module-navigation sub-navigation">
v-if="canManageContent"> <router-link
<div class="sub-navigation-item"> :to="{name: 'topic', params: {topicSlug: module.topic.slug}}"
<router-link class="sub-navigation-item">
:to="moduleContentLink" <chevron-left class="sub-navigation-item__icon" />
class="sub-navigation-item__title">Modul</router-link> Thema: {{ module.topic.title }}
</div> </router-link>
<sub-navigation-item title="Ergebnisse">
<router-link
:to="submissionsLink(assignment)"
:key="assignment.id"
class="module-navigation__anchor sub-navigation-item__link"
exact-active-class="module-navigation__anchor--active"
v-for="assignment in assignments"
>{{ assignment.value.assignment }}
</router-link>
</sub-navigation-item>
<div <div
class="module-navigation__module-content" class="module-navigation__module-content"
v-if="false"> <!-- Do not display this for now, might be used later again though --> v-if="false"> <!-- Do not display this for now, might be used later again though -->
@ -51,7 +41,10 @@
</div> </div>
</div> </div>
<div class="module-navigation__toggle-menu"> <div
class="module-navigation__toggle-menu"
v-if="canManageContent"
>
<toggle-editing v-if="onModulePage"/> <toggle-editing v-if="onModulePage"/>
<toggle-solutions-for-module <toggle-solutions-for-module
:slug="module.slug" :slug="module.slug"
@ -71,6 +64,7 @@
import SubNavigationItem from '@/components/book-navigation/SubNavigationItem'; import SubNavigationItem from '@/components/book-navigation/SubNavigationItem';
import ToggleSolutionsForModule from '@/components/toggle-menu/ToggleSolutionsForModule'; import ToggleSolutionsForModule from '@/components/toggle-menu/ToggleSolutionsForModule';
import ToggleEditing from '@/components/toggle-menu/ToggleEditing'; import ToggleEditing from '@/components/toggle-menu/ToggleEditing';
import ChevronLeft from '@/components/icons/ChevronLeft';
export default { export default {
apollo: { apollo: {
@ -83,13 +77,15 @@
components: { components: {
SubNavigationItem, SubNavigationItem,
ToggleSolutionsForModule, ToggleSolutionsForModule,
ToggleEditing ToggleEditing,
ChevronLeft
}, },
data() { data() {
return { return {
module: { module: {
assignments: [] assignments: [],
topic: {}
}, },
me: { me: {
permissions: [] permissions: []
@ -145,8 +141,8 @@
return assignments; return assignments;
}, },
concatAssignments(foundAssignments, node) { concatAssignments(foundAssignments, node) {
let foundAssignment = this.findAssignment(node); let foundAssignment = this.findAssignment(node);
return foundAssignment ? [...foundAssignments, ...foundAssignment] : foundAssignments; return foundAssignment ? [...foundAssignments, ...foundAssignment] : foundAssignments;
}, },
findAssignment(node) { findAssignment(node) {
if (node.type && node.type === 'assignment') { if (node.type && node.type === 'assignment') {
@ -201,11 +197,13 @@
font-size: 1.0625rem; font-size: 1.0625rem;
cursor: pointer; cursor: pointer;
} }
&__anchors { &__anchors {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 16px 24px 0; padding: 16px 24px 0;
} }
&__anchor { &__anchor {
@include module-navigation-typography; @include module-navigation-typography;
font-size: 0.875rem; font-size: 0.875rem;

View File

@ -7,6 +7,10 @@ fragment ModuleParts on ModuleNode {
slug slug
heroImage heroImage
solutionsEnabled solutionsEnabled
topic {
slug
title
}
bookmark { bookmark {
note { note {
id id