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/UploadCreate.vue | 13 +++++++++---- src/pages/UploadDetail.vue | 24 +++++++++++++++--------- 2 files changed, 24 insertions(+), 13 deletions(-) (limited to 'src/pages') diff --git a/src/pages/UploadCreate.vue b/src/pages/UploadCreate.vue index c435a2f..6cdabcd 100644 --- a/src/pages/UploadCreate.vue +++ b/src/pages/UploadCreate.vue @@ -14,9 +14,12 @@
+ icon="fa-edit"> + + + @@ -105,7 +108,7 @@ Back - Save mod +  Save mod @@ -146,6 +149,7 @@ files: [], tags: [], title: '', + version: '', description: '', slug: '', errors: {}, @@ -170,7 +174,7 @@ headers: { Authorization: `JWT ${this.$store.state.user.authToken}` }, acceptedFiles: '.ocs,.ocf,.ocd,.ocg,.ocr,.ocu,.c4d,.c4g,.c4f,.c4r,.c4s,.c4v,.c4l,.c4u', dictDefaultMessage: "

Drop your mod files here or click to upload

", - maxFilesize: 30, // MB + maxFilesize: 100, // MB } }, picDropzoneOptions () { @@ -181,7 +185,6 @@ acceptedFiles: '.png,.jpg', dictDefaultMessage: "

Drop your image here or click to upload

", maxFilesize: 3, // MB - maxFiles: 1, thumbnailWidth: null, thumbnailHeight: 300, createImageThumbnails: true, @@ -233,6 +236,7 @@ } let params = { title: this.title, + version: this.version, description: this.description, files: this.files.map(el => el.id), tags: this.tags, @@ -253,6 +257,7 @@ }, reset () { this.title = '' + this.version = '' this.description = '' this.savedScenario = '' this.errors = {} 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