From 17ff3b06cc52628468863e640a71fe086e32a455 Mon Sep 17 00:00:00 2001 From: Chris Blanchard Date: Sun, 30 Aug 2015 00:46:16 +0100 Subject: [PATCH] Switch to skill level --- db/models/profile.js | 5 +++-- lib/react/gather.jsx | 6 +++--- lib/react/user.jsx | 11 ++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/db/models/profile.js b/db/models/profile.js index 60a02f2..005a4c4 100644 --- a/db/models/profile.js +++ b/db/models/profile.js @@ -14,7 +14,8 @@ var profileSchema = new Schema({ commander: { type: Boolean, default: false } }, enslo: { type: Number, default: null }, - division: { type: String, default: null } + division: { type: String, default: null }, + skill: { type: String, default: null } }); profileSchema.path('userId').index({ unique: true }); @@ -38,7 +39,7 @@ profileSchema.method({ toJson: () => { let output = {}; output.abilities = this.abilities; - output.division = this.division; + output.skill = this.skill; return output; } }); diff --git a/lib/react/gather.jsx b/lib/react/gather.jsx index 111dcba..b0cffa8 100644 --- a/lib/react/gather.jsx +++ b/lib/react/gather.jsx @@ -633,8 +633,8 @@ var Gatherers = React.createClass({ alt={gatherer.user.country} />); }; - if (gatherer.user.profile.division) { - var division = ({gatherer.user.profile.division}); + if (gatherer.user.profile.skill) { + var skill = ({gatherer.user.profile.skill}); } var abilities = []; @@ -686,7 +686,7 @@ var Gatherers = React.createClass({

{gatherer.user.username}

-

{country} {lifeform} {division} {team}

+

{country} {lifeform} {skill} {team}

{action}  diff --git a/lib/react/user.jsx b/lib/react/user.jsx index b4e8ad8..6494c0d 100644 --- a/lib/react/user.jsx +++ b/lib/react/user.jsx @@ -109,12 +109,12 @@ var ProfileModal = React.createClass({ onos: React.findDOMNode(this.refs.onos).checked, commander: React.findDOMNode(this.refs.commander).checked }; - let division = React.findDOMNode(this.refs.playerskill).value; + let skill = React.findDOMNode(this.refs.playerskill).value; socket.emit("users:update:profile", { id: this.props.user.id, profile: { abilities: abilities, - division: division + skill: skill } }); }, @@ -134,10 +134,10 @@ var ProfileModal = React.createClass({ ); } - let division = this.props.user.profile.division; + let division = this.props.user.profile.skill; - let skillLevels = ["Div 1", "Div 2", "Div 3", "Div 4"].map(skill => { - if (skill === division) { + let skillLevels = ["Low Skill", "Medium Skill", "High Skill"].map(skill => { + if (skill === skill) { return } else { return @@ -151,6 +151,7 @@ var ProfileModal = React.createClass({ +

Try to give an accurate representation of your skill to raise the quality of your gathers

{abilitiesForm}