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

View file

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