Add navigation to and from instrument overview
This commit is contained in:
parent
bd17543ec2
commit
dae832b98d
|
|
@ -1,16 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="instrument-teaser">
|
<router-link tag="div" :to="{name: 'instrument', params: {slug: slug}}" class="instrument-teaser">
|
||||||
<h3 class="instrument-teaser__title">{{title}}</h3>
|
<h3 class="instrument-teaser__title">{{title}}</h3>
|
||||||
<p class="instrument-teaser__text" v-html="teaser">
|
<p class="instrument-teaser__text" v-html="teaser">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import teaser from '@/helpers/teaser';
|
import teaser from '@/helpers/teaser';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['title', 'contents'],
|
props: ['title', 'contents', 'slug'],
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
teaser() {
|
teaser() {
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
padding: $medium-spacing;
|
padding: $medium-spacing;
|
||||||
@include widget-shadow;
|
@include widget-shadow;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
&__title {
|
&__title {
|
||||||
@include heading-3;
|
@include heading-3;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
<book-topic-navigation></book-topic-navigation>
|
<book-topic-navigation></book-topic-navigation>
|
||||||
</sub-navigation-item>
|
</sub-navigation-item>
|
||||||
<sub-navigation-item title="Instrument">
|
<sub-navigation-item title="Instrument">
|
||||||
<router-link tag="div" class="book-subnavigation__item" to="/basic-knowledge">Sprache und Kommunikation</router-link>
|
<router-link tag="div" class="book-subnavigation__item" to="/instruments/sprache-kommunikation">Sprache und Kommunikation</router-link>
|
||||||
<router-link tag="div" class="book-subnavigation__item" to="/basic-knowledge">Gesellschaft</router-link>
|
<router-link tag="div" class="book-subnavigation__item" to="/instruments/gesellschaft">Gesellschaft</router-link>
|
||||||
</sub-navigation-item>
|
</sub-navigation-item>
|
||||||
<sub-navigation-item title="News">
|
<sub-navigation-item title="News">
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,12 @@
|
||||||
<div class="instrument-overview">
|
<div class="instrument-overview">
|
||||||
<div class="instrument-overview__heading">
|
<div class="instrument-overview__heading">
|
||||||
<h1 class="instrument-overview__title">
|
<h1 class="instrument-overview__title">
|
||||||
Instrument:<br> Sprache und Kommunikation
|
Instrument:<br> {{instrumentType}}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="instrument-overview__list">
|
<div class="instrument-overview__list">
|
||||||
<instrument-teaser
|
<instrument-teaser
|
||||||
:title="instrument.title"
|
v-bind="instrument"
|
||||||
:contents="instrument.contents"
|
|
||||||
v-for="instrument in instruments"
|
v-for="instrument in instruments"
|
||||||
:key="instrument.id"
|
:key="instrument.id"
|
||||||
></instrument-teaser>
|
></instrument-teaser>
|
||||||
|
|
@ -25,11 +24,19 @@
|
||||||
InstrumentTeaser
|
InstrumentTeaser
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
instrumentType () {
|
||||||
|
return this.$route.params.slug === 'gesellschaft' ? 'Gesellschaft' : 'Sprache und Kommunikation';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
apollo: {
|
apollo: {
|
||||||
instruments: {
|
instruments: {
|
||||||
query: INSTRUMENTS_QUERY,
|
query: INSTRUMENTS_QUERY,
|
||||||
variables: {
|
variables() {
|
||||||
type: 'society'
|
return {
|
||||||
|
type: this.$route.params.slug === 'gesellschaft' ? 'society' : 'language_communication'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
manual: true,
|
manual: true,
|
||||||
result({data, loading, networkStatus}) {
|
result({data, loading, networkStatus}) {
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@
|
||||||
padding: $large-spacing;
|
padding: $large-spacing;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
margin-top: 17px;
|
||||||
|
|
||||||
&:empty {
|
&:empty {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue