some styling, topics/chapters are collapsed by default
This commit is contained in:
parent
558195d939
commit
2a58a7b523
6 changed files with 72 additions and 31 deletions
|
|
@ -209,14 +209,7 @@ section p {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
section .title {
|
|
||||||
display: none;
|
|
||||||
font-weight: bold;
|
|
||||||
position: sticky;
|
|
||||||
top: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media print {
|
@media print {
|
||||||
.title { display: none; }
|
/* .title { display: none; } */
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
50
front/src/components/Content/Chapter.vue
Normal file
50
front/src/components/Content/Chapter.vue
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
<template>
|
||||||
|
<div :class="[ 'body', topic.title ]">
|
||||||
|
<h3
|
||||||
|
@click="desiresContent = !desiresContent"
|
||||||
|
class="header"
|
||||||
|
>
|
||||||
|
<span class="expandToggle">{{ desiresContent ? '▼ ' : '► '}}</span>
|
||||||
|
<span>{{ topic.title }}</span>
|
||||||
|
</h3>
|
||||||
|
<div v-if="desiresContent">
|
||||||
|
<span
|
||||||
|
v-for="message in topic.messages"
|
||||||
|
:key="message.id"
|
||||||
|
>
|
||||||
|
<Message
|
||||||
|
:message="message"
|
||||||
|
/>
|
||||||
|
<span> </span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Message from './Message'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Chapter',
|
||||||
|
components: {
|
||||||
|
Message,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
desiresContent: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: [
|
||||||
|
'topic',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.header {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
@media print {
|
||||||
|
.title { display: none; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -1,36 +1,30 @@
|
||||||
<template>
|
<template>
|
||||||
<section :class="[ 'content', currentStream ]">
|
<section :class="[ 'content', currentStream ]">
|
||||||
<div
|
<h1 class="title">{{ currentStream }}</h1>
|
||||||
|
<Chapter
|
||||||
v-for="topic in sortedTopics"
|
v-for="topic in sortedTopics"
|
||||||
:key="topic.title"
|
:key="topic.title"
|
||||||
:class="[ 'body', topic.title ]"
|
:topic="topic"
|
||||||
>
|
/>
|
||||||
<h1>{{ topic.title }}</h1>
|
|
||||||
<span
|
|
||||||
v-for="message in topic.messages"
|
|
||||||
:key="message.id"
|
|
||||||
>
|
|
||||||
<Message
|
|
||||||
:message="message"
|
|
||||||
/>
|
|
||||||
<span> </span>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapState } from 'vuex'
|
import { mapGetters, mapState } from 'vuex'
|
||||||
import Message from './Message'
|
import Chapter from './Chapter.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Content',
|
name: 'Content',
|
||||||
components: {
|
components: {
|
||||||
Message,
|
Chapter,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
desiresContent: false,
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState([
|
...mapState([
|
||||||
'rules',
|
|
||||||
'currentStream'
|
'currentStream'
|
||||||
]),
|
]),
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
|
|
@ -47,7 +41,4 @@ export default {
|
||||||
max-width: 700px;
|
max-width: 700px;
|
||||||
background: unset;
|
background: unset;
|
||||||
}
|
}
|
||||||
@media print {
|
|
||||||
.title { display: none; }
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<section class="rules">
|
<section class="rules">
|
||||||
<p class="title">{{ $.type.name }}</p>
|
<!-- <p class="title">{{ $.type.name }}</p> -->
|
||||||
<Rule
|
<Rule
|
||||||
v-for="rule in rules"
|
v-for="rule in rules"
|
||||||
:key="rule.id"
|
:key="rule.id"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div :class="{ selected: selected }">
|
||||||
<p class="name">
|
<p class="name">
|
||||||
<router-link :to="stream.name">
|
<router-link :to="stream.name">
|
||||||
{{ stream.name }}
|
{{ stream.name }}
|
||||||
|
|
@ -16,15 +16,21 @@ export default {
|
||||||
'stream'
|
'stream'
|
||||||
],
|
],
|
||||||
computed: {
|
computed: {
|
||||||
|
selected() { return this.$store.state.currentStream == this.stream.name }
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
div {
|
div {
|
||||||
|
padding: 0.5em;
|
||||||
|
}
|
||||||
|
div .selected {
|
||||||
|
background: rgb(247, 146, 247);
|
||||||
}
|
}
|
||||||
div p {
|
div p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<section class="streams">
|
<section class="streams">
|
||||||
<p class="title">{{ $.type.name }}</p>
|
<!-- <p class="title">{{ $.type.name }}</p> -->
|
||||||
<Stream
|
<Stream
|
||||||
v-for="stream in streams"
|
v-for="stream in streams"
|
||||||
:key="stream.id"
|
:key="stream.id"
|
||||||
|
|
@ -29,6 +29,7 @@ export default {
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.streams {
|
.streams {
|
||||||
min-width: 10em;
|
min-width: 10em;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
@media print {
|
@media print {
|
||||||
.streams { display: none; }
|
.streams { display: none; }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue