From e248df42e03abf313bf426c2994fede3e034d81c Mon Sep 17 00:00:00 2001 From: Fulgen301 Date: Sun, 14 Oct 2018 18:24:14 +0200 Subject: Adapt to new picture format, support nonexistent authors --- src/pages/UploadDetail.vue | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/pages/UploadDetail.vue') diff --git a/src/pages/UploadDetail.vue b/src/pages/UploadDetail.vue index ec75faa..d93c16d 100644 --- a/src/pages/UploadDetail.vue +++ b/src/pages/UploadDetail.vue @@ -2,27 +2,27 @@
- + - {{ upload.title }} + {{ upload.title }} v{{ upload.version }} - by {{ upload.author.name }}, + by {{ upload.author.name }}, updated {{ upload.updatedAt | moment("from") }} - - + + -
+
- {{ upload.title }} - by {{ upload.author.name }} + {{ upload.title }} v{{ upload.version }} + by {{ upload.author.name }} updated {{ upload.updatedAt | moment("from") }} @@ -284,8 +284,11 @@ routeId () { return this.$route.params.uploadId }, + hasAuthor() { + return this.upload && this.upload.author && this.upload.author.name !== "" + }, isAuthor () { - return this.upload && this.upload.author && this.upload.author.name === this.name + return this.hasAuthor && this.upload.author.name === this.name }, name () { return this.$store.state.user.decodedToken.name @@ -293,6 +296,9 @@ loggedIn () { return this.$store.getters['user/loggedIn'] }, + pictures() { + return this.upload ? this.upload.files.filter(file => file["content-type"].startsWith("image/")) : [] + }, filesDropzoneOptions () { return { url: `${this.$http.defaults.baseURL}/media`, -- cgit v1.2.3-54-g00ecf