From 696bb91edeeea0fd15e94f9a9e7a91d9d4158ff3 Mon Sep 17 00:00:00 2001 From: eal <eal@waifu.club> Date: Tue, 24 Oct 2017 20:24:14 +0300 Subject: [PATCH] Add about page. --- src/App.vue | 2 +- src/components/about/about.vue | 27 +++++++++++++++++++++++++ src/components/login_form/login_form.js | 2 +- src/main.js | 10 ++++++++- static/about.html | 5 +++++ 5 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 src/components/about/about.vue create mode 100644 static/about.html diff --git a/src/App.vue b/src/App.vue index 48cf9ea..de950e9 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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> diff --git a/src/components/about/about.vue b/src/components/about/about.vue new file mode 100644 index 0000000..fb39491 --- /dev/null +++ b/src/components/about/about.vue @@ -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> diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js index a117b76..6b544e7 100644 --- a/src/components/login_form/login_form.js +++ b/src/components/login_form/login_form.js @@ -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 = '' diff --git a/src/main.js b/src/main.js index d1f99fa..84b046f 100644 --- a/src/main.js +++ b/src/main.js @@ -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 }) + }) diff --git a/static/about.html b/static/about.html new file mode 100644 index 0000000..8b263d7 --- /dev/null +++ b/static/about.html @@ -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> -- GitLab