From bb67ba9f8f43699d47fa85e37ba110ba39a4b9e7 Mon Sep 17 00:00:00 2001 From: tobias-g1 Date: Sun, 21 Oct 2018 23:21:16 +0100 Subject: [PATCH] 0.3.1 * Add body, add right method to form validation following create contest * Adjust contest-permlink to take into account _ * Append random string to permlink * Add cursor point to nav bar dropdown option * Adjust create contest markdown, remove uneeded json metadata * Remove mandatory id field definition --- client/src/app/app.css | 3 +++ client/src/pages/create-contest/create-contest.vue | 13 +++++-------- server/src/models/contests.model.js | 4 ---- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/client/src/app/app.css b/client/src/app/app.css index 05607c2..cee04ee 100644 --- a/client/src/app/app.css +++ b/client/src/app/app.css @@ -22,3 +22,6 @@ font-weight: normal !important; } +.el-dropdown-link .material-icons { + cursor: pointer; +} diff --git a/client/src/pages/create-contest/create-contest.vue b/client/src/pages/create-contest/create-contest.vue index 3cecb4a..6393bdb 100644 --- a/client/src/pages/create-contest/create-contest.vue +++ b/client/src/pages/create-contest/create-contest.vue @@ -122,7 +122,7 @@ export default { return this.fixedTags.concat(this.contestForm.dynamicTags) }, contestPermlink: function () { - return this.contestForm.title.toLowerCase().replace(/[\s#/]/g, '-') + '-' + return this.contestForm.title.toLowerCase().replace(/[\s#_/]/g, '-') + '-' + Math.random().toString(36).replace(/[^a-z]+/g, '') }, postImages: function () { let images = this.contestForm.body.match(/(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|gif|png|jpeg|svg)/g) @@ -141,7 +141,7 @@ export default { submitForm (formName) { this.$refs[formName].validate((valid) => { if (valid) { - this.createContestCH() + this.createContest() } else { console.log('error submit!!') return false @@ -160,13 +160,9 @@ export default { var jsonMetaData = { 'tags': this.finalTags, - 'app': 'contest_hero_test', + 'app': 'contest_hero', 'image': this.postImages, - 'format': 'markdown', - 'contest_hero': { - 'category': 'writing', - 'deadline': this.contestForm.deadline - } + 'format': 'markdown' } const operations = [ @@ -217,6 +213,7 @@ export default { access_token: localStorage.getItem('access_token'), title: this.contestForm.title, author: this.$store.state.steemconnect.user.name, + body: this.adjustBody, deadline: this.contestForm.deadline, category: this.contestForm.category, permlink: this.contestPermlink diff --git a/server/src/models/contests.model.js b/server/src/models/contests.model.js index b781c5b..db2d796 100644 --- a/server/src/models/contests.model.js +++ b/server/src/models/contests.model.js @@ -14,10 +14,6 @@ var ContestSchema = new Schema({ type: String, required: true }, - id: { - type: String, - required: true - }, deadline: { type: String, required: true