Added multilanguage for publishers
the build failed
Details
the build failed
Details
This commit is contained in:
parent
b406777a1f
commit
5dce42e65e
|
@ -64,8 +64,7 @@
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
</paginate-links>
|
</paginate-links>
|
||||||
<div v-if="$refs.paginator" v-lang.general.searchResultCount="$refs.paginator.pageItemsCount">
|
<div v-if="$refs.paginator" v-lang.general.searchResultCount="$refs.paginator.pageItemsCount"></div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<modal
|
<modal
|
||||||
|
@ -93,7 +92,7 @@ export default {
|
||||||
gridColumns: [],
|
gridColumns: [],
|
||||||
gridButtons: [
|
gridButtons: [
|
||||||
{
|
{
|
||||||
text: 'Delete',
|
text: '',
|
||||||
icon: 'trash',
|
icon: 'trash',
|
||||||
action: this.DeleteAuthor,
|
action: this.DeleteAuthor,
|
||||||
css: 'ui red icon button'
|
css: 'ui red icon button'
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<p v-if="!user.authenticated">not logged in. <router-link to="/login">Login</router-link></p>
|
<p v-if="!user.authenticated">
|
||||||
|
<router-link to="/login" v-lang.login.title></router-link>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,11 @@
|
||||||
|
|
||||||
<div class="ui info message" v-if="loading">
|
<div class="ui info message" v-if="loading">
|
||||||
<icon name="refresh" spin></icon>
|
<icon name="refresh" spin></icon>
|
||||||
Loading...
|
<span v-lang.general.loading></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui negative message" v-if="error">
|
<div class="ui negative message" v-if="error">
|
||||||
<div class="header">
|
<div class="header" v-lang.genral.error></div>
|
||||||
An error occured.
|
|
||||||
</div>
|
|
||||||
{{ error.message }}
|
{{ error.message }}
|
||||||
<p v-if="error.response.data">
|
<p v-if="error.response.data">
|
||||||
{{ error.response.data.Message }}
|
{{ error.response.data.Message }}
|
||||||
|
@ -21,14 +19,12 @@
|
||||||
|
|
||||||
<router-link :to="{ name: 'publisher-edit', params: { id: publisherID} }" class="ui teal labeled icon button" style="float: right;">
|
<router-link :to="{ name: 'publisher-edit', params: { id: publisherID} }" class="ui teal labeled icon button" style="float: right;">
|
||||||
<i class="edit icon"></i>
|
<i class="edit icon"></i>
|
||||||
Edit
|
<span v-lang.general.edit></span>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<div class="ui list">
|
<div class="ui list">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="header">
|
<div class="header" v-lang.general.name></div>
|
||||||
Name
|
|
||||||
</div>
|
|
||||||
{{ publisher.Name }}
|
{{ publisher.Name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,26 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-if="user.authenticated">
|
<div v-if="user.authenticated">
|
||||||
<h1>Publishers overview</h1>
|
<h1 v-lang.publishers.title></h1>
|
||||||
|
|
||||||
<div class="ui info message" v-if="loading">
|
<div class="ui info message" v-if="loading">
|
||||||
<icon name="refresh" spin></icon>
|
<icon name="refresh" spin></icon>
|
||||||
Loading...
|
<span v-lang.general.loading></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui negative message" v-if="error">
|
<div class="ui negative message" v-if="error">
|
||||||
<div class="header">
|
<div class="header" v-lang.genral.error></div>
|
||||||
An error occured.
|
|
||||||
</div>
|
|
||||||
{{ error.message }}
|
{{ error.message }}
|
||||||
<p v-if="error.response.data">
|
<p v-if="error.response.data">
|
||||||
{{ error.response.data.Message }}
|
{{ error.response.data.Message }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui positive message" v-if="success">
|
<div class="ui positive message" v-if="success">
|
||||||
<div class="header">
|
<div class="header" v-lang.general.success></div>
|
||||||
Success
|
|
||||||
</div>
|
|
||||||
{{ success }}
|
{{ success }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -28,17 +24,17 @@
|
||||||
|
|
||||||
<router-link to="/publishers/add" class="ui green labeled icon button" style="float: right;">
|
<router-link to="/publishers/add" class="ui green labeled icon button" style="float: right;">
|
||||||
<i class="plus icon"></i>
|
<i class="plus icon"></i>
|
||||||
Add a new publisher
|
<span v-lang.publishers.newPublisher></span>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
<button @click="loadPublishers()" class="ui teal labeled icon button" style="float: right;">
|
<button @click="loadPublishers()" class="ui teal labeled icon button" style="float: right;">
|
||||||
<i class="refresh icon"></i>
|
<i class="refresh icon"></i>
|
||||||
Refresh
|
<span v-lang.general.refresh></span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<form id="search">
|
<form id="search">
|
||||||
<div class="ui icon input">
|
<div class="ui icon input">
|
||||||
<input placeholder="Search for anything..." type="text" v-model="searchQuery" v-focus>
|
<input :placeholder="langGeneral.search" type="text" v-model="searchQuery" v-focus>
|
||||||
<i class="search icon"></i>
|
<i class="search icon"></i>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -68,17 +64,15 @@
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
</paginate-links>
|
</paginate-links>
|
||||||
<div v-if="$refs.paginator">
|
<div v-if="$refs.paginator" v-lang.general.searchResultCount="$refs.paginator.pageItemsCount"></div>
|
||||||
Viewing {{$refs.paginator.pageItemsCount}} results
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<modal
|
<modal
|
||||||
v-if="showModal"
|
v-if="showModal"
|
||||||
@close="showModal = false"
|
@close="showModal = false"
|
||||||
v-on:submit="deleteBtnSuccess()">
|
v-on:submit="deleteBtnSuccess()">
|
||||||
<span slot="header">Delete this publisher</span>
|
<span slot="header" v-lang.publisher.deleteHeader></span>
|
||||||
<p slot="text">Are you sure you want to delete this publisher? This cannot be undone!</p>
|
<p slot="text" v-lang.publisher.deleteText></p>
|
||||||
</modal>
|
</modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -95,10 +89,10 @@ export default {
|
||||||
user: auth.user,
|
user: auth.user,
|
||||||
publishers: [],
|
publishers: [],
|
||||||
searchQuery: '',
|
searchQuery: '',
|
||||||
gridColumns: ['Name'],
|
gridColumns: [],
|
||||||
gridButtons: [
|
gridButtons: [
|
||||||
{
|
{
|
||||||
text: 'Delete',
|
text: '',
|
||||||
icon: 'trash',
|
icon: 'trash',
|
||||||
action: this.DeletePublisher,
|
action: this.DeletePublisher,
|
||||||
css: 'ui red icon button'
|
css: 'ui red icon button'
|
||||||
|
@ -120,6 +114,9 @@ export default {
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
this.loadPublishers()
|
this.loadPublishers()
|
||||||
|
|
||||||
|
this.gridButtons[0].text = this.translate('general').delete
|
||||||
|
this.gridColumns = [this.translate('general').name]
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// call again the method if the route changes
|
// call again the method if the route changes
|
||||||
|
@ -141,6 +138,9 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
},
|
||||||
|
langGeneral () {
|
||||||
|
return this.translate('general')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -183,7 +183,7 @@ export default {
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log(response)
|
console.log(response)
|
||||||
if (response.status === 200 && response.data.Message === 'success') {
|
if (response.status === 200 && response.data.Message === 'success') {
|
||||||
this.success = 'The publisher was deleted successfully.'
|
this.success = this.translate('publishers').deleteSuccess
|
||||||
this.loadPublishers()
|
this.loadPublishers()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,28 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="ui negative message" v-if="error">
|
<div class="ui negative message" v-if="error">
|
||||||
<div class="header">
|
<div class="header" v-lang.genral.error></div>
|
||||||
An error occured.
|
|
||||||
</div>
|
|
||||||
{{ error.message }}
|
{{ error.message }}
|
||||||
<template v-if="error.response">
|
<p v-if="error.response.data">
|
||||||
<br/>{{ error.response.data.Message }}
|
{{ error.response.data.Message }}
|
||||||
</template>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui positive message" v-if="success">
|
<div class="ui positive message" v-if="success">
|
||||||
<div class="header">
|
<div class="header" v-lang.general.success></div>
|
||||||
Success
|
|
||||||
</div>
|
|
||||||
{{ success }}
|
{{ success }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form class="ui form" v-bind:class="{ loading: loading }" v-if="!success" @submit.prevent="insertOrUpdatePublisher">
|
<form class="ui form" v-bind:class="{ loading: loading }" v-if="!success" @submit.prevent="insertOrUpdatePublisher">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>Name</label>
|
<label v-lang.general.name></label>
|
||||||
<input name="Name" placeholder="Name" type="text" v-model="publisher.Name" required v-focus>
|
<input name="Name" :placeholder="langGeneral.name" type="text" v-model="publisher.Name" required v-focus>
|
||||||
</div>
|
</div>
|
||||||
<button class="ui blue button" type="submit">Submit</button>
|
<button class="ui blue button" type="submit" v-lang.general.submit></button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -60,10 +56,15 @@
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
langGeneral () {
|
||||||
|
return this.translate('general')
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
insertOrUpdatePublisher: function () {
|
insertOrUpdatePublisher: function () {
|
||||||
if (this.publisher.Lastname === '') {
|
if (this.publisher.Lastname === '') {
|
||||||
this.error = {message: 'Please provide name.'}
|
this.error = {message: this.translate('publishers').errorNoName}
|
||||||
} else {
|
} else {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
||||||
|
@ -73,7 +74,7 @@
|
||||||
HTTP.post('publishers/' + this.publisher.ID, {publisher: this.publisher})
|
HTTP.post('publishers/' + this.publisher.ID, {publisher: this.publisher})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.success = 'The publisher was successfully updated!'
|
this.success = this.translate('publishers').updatedSuccess
|
||||||
this.error = ''
|
this.error = ''
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
|
@ -84,7 +85,7 @@
|
||||||
HTTP.put('publishers', {publisher: this.publisher})
|
HTTP.put('publishers', {publisher: this.publisher})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.success = 'The publisher was successfully inserted!'
|
this.success = this.translate('publishers').insertedSuccess
|
||||||
this.error = ''
|
this.error = ''
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
|
|
|
@ -62,5 +62,15 @@ export default {
|
||||||
deleteSuccess: 'The author was deleted successfully.',
|
deleteSuccess: 'The author was deleted successfully.',
|
||||||
forename: 'Forename',
|
forename: 'Forename',
|
||||||
lastname: 'Lastname'
|
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? <b>This cannot be undone!</b>',
|
||||||
|
deleteSuccess: 'The publisher was deleted successfully.',
|
||||||
|
errorNoName: 'Please provide a name.',
|
||||||
|
updatedSuccess: 'The publisher was successfully updated!'
|
||||||
|
insertedSuccess: 'The publisher was successfully inserted!'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue