Added showing date on detail page
the build failed Details

This commit is contained in:
konrad 2017-11-30 15:26:28 +01:00 committed by kolaente
parent c3d6032bcf
commit 634e696369
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
8 changed files with 130 additions and 8 deletions

View File

@ -89,4 +89,8 @@ export default {
.lang-switcher{ .lang-switcher{
float: right; float: right;
} }
.grey{
color: #ccc;
}
</style> </style>

View File

@ -15,6 +15,11 @@
</router-link> </router-link>
<list :infos="authorList"/> <list :infos="authorList"/>
<p class="grey">
<span v-lang.general.created="this.createdTime"></span><br/>
<span v-if="this.author.created !== this.author.updated" v-lang.general.lastEdit="this.editedTime"></span>
</p>
</div> </div>
</div> </div>
</template> </template>
@ -30,7 +35,15 @@
user: auth.user, user: auth.user,
author: {}, author: {},
authorID: this.$route.params.id, authorID: this.$route.params.id,
authorList: [] authorList: [],
createdTime: {
date: '',
time: ''
},
editedTime: {
date: '',
time: ''
}
} }
}, },
created () { created () {
@ -60,11 +73,27 @@
} }
] ]
// Beautify the date
let c = new Date(this.author.created * 1000)
// c.setSeconds()
this.createdTime = {
date: ('0' + c.getDate()).slice(-2) + '.' + ('0' + (c.getMonth() + 1)).slice(-2) + '.' + c.getFullYear(),
time: ('0' + c.getHours()).slice(-2) + ':' + ('0' + c.getMinutes()).slice(-2)
}
let e = new Date(this.author.updated * 1000)
// e.setSeconds()
this.editedTime = {
date: ('0' + e.getDate()).slice(-2) + '.' + ('0' + (e.getMonth() + 1)).slice(-2) + '.' + e.getFullYear(),
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
this.loading = false this.loading = false
}) })
.catch(e => { .catch(e => {
this.loading = false this.loading = false
// Build the notification text from error response // Build the notification text from error response
console.log(e)
let err = e.message let err = e.message
if (e.response.data.Message) { if (e.response.data.Message) {
err += '<br/>' + e.response.data.Message err += '<br/>' + e.response.data.Message

View File

@ -15,6 +15,11 @@
</router-link> </router-link>
<list :infos="bookList" /> <list :infos="bookList" />
<p class="grey">
<span v-lang.general.created="this.createdTime"></span><br/>
<span v-if="this.book.created !== this.book.updated" v-lang.general.lastEdit="this.editedTime"></span>
</p>
</div> </div>
</div> </div>
</template> </template>
@ -33,7 +38,15 @@
allStatus: [], allStatus: [],
bookID: this.$route.params.id, bookID: this.$route.params.id,
bookList: {}, bookList: {},
AuthorList: [] AuthorList: [],
createdTime: {
date: '',
time: ''
},
editedTime: {
date: '',
time: ''
}
} }
}, },
created () { created () {
@ -82,7 +95,6 @@
// Make Status a name, not an id // Make Status a name, not an id
this.book.status = this.getStatusByID(this.book.status) this.book.status = this.getStatusByID(this.book.status)
this.loading = false
// Build the list object // Build the list object
this.bookList = [ this.bookList = [
@ -125,6 +137,23 @@
content: this.AuthorList content: this.AuthorList
} }
] ]
// Beautify the date
let c = new Date(this.book.created * 1000)
// c.setSeconds()
this.createdTime = {
date: ('0' + c.getDate()).slice(-2) + '.' + ('0' + (c.getMonth() + 1)).slice(-2) + '.' + c.getFullYear(),
time: ('0' + c.getHours()).slice(-2) + ':' + ('0' + c.getMinutes()).slice(-2)
}
let e = new Date(this.book.updated * 1000)
// e.setSeconds()
this.editedTime = {
date: ('0' + e.getDate()).slice(-2) + '.' + ('0' + (e.getMonth() + 1)).slice(-2) + '.' + e.getFullYear(),
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
this.loading = false
}) })
.catch(e => { .catch(e => {
this.loading = false this.loading = false

View File

@ -15,6 +15,10 @@
</router-link> </router-link>
<list :infos="itemList"/> <list :infos="itemList"/>
<p class="grey">
<span v-lang.general.created="this.createdTime"></span><br/>
<span v-if="this.item.created !== this.item.updated" v-lang.general.lastEdit="this.editedTime"></span>
</p>
</div> </div>
</div> </div>
</template> </template>
@ -30,7 +34,15 @@
user: auth.user, user: auth.user,
item: {}, item: {},
itemID: this.$route.params.id, itemID: this.$route.params.id,
itemList: [] itemList: [],
createdTime: {
date: '',
time: ''
},
editedTime: {
date: '',
time: ''
}
} }
}, },
created () { created () {
@ -68,6 +80,21 @@
} }
] ]
// Beautify the date
let c = new Date(this.item.created * 1000)
// c.setSeconds()
this.createdTime = {
date: ('0' + c.getDate()).slice(-2) + '.' + ('0' + (c.getMonth() + 1)).slice(-2) + '.' + c.getFullYear(),
time: ('0' + c.getHours()).slice(-2) + ':' + ('0' + c.getMinutes()).slice(-2)
}
let e = new Date(this.item.updated * 1000)
// e.setSeconds()
this.editedTime = {
date: ('0' + e.getDate()).slice(-2) + '.' + ('0' + (e.getMonth() + 1)).slice(-2) + '.' + e.getFullYear(),
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
this.loading = false this.loading = false
}) })
.catch(e => { .catch(e => {

View File

@ -14,6 +14,10 @@
</router-link> </router-link>
<list :infos="publisherList"/> <list :infos="publisherList"/>
<p class="grey">
<span v-lang.general.created="this.createdTime"></span><br/>
<span v-if="this.publisher.created !== this.publisher.updated" v-lang.general.lastEdit="this.editedTime"></span>
</p>
</div> </div>
</div> </div>
</template> </template>
@ -29,7 +33,15 @@
user: auth.user, user: auth.user,
publisher: {}, publisher: {},
publisherID: this.$route.params.id, publisherID: this.$route.params.id,
publisherList: [] publisherList: [],
createdTime: {
date: '',
time: ''
},
editedTime: {
date: '',
time: ''
}
} }
}, },
created () { created () {
@ -55,6 +67,21 @@
} }
] ]
// Beautify the date
let c = new Date(this.publisher.created * 1000)
// c.setSeconds()
this.createdTime = {
date: ('0' + c.getDate()).slice(-2) + '.' + ('0' + (c.getMonth() + 1)).slice(-2) + '.' + c.getFullYear(),
time: ('0' + c.getHours()).slice(-2) + ':' + ('0' + c.getMinutes()).slice(-2)
}
let e = new Date(this.publisher.updated * 1000)
// e.setSeconds()
this.editedTime = {
date: ('0' + e.getDate()).slice(-2) + '.' + ('0' + (e.getMonth() + 1)).slice(-2) + '.' + e.getFullYear(),
time: ('0' + e.getHours()).slice(-2) + ':' + ('0' + e.getMinutes()).slice(-2)
}
this.loading = false this.loading = false
}) })
.catch(e => { .catch(e => {

View File

@ -14,7 +14,9 @@ export default {
submit: 'Senden', submit: 'Senden',
selectOne: 'Wähle einen aus', selectOne: 'Wähle einen aus',
selectOneOrMore: 'Wähle einen oder mehr', selectOneOrMore: 'Wähle einen oder mehr',
name: 'Name' name: 'Name',
created: 'Erstellt am {date} um {time}',
lastEdit: 'Zuletzt bearbeitet am {date} um {time}'
}, },
login: { login: {
title: 'Einloggen', title: 'Einloggen',

View File

@ -14,7 +14,9 @@ export default {
submit: 'Submit', submit: 'Submit',
selectOne: 'Select one', selectOne: 'Select one',
selectOneOrMore: 'Select one or more', selectOneOrMore: 'Select one or more',
name: 'Name' name: 'Name',
created: 'Created on {date} at {time}',
lastEdit: 'Last edit on {date} at {time}'
}, },
login: { login: {
title: 'Login', title: 'Login',

View File

@ -14,7 +14,9 @@ export default {
submit: 'Envoyer', submit: 'Envoyer',
selectOne: 'Choisissez un', selectOne: 'Choisissez un',
selectOneOrMore: 'Choisissez un ou plus', selectOneOrMore: 'Choisissez un ou plus',
name: 'Nom' name: 'Nom',
created: 'Crée le {date} à {time}',
lastEdit: 'Dernière motification le {date} à {time}'
}, },
login: { login: {
title: 'Se connecter', title: 'Se connecter',