summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-10-19 11:10:49 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-10-19 11:10:49 +0900
commitf14c372f5e051c4d1520776a8d306bf673900477 (patch)
treee935cb13a6d81b139764e0aae998ab020c52175e /src
parent10.23.1 (diff)
downloadsharkey-f14c372f5e051c4d1520776a8d306bf673900477.tar.gz
sharkey-f14c372f5e051c4d1520776a8d306bf673900477.tar.bz2
sharkey-f14c372f5e051c4d1520776a8d306bf673900477.zip
Resolve #2719
Diffstat (limited to 'src')
-rw-r--r--src/client/app/desktop/script.ts2
-rw-r--r--src/client/app/desktop/views/components/settings.vue8
-rw-r--r--src/client/app/desktop/views/components/ui.header.nav.vue28
-rw-r--r--src/client/app/desktop/views/components/ui.sidebar.vue22
-rw-r--r--src/client/app/desktop/views/pages/index.vue11
-rw-r--r--src/client/app/store.ts3
6 files changed, 54 insertions, 20 deletions
diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts
index 3c9003cbe7..6b81a5aa77 100644
--- a/src/client/app/desktop/script.ts
+++ b/src/client/app/desktop/script.ts
@@ -21,6 +21,7 @@ import updateAvatar from './api/update-avatar';
import updateBanner from './api/update-banner';
import MkIndex from './views/pages/index.vue';
+import MkHome from './views/pages/home.vue';
import MkDeck from './views/pages/deck/deck.vue';
import MkAdmin from './views/pages/admin/admin.vue';
import MkStats from './views/pages/stats/stats.vue';
@@ -54,6 +55,7 @@ init(async (launch) => {
mode: 'history',
routes: [
{ path: '/', name: 'index', component: MkIndex },
+ { path: '/home', name: 'home', component: MkHome },
{ path: '/deck', name: 'deck', component: MkDeck },
{ path: '/admin', name: 'admin', component: MkAdmin },
{ path: '/stats', name: 'stats', component: MkStats },
diff --git a/src/client/app/desktop/views/components/settings.vue b/src/client/app/desktop/views/components/settings.vue
index cd91c1461a..3e64ebf59f 100644
--- a/src/client/app/desktop/views/components/settings.vue
+++ b/src/client/app/desktop/views/components/settings.vue
@@ -98,6 +98,9 @@
<ui-radio v-model="navbar" value="right">%i18n:@navbar-position-right%</ui-radio>
</section>
<section>
+ <ui-switch v-model="deckDefault">%i18n:@deck-default%</ui-switch>
+ </section>
+ <section>
<ui-switch v-model="darkmode">%i18n:@dark-mode%</ui-switch>
<ui-switch v-model="useShadow">%i18n:@use-shadow%</ui-switch>
<ui-switch v-model="roundedCorners">%i18n:@rounded-corners%</ui-switch>
@@ -366,6 +369,11 @@ export default Vue.extend({
set(value) { this.$store.commit('device/set', { key: 'deckColumnAlign', value }); }
},
+ deckDefault: {
+ get() { return this.$store.state.device.deckDefault; },
+ set(value) { this.$store.commit('device/set', { key: 'deckDefault', value }); }
+ },
+
enableSounds: {
get() { return this.$store.state.device.enableSounds; },
set(value) { this.$store.commit('device/set', { key: 'enableSounds', value }); }
diff --git a/src/client/app/desktop/views/components/ui.header.nav.vue b/src/client/app/desktop/views/components/ui.header.nav.vue
index 122570a696..3acc25c0dd 100644
--- a/src/client/app/desktop/views/components/ui.header.nav.vue
+++ b/src/client/app/desktop/views/components/ui.header.nav.vue
@@ -2,18 +2,22 @@
<div class="nav">
<ul>
<template v-if="$store.getters.isSignedIn">
- <li class="home" :class="{ active: $route.name == 'index' }" @click="goToTop">
- <router-link to="/">
- %fa:home%
- <p>%i18n:@home%</p>
- </router-link>
- </li>
- <li class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop">
- <router-link to="/deck">
- %fa:columns%
- <p>%i18n:@deck%</p>
- </router-link>
- </li>
+ <template v-if="$store.state.device.deckDefault">
+ <li class="deck" :class="{ active: $route.name == 'deck' || $route.name == 'index' }" @click="goToTop">
+ <router-link to="/">%fa:columns%<p>%i18n:@deck%</p></router-link>
+ </li>
+ <li class="home" :class="{ active: $route.name == 'home' }" @click="goToTop">
+ <router-link to="/home">%fa:home%<p>%i18n:@home%</p></router-link>
+ </li>
+ </template>
+ <template v-else>
+ <li class="home" :class="{ active: $route.name == 'home' || $route.name == 'index' }" @click="goToTop">
+ <router-link to="/">%fa:home%<p>%i18n:@home%</p></router-link>
+ </li>
+ <li class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop">
+ <router-link to="/deck">%fa:columns%<p>%i18n:@deck%</p></router-link>
+ </li>
+ </template>
<li class="messaging">
<a @click="messaging">
%fa:comments%
diff --git a/src/client/app/desktop/views/components/ui.sidebar.vue b/src/client/app/desktop/views/components/ui.sidebar.vue
index 716d3b0e59..36b5b3958b 100644
--- a/src/client/app/desktop/views/components/ui.sidebar.vue
+++ b/src/client/app/desktop/views/components/ui.sidebar.vue
@@ -6,12 +6,22 @@
</div>
<div class="nav" v-if="$store.getters.isSignedIn">
- <div class="home" :class="{ active: $route.name == 'index' }" @click="goToTop">
- <router-link to="/">%fa:home%</router-link>
- </div>
- <div class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop">
- <router-link to="/deck">%fa:columns%</router-link>
- </div>
+ <template v-if="$store.state.device.deckDefault">
+ <div class="deck" :class="{ active: $route.name == 'deck' || $route.name == 'index' }" @click="goToTop">
+ <router-link to="/">%fa:columns%</router-link>
+ </div>
+ <div class="home" :class="{ active: $route.name == 'home' }" @click="goToTop">
+ <router-link to="/home">%fa:home%</router-link>
+ </div>
+ </template>
+ <template v-else>
+ <div class="home" :class="{ active: $route.name == 'home' || $route.name == 'index' }" @click="goToTop">
+ <router-link to="/">%fa:home%</router-link>
+ </div>
+ <div class="deck" :class="{ active: $route.name == 'deck' }" @click="goToTop">
+ <router-link to="/deck">%fa:columns%</router-link>
+ </div>
+ </template>
<div class="messaging">
<a @click="messaging">%fa:comments%<template v-if="hasUnreadMessagingMessage">%fa:circle%</template></a>
</div>
diff --git a/src/client/app/desktop/views/pages/index.vue b/src/client/app/desktop/views/pages/index.vue
index 5d11fc5423..c531e00e4f 100644
--- a/src/client/app/desktop/views/pages/index.vue
+++ b/src/client/app/desktop/views/pages/index.vue
@@ -1,16 +1,25 @@
<template>
-<component :is="$store.getters.isSignedIn ? 'home' : 'welcome'"></component>
+<component :is="page"></component>
</template>
<script lang="ts">
import Vue from 'vue';
import Home from './home.vue';
import Welcome from './welcome.vue';
+import Deck from './deck/deck.vue';
export default Vue.extend({
components: {
Home,
+ Deck,
Welcome
+ },
+
+ computed: {
+ page(): string {
+ if (!this.$store.getters.isSignedIn) return 'welcome';
+ return this.$store.state.device.deckDefault ? 'deck' : 'home';
+ }
}
});
</script>
diff --git a/src/client/app/store.ts b/src/client/app/store.ts
index ac6de74248..160e62fa4c 100644
--- a/src/client/app/store.ts
+++ b/src/client/app/store.ts
@@ -60,7 +60,8 @@ const defaultDeviceSettings = {
navbar: 'top',
deckColumnAlign: 'center',
mobileNotificationPosition: 'bottom',
- deckTemporaryColumn: null
+ deckTemporaryColumn: null,
+ deckDefault: false
};
export default (os: MiOS) => new Vuex.Store({