diff --git a/frontend/src/components/AuthorOverview.vue b/frontend/src/components/AuthorOverview.vue index 2f762dd..fa9b416 100644 --- a/frontend/src/components/AuthorOverview.vue +++ b/frontend/src/components/AuthorOverview.vue @@ -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 => { diff --git a/frontend/src/components/Authors.vue b/frontend/src/components/Authors.vue index 057ffd2..b469f92 100644 --- a/frontend/src/components/Authors.vue +++ b/frontend/src/components/Authors.vue @@ -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 diff --git a/frontend/src/components/AuthorsAddEdit.vue b/frontend/src/components/AuthorsAddEdit.vue index 53f069c..94e5a38 100644 --- a/frontend/src/components/AuthorsAddEdit.vue +++ b/frontend/src/components/AuthorsAddEdit.vue @@ -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: { diff --git a/frontend/src/components/BookOverview.vue b/frontend/src/components/BookOverview.vue index b10cbbc..6092fc4 100644 --- a/frontend/src/components/BookOverview.vue +++ b/frontend/src/components/BookOverview.vue @@ -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 => { diff --git a/frontend/src/components/Books.vue b/frontend/src/components/Books.vue index 4cb16a0..32edbd9 100644 --- a/frontend/src/components/Books.vue +++ b/frontend/src/components/Books.vue @@ -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 diff --git a/frontend/src/components/BooksAddEdit.vue b/frontend/src/components/BooksAddEdit.vue index 1decd2a..76e092b 100644 --- a/frontend/src/components/BooksAddEdit.vue +++ b/frontend/src/components/BooksAddEdit.vue @@ -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: { diff --git a/frontend/src/components/Home.vue b/frontend/src/components/Home.vue index b6cdd6a..6d15cde 100644 --- a/frontend/src/components/Home.vue +++ b/frontend/src/components/Home.vue @@ -7,19 +7,23 @@ diff --git a/frontend/src/components/ItemOverview.vue b/frontend/src/components/ItemOverview.vue index ba77b15..4e51c0c 100644 --- a/frontend/src/components/ItemOverview.vue +++ b/frontend/src/components/ItemOverview.vue @@ -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 => { diff --git a/frontend/src/components/Items.vue b/frontend/src/components/Items.vue index b1afd8e..42e26a8 100644 --- a/frontend/src/components/Items.vue +++ b/frontend/src/components/Items.vue @@ -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 diff --git a/frontend/src/components/ItemsAddEdit.vue b/frontend/src/components/ItemsAddEdit.vue index 33dfb63..6ac4e99 100644 --- a/frontend/src/components/ItemsAddEdit.vue +++ b/frontend/src/components/ItemsAddEdit.vue @@ -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: { diff --git a/frontend/src/components/Login.vue b/frontend/src/components/Login.vue index de14bd0..ae88a35 100644 --- a/frontend/src/components/Login.vue +++ b/frontend/src/components/Login.vue @@ -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') diff --git a/frontend/src/components/PublisherOverview.vue b/frontend/src/components/PublisherOverview.vue index 91d9bff..ee29477 100644 --- a/frontend/src/components/PublisherOverview.vue +++ b/frontend/src/components/PublisherOverview.vue @@ -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 => { diff --git a/frontend/src/components/Publishers.vue b/frontend/src/components/Publishers.vue index ff17ae4..d593483 100644 --- a/frontend/src/components/Publishers.vue +++ b/frontend/src/components/Publishers.vue @@ -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 diff --git a/frontend/src/components/PublishersAddEdit.vue b/frontend/src/components/PublishersAddEdit.vue index de47bcc..4a13831 100644 --- a/frontend/src/components/PublishersAddEdit.vue +++ b/frontend/src/components/PublishersAddEdit.vue @@ -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: { diff --git a/frontend/src/lang/fr.js b/frontend/src/lang/fr.js index b107274..6ac836b 100644 --- a/frontend/src/lang/fr.js +++ b/frontend/src/lang/fr.js @@ -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? Cette operation est irréversible !', 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? Cette operation est irréversible !', deleteSuccess: 'L\'auteur a éte supprimè avec succès.',