From 62465342cbda1dfd51dff68fe8e1b4f9d2fcffb4 Mon Sep 17 00:00:00 2001 From: Bat <baptiste@gelez.xyz> Date: Fri, 30 Mar 2018 22:58:16 +0100 Subject: [PATCH] Page title binding Fix #1 --- front/src/components/About.vue | 2 +- front/src/components/Home.vue | 8 +++----- front/src/components/PageNotFound.vue | 2 +- front/src/components/auth/Login.vue | 2 +- front/src/components/auth/Logout.vue | 2 +- front/src/components/auth/Profile.vue | 2 +- front/src/components/auth/Settings.vue | 2 +- front/src/components/auth/Signup.vue | 2 +- front/src/components/favorites/List.vue | 2 +- front/src/components/library/Album.vue | 4 ++-- front/src/components/library/Artist.vue | 4 ++-- front/src/components/library/Artists.vue | 2 +- front/src/components/library/Home.vue | 2 +- front/src/components/library/Radios.vue | 2 +- front/src/components/library/Track.vue | 4 ++-- front/src/components/library/import/BatchDetail.vue | 2 +- front/src/components/library/import/BatchList.vue | 2 +- front/src/components/library/import/Main.vue | 2 +- front/src/components/library/radios/Builder.vue | 2 +- front/src/components/requests/RequestsList.vue | 2 +- front/src/main.js | 4 ++++ front/src/views/instance/Timeline.vue | 2 +- front/src/views/playlists/Detail.vue | 4 ++-- front/src/views/playlists/List.vue | 2 +- 24 files changed, 33 insertions(+), 31 deletions(-) diff --git a/front/src/components/About.vue b/front/src/components/About.vue index 92bafd7afd..09a5ee24c5 100644 --- a/front/src/components/About.vue +++ b/front/src/components/About.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'About This Instance'"> <div class="ui vertical center aligned stripe segment"> <div class="ui text container"> <h1 class="ui huge header"> diff --git a/front/src/components/Home.vue b/front/src/components/Home.vue index ad1ad93cb0..0e24dcd590 100644 --- a/front/src/components/Home.vue +++ b/front/src/components/Home.vue @@ -1,9 +1,9 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'Welcome'"> <div class="ui vertical center aligned stripe segment"> <div class="ui text container"> <h1 class="ui huge header"> - Welcome on funkwhale + Welcome on Funkwhale </h1> <p>We think listening music should be simple.</p> <router-link class="ui icon button" to="/about"> @@ -143,9 +143,7 @@ export default { name: 'home', data () { - return { - msg: 'Welcome to Your Vue.js App' - } + return {} } } </script> diff --git a/front/src/components/PageNotFound.vue b/front/src/components/PageNotFound.vue index 3b88a6921f..25e6f86fd2 100644 --- a/front/src/components/PageNotFound.vue +++ b/front/src/components/PageNotFound.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'Page Not Found'"> <div class="ui vertical stripe segment"> <div class="ui text container"> <h1 class="ui huge header"> diff --git a/front/src/components/auth/Login.vue b/front/src/components/auth/Login.vue index 2cf6d5f6db..d232da2a35 100644 --- a/front/src/components/auth/Login.vue +++ b/front/src/components/auth/Login.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'Log In'"> <div class="ui vertical stripe segment"> <div class="ui small text container"> <h2>Log in to your Funkwhale account</h2> diff --git a/front/src/components/auth/Logout.vue b/front/src/components/auth/Logout.vue index fbacca7033..980740c94c 100644 --- a/front/src/components/auth/Logout.vue +++ b/front/src/components/auth/Logout.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'Log Out'"> <div class="ui vertical stripe segment"> <div class="ui small text container"> <h2>Are you sure you want to log out?</h2> diff --git a/front/src/components/auth/Profile.vue b/front/src/components/auth/Profile.vue index 54af5a11c4..9fafccffa8 100644 --- a/front/src/components/auth/Profile.vue +++ b/front/src/components/auth/Profile.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="username + '\'s Profile'"> <div v-if="isLoading" class="ui vertical segment"> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> </div> diff --git a/front/src/components/auth/Settings.vue b/front/src/components/auth/Settings.vue index 8cd03d7558..859c0d04b9 100644 --- a/front/src/components/auth/Settings.vue +++ b/front/src/components/auth/Settings.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'Account Settings'"> <div class="ui vertical stripe segment"> <div class="ui small text container"> <h2 class="ui header">Account settings</h2> diff --git a/front/src/components/auth/Signup.vue b/front/src/components/auth/Signup.vue index 749d2eb025..39ca366631 100644 --- a/front/src/components/auth/Signup.vue +++ b/front/src/components/auth/Signup.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'Sign Up'"> <div class="ui vertical stripe segment"> <div class="ui small text container"> <h2>Create a funkwhale account</h2> diff --git a/front/src/components/favorites/List.vue b/front/src/components/favorites/List.vue index c65144a93b..dbef186b6b 100644 --- a/front/src/components/favorites/List.vue +++ b/front/src/components/favorites/List.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'Your Favorites'"> <div class="ui vertical center aligned stripe segment"> <div :class="['ui', {'active': isLoading}, 'inverted', 'dimmer']"> <div class="ui text loader">Loading your favorites...</div> diff --git a/front/src/components/library/Album.vue b/front/src/components/library/Album.vue index 65768aafe7..1e96757c34 100644 --- a/front/src/components/library/Album.vue +++ b/front/src/components/library/Album.vue @@ -1,10 +1,10 @@ <template> <div> - <div v-if="isLoading" class="ui vertical segment"> + <div v-if="isLoading" class="ui vertical segment" v-title="'Album'"> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> </div> <template v-if="album"> - <div :class="['ui', 'head', {'with-background': album.cover}, 'vertical', 'center', 'aligned', 'stripe', 'segment']" :style="headerStyle"> + <div :class="['ui', 'head', {'with-background': album.cover}, 'vertical', 'center', 'aligned', 'stripe', 'segment']" :style="headerStyle" v-title="album.title"> <div class="segment-content"> <h2 class="ui center aligned icon header"> <i class="circular inverted sound yellow icon"></i> diff --git a/front/src/components/library/Artist.vue b/front/src/components/library/Artist.vue index 9a546aa0e9..07d8cbbc74 100644 --- a/front/src/components/library/Artist.vue +++ b/front/src/components/library/Artist.vue @@ -1,10 +1,10 @@ <template> <div> - <div v-if="isLoading" class="ui vertical segment"> + <div v-if="isLoading" class="ui vertical segment" v-title="'Artist'"> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> </div> <template v-if="artist"> - <div :class="['ui', 'head', {'with-background': cover}, 'vertical', 'center', 'aligned', 'stripe', 'segment']" :style="headerStyle"> + <div :class="['ui', 'head', {'with-background': cover}, 'vertical', 'center', 'aligned', 'stripe', 'segment']" :style="headerStyle" v-title="artist.name"> <div class="segment-content"> <h2 class="ui center aligned icon header"> <i class="circular inverted users violet icon"></i> diff --git a/front/src/components/library/Artists.vue b/front/src/components/library/Artists.vue index 52ccbdd746..72ad108f1d 100644 --- a/front/src/components/library/Artists.vue +++ b/front/src/components/library/Artists.vue @@ -1,5 +1,5 @@ <template> - <div> + <div v-title="'Artists'"> <div class="ui vertical stripe segment"> <h2 class="ui header">Browsing artists</h2> <div :class="['ui', {'loading': isLoading}, 'form']"> diff --git a/front/src/components/library/Home.vue b/front/src/components/library/Home.vue index 40f6808f98..26352d1fd6 100644 --- a/front/src/components/library/Home.vue +++ b/front/src/components/library/Home.vue @@ -1,5 +1,5 @@ <template> - <div> + <div v-title="'Home'"> <div class="ui vertical stripe segment"> <search :autofocus="true"></search> </div> diff --git a/front/src/components/library/Radios.vue b/front/src/components/library/Radios.vue index 303ce100ec..7ab14ab14f 100644 --- a/front/src/components/library/Radios.vue +++ b/front/src/components/library/Radios.vue @@ -1,5 +1,5 @@ <template> - <div> + <div v-title="'Radios'"> <div class="ui vertical stripe segment"> <h2 class="ui header">Browsing radios</h2> <router-link class="ui green basic button" to="/library/radios/build" exact>Create your own radio</router-link> diff --git a/front/src/components/library/Track.vue b/front/src/components/library/Track.vue index 0437ac8815..e614635c98 100644 --- a/front/src/components/library/Track.vue +++ b/front/src/components/library/Track.vue @@ -1,10 +1,10 @@ <template> <div> - <div v-if="isLoadingTrack" class="ui vertical segment"> + <div v-if="isLoadingTrack" class="ui vertical segment" v-title="'Track'"> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> </div> <template v-if="track"> - <div :class="['ui', 'head', {'with-background': cover}, 'vertical', 'center', 'aligned', 'stripe', 'segment']" :style="headerStyle"> + <div :class="['ui', 'head', {'with-background': cover}, 'vertical', 'center', 'aligned', 'stripe', 'segment']" :style="headerStyle" v-title="track.title"> <div class="segment-content"> <h2 class="ui center aligned icon header"> <i class="circular inverted music orange icon"></i> diff --git a/front/src/components/library/import/BatchDetail.vue b/front/src/components/library/import/BatchDetail.vue index 0864d2464a..362a5acd17 100644 --- a/front/src/components/library/import/BatchDetail.vue +++ b/front/src/components/library/import/BatchDetail.vue @@ -1,5 +1,5 @@ <template> - <div> + <div v-title="'Import Batch #' + id"> <div v-if="isLoading && !batch" class="ui vertical segment"> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> </div> diff --git a/front/src/components/library/import/BatchList.vue b/front/src/components/library/import/BatchList.vue index de4fef554c..857fef0457 100644 --- a/front/src/components/library/import/BatchList.vue +++ b/front/src/components/library/import/BatchList.vue @@ -1,5 +1,5 @@ <template> - <div> + <div v-title="'Import Batches'"> <div class="ui vertical stripe segment"> <div v-if="isLoading" :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> <button diff --git a/front/src/components/library/import/Main.vue b/front/src/components/library/import/Main.vue index 66e16b71f4..e2b6e48491 100644 --- a/front/src/components/library/import/Main.vue +++ b/front/src/components/library/import/Main.vue @@ -1,5 +1,5 @@ <template> - <div> + <div v-title="'Import Music'"> <div class="ui vertical stripe segment"> <div class="ui top three attached ordered steps"> <a @click="currentStep = 0" :class="['step', {'active': currentStep === 0}, {'completed': currentStep > 0}]"> diff --git a/front/src/components/library/radios/Builder.vue b/front/src/components/library/radios/Builder.vue index 8d67b61e18..9b8786cc6e 100644 --- a/front/src/components/library/radios/Builder.vue +++ b/front/src/components/library/radios/Builder.vue @@ -1,5 +1,5 @@ <template> - <div class="ui vertical stripe segment"> + <div class="ui vertical stripe segment" v-title="'Radio Builder'"> <div> <div> <h2 class="ui header">Builder</h2> diff --git a/front/src/components/requests/RequestsList.vue b/front/src/components/requests/RequestsList.vue index 33ba04f53c..5d4db243ac 100644 --- a/front/src/components/requests/RequestsList.vue +++ b/front/src/components/requests/RequestsList.vue @@ -1,5 +1,5 @@ <template> - <div> + <div v-title="'Import Requests'"> <div class="ui vertical stripe segment"> <h2 class="ui header">Music requests</h2> <div :class="['ui', {'loading': isLoading}, 'form']"> diff --git a/front/src/main.js b/front/src/main.js index f20af42bfa..5030e5c9c4 100644 --- a/front/src/main.js +++ b/front/src/main.js @@ -30,6 +30,10 @@ require('masonry-layout') Vue.use(VueMasonryPlugin) Vue.use(VueLazyload) Vue.config.productionTip = false +Vue.directive('title', { + inserted: (el, binding) => { console.log(binding.value); document.title = binding.value + ' - Funkwhale' }, + updated: (el, binding) => { document.title = binding.value + ' - Funkwhale' } +}) axios.defaults.baseURL = config.API_URL axios.interceptors.request.use(function (config) { diff --git a/front/src/views/instance/Timeline.vue b/front/src/views/instance/Timeline.vue index 8ffcd9758f..f4ddedfb72 100644 --- a/front/src/views/instance/Timeline.vue +++ b/front/src/views/instance/Timeline.vue @@ -1,5 +1,5 @@ <template> - <div class="main pusher"> + <div class="main pusher" v-title="'Instance Timeline'"> <div class="ui vertical center aligned stripe segment"> <div v-if="isLoading" :class="['ui', {'active': isLoading}, 'inverted', 'dimmer']"> <div class="ui text loader">Loading timeline...</div> diff --git a/front/src/views/playlists/Detail.vue b/front/src/views/playlists/Detail.vue index 6c3a988fd1..2769317e64 100644 --- a/front/src/views/playlists/Detail.vue +++ b/front/src/views/playlists/Detail.vue @@ -1,9 +1,9 @@ <template> <div> - <div v-if="isLoading" class="ui vertical segment"> + <div v-if="isLoading" class="ui vertical segment" v-title="'Playlist'"> <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div> </div> - <div v-if="!isLoading && playlist" class="ui head vertical center aligned stripe segment"> + <div v-if="!isLoading && playlist" class="ui head vertical center aligned stripe segment" v-title="playlist.name"> <div class="segment-content"> <h2 class="ui center aligned icon header"> <i class="circular inverted list yellow icon"></i> diff --git a/front/src/views/playlists/List.vue b/front/src/views/playlists/List.vue index fc5dcbe54b..96aa36c477 100644 --- a/front/src/views/playlists/List.vue +++ b/front/src/views/playlists/List.vue @@ -1,5 +1,5 @@ <template> - <div> + <div v-title="'Playlists'"> <div class="ui vertical stripe segment"> <h2 class="ui header">Browsing playlists</h2> <div :class="['ui', {'loading': isLoading}, 'form']"> -- GitLab