Add about page.

This commit is contained in:
eal 2017-10-24 20:24:14 +03:00
parent 91991e2ac1
commit 696bb91ede
5 changed files with 43 additions and 3 deletions

View File

@ -3,7 +3,7 @@
<nav class='container base01-background base04' @click="scrollToTop()">
<div class='inner-nav' :style="logoStyle">
<div class='item'>
<router-link :to="{ name: 'root'}">{{sitename}}</router-link>
<router-link :to="{ name: 'about' }">{{sitename}}</router-link>
</div>
<div class='item right'>
<user-finder></user-finder>

View File

@ -0,0 +1,27 @@
<template>
<div class="panel panel-default base00-background">
<div class="panel-heading base01-background base04">
About
</div>
<div class="panel-body">
<div class="container">
<div class="text-fields" v-html="abouttext">
</div>
</div>
</div>
</div>
</template>
<script>
export default {
computed: {
abouttext () { return this.$store.state.config.about }
}
}
</script>
<style lang="scss">
.text-fields {
margin: 0.4em;
}
</style>

View File

@ -10,7 +10,7 @@ const LoginForm = {
methods: {
submit () {
this.$store.dispatch('loginUser', this.user).then(
() => {},
() => { this.$router.push('/main/friends') },
(error) => {
this.authError = error
this.user.username = ''

View File

@ -12,6 +12,7 @@ import UserProfile from './components/user_profile/user_profile.vue'
import Settings from './components/settings/settings.vue'
import Registration from './components/registration/registration.vue'
import UserSettings from './components/user_settings/user_settings.vue'
import About from './components/about/about.vue'
import statusesModule from './modules/statuses.js'
import usersModule from './modules/users.js'
@ -55,7 +56,8 @@ const store = new Vuex.Store({
})
const routes = [
{ name: 'root', path: '/', redirect: '/main/all' },
{ name: 'root', path: '/', redirect: '/about' },
{ name: 'about', path: '/about', component: About },
{ path: '/main/all', component: PublicAndExternalTimeline },
{ path: '/main/public', component: PublicTimeline },
{ path: '/main/friends', component: FriendsTimeline },
@ -102,3 +104,9 @@ window.fetch('/static/terms-of-service.html')
.then((html) => {
store.dispatch('setOption', { name: 'tos', value: html })
})
window.fetch('/static/about.html')
.then((res) => res.text())
.then((html) => {
store.dispatch('setOption', { name: 'about', value: html })
})

5
static/about.html Normal file
View File

@ -0,0 +1,5 @@
<h2>about</h2>
<p>This is a placeholder About page.</p>
<p>Edit <code>"/static/about.html"</code> to make it fit the needs of your instance.</p>