diff --git a/frontend/src/components/Authors.vue b/frontend/src/components/Authors.vue index 436177e..c284aad 100644 --- a/frontend/src/components/Authors.vue +++ b/frontend/src/components/Authors.vue @@ -64,8 +64,7 @@ }" > -
-
+
-

not logged in. Login

+

+ +

diff --git a/frontend/src/components/PublisherOverview.vue b/frontend/src/components/PublisherOverview.vue index d859035..83461ec 100644 --- a/frontend/src/components/PublisherOverview.vue +++ b/frontend/src/components/PublisherOverview.vue @@ -4,13 +4,11 @@
   - Loading... +
-
- An error occured. -
+
{{ error.message }}

{{ error.response.data.Message }} @@ -21,14 +19,12 @@ - Edit +

-
- Name -
+
{{ publisher.Name }}
diff --git a/frontend/src/components/Publishers.vue b/frontend/src/components/Publishers.vue index ac41f19..98fe1a2 100644 --- a/frontend/src/components/Publishers.vue +++ b/frontend/src/components/Publishers.vue @@ -1,26 +1,22 @@ @@ -95,10 +89,10 @@ export default { user: auth.user, publishers: [], searchQuery: '', - gridColumns: ['Name'], + gridColumns: [], gridButtons: [ { - text: 'Delete', + text: '', icon: 'trash', action: this.DeletePublisher, css: 'ui red icon button' @@ -120,6 +114,9 @@ export default { }, created () { this.loadPublishers() + + this.gridButtons[0].text = this.translate('general').delete + this.gridColumns = [this.translate('general').name] }, watch: { // call again the method if the route changes @@ -141,6 +138,9 @@ export default { }) } return data + }, + langGeneral () { + return this.translate('general') } }, methods: { @@ -183,7 +183,7 @@ export default { .then(response => { console.log(response) if (response.status === 200 && response.data.Message === 'success') { - this.success = 'The publisher was deleted successfully.' + this.success = this.translate('publishers').deleteSuccess this.loadPublishers() } }) diff --git a/frontend/src/components/PublishersAddEdit.vue b/frontend/src/components/PublishersAddEdit.vue index 9b8fce2..941ae41 100644 --- a/frontend/src/components/PublishersAddEdit.vue +++ b/frontend/src/components/PublishersAddEdit.vue @@ -1,28 +1,24 @@ @@ -60,10 +56,15 @@ } this.loading = false }, + computed: { + langGeneral () { + return this.translate('general') + } + }, methods: { insertOrUpdatePublisher: function () { if (this.publisher.Lastname === '') { - this.error = {message: 'Please provide name.'} + this.error = {message: this.translate('publishers').errorNoName} } else { this.loading = true @@ -73,7 +74,7 @@ HTTP.post('publishers/' + this.publisher.ID, {publisher: this.publisher}) .then(response => { this.loading = false - this.success = 'The publisher was successfully updated!' + this.success = this.translate('publishers').updatedSuccess this.error = '' }) .catch(e => { @@ -84,7 +85,7 @@ HTTP.put('publishers', {publisher: this.publisher}) .then(response => { this.loading = false - this.success = 'The publisher was successfully inserted!' + this.success = this.translate('publishers').insertedSuccess this.error = '' }) .catch(e => { diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 0088884..933a4d4 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -62,5 +62,15 @@ export default { deleteSuccess: 'The author was deleted successfully.', forename: 'Forename', lastname: 'Lastname' + }, + publishers: { + title: 'Publishers overview', + newPublisher: 'Add a new publisher', + deleteHeader: 'Delete this publisher', + deleteText: 'Are you sure you want to delete this publisher? This cannot be undone!', + deleteSuccess: 'The publisher was deleted successfully.', + errorNoName: 'Please provide a name.', + updatedSuccess: 'The publisher was successfully updated!' + insertedSuccess: 'The publisher was successfully inserted!' } }