Added dynamically setting title
the build was successful Details

This commit is contained in:
kolaente 2017-12-05 15:55:56 +01:00
parent 932885d34a
commit 5968e4e56e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
15 changed files with 98 additions and 15 deletions

View File

@ -48,11 +48,19 @@
},
created () {
this.loadAuthor()
// Set the title
document.title = this.translate('nav').authors
},
watch: {
// call again the method if the route changes
'$route': 'loadAuthor'
},
computed: {
langGeneral () {
return this.translate('general')
}
},
methods: {
loadAuthor () {
this.loading = true
@ -88,6 +96,9 @@
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
// Set the title
document.title = this.author.forename + ' ' + this.author.lastname + ' | ' + this.translate('nav').authors
this.loading = false
})
.catch(e => {

View File

@ -102,6 +102,9 @@ export default {
this.gridButtons[0].text = this.translate('general').delete
this.gridColumns = [this.translate('general').name]
// Set the title
document.title = this.translate('nav').authors
},
watch: {
// call again the method if the route changes

View File

@ -53,6 +53,13 @@
this.errorNotification(e)
})
}
// Set the title
document.title = this.translate('authors').newAuthor + ' | ' + this.translate('nav').authors
if (this.authorid) {
document.title = this.translate('general').edit + ' | ' + this.translate('nav').authors
}
this.loading = false
},
computed: {

View File

@ -52,6 +52,8 @@
created () {
this.loadStatus()
this.loadBook()
document.title = this.translate('nav').books
},
watch: {
// call again the method if the route changes
@ -153,6 +155,9 @@
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
// Set the title
document.title = this.book.title + ' | ' + this.translate('nav').books
this.loading = false
})
.catch(e => {

View File

@ -115,6 +115,8 @@ export default {
gc.quantity,
gc.status
]
document.title = this.translate('nav').books
},
watch: {
// call again the method if the route changes

View File

@ -169,6 +169,13 @@
this.errorNotification(e)
})
}
// Set the title
document.title = this.translate('books').add
if (this.bookID) {
document.title = this.translate('general').edit + ' | ' + this.translate('nav').books
}
this.loading = false
},
methods: {

View File

@ -7,19 +7,23 @@
</template>
<script>
import auth from '../auth'
import auth from '../auth'
export default {
name: 'Home',
data () {
return {
user: auth.user
}
},
methods: {
logout () {
auth.logout()
export default {
name: 'Home',
data () {
return {
user: auth.user
}
},
methods: {
logout () {
auth.logout()
}
},
created () {
// Set the title
document.title = this.translate('nav').home
}
}
}
</script>

View File

@ -47,11 +47,19 @@
},
created () {
this.loadItem()
// Set the title
document.title = this.translate('nav').items
},
watch: {
// call again the method if the route changes
'$route': 'loadItem'
},
computed: {
langGeneral () {
return this.translate('general')
}
},
methods: {
loadItem () {
this.loading = true
@ -95,6 +103,9 @@
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
// Set the title
document.title = this.item.title + ' | ' + this.translate('nav').items
this.loading = false
})
.catch(e => {

View File

@ -107,6 +107,9 @@ export default {
langGrid.price,
langGrid.quantity
]
// Set the title
document.title = this.translate('nav').items
},
watch: {
// call again the method if the route changes

View File

@ -67,6 +67,13 @@
this.errorNotification(e)
})
}
// Set the title
document.title = this.translate('items').newItem + ' | ' + this.translate('nav').items
if (this.itemID) {
document.title = this.translate('general').edit + ' | ' + this.translate('nav').items
}
this.loading = false
},
computed: {

View File

@ -52,14 +52,15 @@
loading: false
}
},
beforeMount () {
// Check if the user is already logged in, if so, redirect him to the homepage
if (auth.user.authenticated) {
router.push({name: 'home'})
}
},
created () {
document.title = this.translate('login').title
},
methods: {
submit () {
this.loading = true
@ -72,7 +73,6 @@
auth.login(this, credentials, 'home')
}
},
computed: {
login () {
return this.translate('login')

View File

@ -46,11 +46,19 @@
},
created () {
this.loadPublisher()
// Set the title
document.title = this.translate('nav').publishers
},
watch: {
// call again the method if the route changes
'$route': 'loadPublisher'
},
computed: {
langGeneral () {
return this.translate('general')
}
},
methods: {
loadPublisher () {
this.loading = true
@ -82,6 +90,9 @@
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
// Set the title
document.title = this.publisher.name + ' | ' + this.translate('nav').publishers
this.loading = false
})
.catch(e => {

View File

@ -102,6 +102,9 @@ export default {
this.gridButtons[0].text = this.translate('general').delete
this.gridColumns = [this.translate('general').name]
// Set the title
document.title = this.translate('nav').publishers
},
watch: {
// call again the method if the route changes

View File

@ -46,6 +46,13 @@
this.errorNotification(e)
})
}
// Set the title
document.title = this.translate('publishers').newPublisher + ' | ' + this.translate('nav').publishers
if (this.publisherID) {
document.title = this.translate('general').edit + ' | ' + this.translate('nav').publishers
}
this.loading = false
},
computed: {

View File

@ -42,6 +42,7 @@ export default {
title: 'Liste des livres',
description: 'Description',
add: 'Ajouter un livre',
editBook: 'Modifier un livre',
deleteHeader: 'Supprimer le livre',
deleteMsg: 'Est-ce que vous êtes sur que vous voulez supprimer cette livre? <b>Cette operation est irréversible !</b>',
deleteSuccess: 'Le livre a éte supprimè avec succès.',
@ -62,6 +63,7 @@ export default {
authors: {
title: 'Liste des auteurs',
newAuthor: 'Ajouter un auteur',
editAuthor: 'Modifier l\'auteur',
deleteHeader: 'Supprimer l\'auteur',
deleteMsg: 'Est-ce que vous êtes sur que vous voulez supprimer cet auteur? <b>Cette operation est irréversible !</b>',
deleteSuccess: 'L\'auteur a éte supprimè avec succès.',