Add relevant message for voting

This commit is contained in:
Chris Blanchard 2015-08-27 16:11:54 +01:00
parent 16ffef6b6e
commit dc2ced3cde
2 changed files with 13 additions and 9 deletions

View file

@ -436,7 +436,6 @@ var ServerVoting = React.createClass({
render() { render() {
var self = this; var self = this;
let servers = self.props.servers.map(server => { let servers = self.props.servers.map(server => {
let voteButton;
let votes = self.votesForServer(server); let votes = self.votesForServer(server);
if (self.props.currentGatherer.serverVote === server.id) { if (self.props.currentGatherer.serverVote === server.id) {
return ( return (
@ -457,12 +456,12 @@ var ServerVoting = React.createClass({
} }
}); });
let message = (self.props.currentGatherer.serverVote !== null) ? "Server Votes" : "Please Vote for a Server"; let voted = self.props.currentGatherer.serverVote !== null;
return ( return (
<div className="panel panel-default"> <div className="panel panel-default">
<div className="panel-heading"> <div className="panel-heading">
{message} {voted ? "Server Votes" : "Please Vote for a Server" }
</div> </div>
<div className="list-group gather-voting"> <div className="list-group gather-voting">
{servers} {servers}
@ -493,7 +492,7 @@ var MapVoting = React.createClass({
render() { render() {
var self = this; var self = this;
var maps = self.props.maps.map(map => { let maps = self.props.maps.map(map => {
let votes = self.votesForMap(map); let votes = self.votesForMap(map);
if (self.props.currentGatherer.mapVote === map.id) { if (self.props.currentGatherer.mapVote === map.id) {
return ( return (
@ -516,10 +515,13 @@ var MapVoting = React.createClass({
); );
} }
}); });
let voted = (self.props.currentGatherer.mapVote !== null);
return ( return (
<div className="panel panel-default"> <div className="panel panel-default">
<div className="panel-heading"> <div className="panel-heading">
Map Voting {voted ? "Map Votes" : "Please Vote for a Map"}
</div> </div>
<div className="list-group gather-voting"> <div className="list-group gather-voting">
{maps} {maps}

View file

@ -623,7 +623,6 @@ var ServerVoting = React.createClass({
render: function render() { render: function render() {
var self = this; var self = this;
var servers = self.props.servers.map(function (server) { var servers = self.props.servers.map(function (server) {
var voteButton = undefined;
var votes = self.votesForServer(server); var votes = self.votesForServer(server);
if (self.props.currentGatherer.serverVote === server.id) { if (self.props.currentGatherer.serverVote === server.id) {
return React.createElement( return React.createElement(
@ -652,7 +651,7 @@ var ServerVoting = React.createClass({
} }
}); });
var message = self.props.currentGatherer.serverVote !== null ? "Server Votes" : "Please Vote for a Server"; var voted = self.props.currentGatherer.serverVote !== null;
return React.createElement( return React.createElement(
"div", "div",
@ -660,7 +659,7 @@ var ServerVoting = React.createClass({
React.createElement( React.createElement(
"div", "div",
{ className: "panel-heading" }, { className: "panel-heading" },
message voted ? "Server Votes" : "Please Vote for a Server"
), ),
React.createElement( React.createElement(
"div", "div",
@ -725,13 +724,16 @@ var MapVoting = React.createClass({
); );
} }
}); });
var voted = self.props.currentGatherer.mapVote !== null;
return React.createElement( return React.createElement(
"div", "div",
{ className: "panel panel-default" }, { className: "panel panel-default" },
React.createElement( React.createElement(
"div", "div",
{ className: "panel-heading" }, { className: "panel-heading" },
"Map Voting" voted ? "Map Votes" : "Please Vote for a Map"
), ),
React.createElement( React.createElement(
"div", "div",