Skip to content

Commit

Permalink
0.3.1
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
tobias-g1 authored Oct 21, 2018
1 parent 93f18c8 commit bb67ba9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
3 changes: 3 additions & 0 deletions client/src/app/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
font-weight: normal !important;
}

.el-dropdown-link .material-icons {
cursor: pointer;
}
13 changes: 5 additions & 8 deletions client/src/pages/create-contest/create-contest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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 = [
Expand Down Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions server/src/models/contests.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ var ContestSchema = new Schema({
type: String,
required: true
},
id: {
type: String,
required: true
},
deadline: {
type: String,
required: true
Expand Down

0 comments on commit bb67ba9

Please sign in to comment.