mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-10 07:11:53 +00:00
Show vote results at selection stage
This commit is contained in:
parent
54f3ca0ed7
commit
6525b44714
1 changed files with 44 additions and 31 deletions
|
@ -570,16 +570,21 @@ var Gather = React.createClass({
|
||||||
|
|
||||||
var voting;
|
var voting;
|
||||||
if (this.props.currentGatherer) {
|
if (this.props.currentGatherer) {
|
||||||
voting = (
|
let state = this.props.gather.state;
|
||||||
<div className="row add-top">
|
if (state === 'gathering' || state === 'election') {
|
||||||
<div className="col-md-6">
|
voting = (
|
||||||
<MapVoting {...this.props} />
|
<div className="row add-top">
|
||||||
|
<div className="col-md-6">
|
||||||
|
<MapVoting {...this.props} />
|
||||||
|
</div>
|
||||||
|
<div className="col-md-6">
|
||||||
|
<ServerVoting {...this.props} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-md-6">
|
);
|
||||||
<ServerVoting {...this.props} />
|
} else {
|
||||||
</div>
|
voting = <GatherVotingResults gather={this.props.gather} servers={this.props.servers} maps={this.props.maps} />;
|
||||||
</div>
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var gatherTeams;
|
var gatherTeams;
|
||||||
|
@ -663,7 +668,7 @@ var Gatherers = React.createClass({
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
if (gatherer.team !== "lobby") {
|
if (gatherer.team !== "lobby") {
|
||||||
action = (<span className="label label-success">{gatherer.team}</span>);
|
action = (<span className="label label-primary">{gatherer.team}</span>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -720,6 +725,20 @@ var Gatherers = React.createClass({
|
||||||
});
|
});
|
||||||
|
|
||||||
var CompletedGather = React.createClass({
|
var CompletedGather = React.createClass({
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div className="panel panel-default">
|
||||||
|
<div className="panel-heading">
|
||||||
|
<strong>Previous Gather</strong>
|
||||||
|
</div>
|
||||||
|
<GatherTeams gather={this.props.gather} />
|
||||||
|
<GatherVotingResults gather={this.props.gather} maps={this.props.maps} servers={this.props.servers}/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var GatherVotingResults = React.createClass({
|
||||||
countVotes(voteType) {
|
countVotes(voteType) {
|
||||||
return this.props.gather.gatherers.reduce((acc, gatherer) => {
|
return this.props.gather.gatherers.reduce((acc, gatherer) => {
|
||||||
if (gatherer[voteType] !== null) acc.push(gatherer[voteType]);
|
if (gatherer[voteType] !== null) acc.push(gatherer[voteType]);
|
||||||
|
@ -739,27 +758,21 @@ var CompletedGather = React.createClass({
|
||||||
var maps = this.selectedMaps();
|
var maps = this.selectedMaps();
|
||||||
var server = this.selectedServer().pop();
|
var server = this.selectedServer().pop();
|
||||||
return (
|
return (
|
||||||
<div className="panel panel-default">
|
<div className="panel-body">
|
||||||
<div className="panel-heading">
|
<dl className="dl-horizontal">
|
||||||
<strong>Previous Gather</strong>
|
<dt>Maps</dt>
|
||||||
</div>
|
<dd>{maps.map(map => map.name).join(" & ")}</dd>
|
||||||
<GatherTeams gather={this.props.gather} />
|
<dt>Server</dt>
|
||||||
<div className="panel-body">
|
<dd>{server.name}</dd>
|
||||||
<dl className="dl-horizontal">
|
<dt>Address</dt>
|
||||||
<dt>Maps</dt>
|
<dd>{server.ip}:{server.port}</dd>
|
||||||
<dd>{maps.map(map => map.name).join(" & ")}</dd>
|
<dt>Password</dt>
|
||||||
<dt>Server</dt>
|
<dd>{server.password}</dd>
|
||||||
<dd>{server.name}</dd>
|
<br />
|
||||||
<dt>Address</dt>
|
<dt> </dt>
|
||||||
<dd>{server.ip}:{server.port}</dd>
|
<dd><a href={["steam://run/4920/connect", server.ip +":"+server.port, server.password].join("/")}
|
||||||
<dt>Password</dt>
|
className="btn btn-primary">Click to Join</a></dd>
|
||||||
<dd>{server.password}</dd>
|
</dl>
|
||||||
<br />
|
|
||||||
<dt> </dt>
|
|
||||||
<dd><a href={["steam://run/4920/connect", server.ip +":"+server.port, server.password].join("/")}
|
|
||||||
className="btn btn-primary">Click to Join</a></dd>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue