diff --git a/lib/react/gather.jsx b/lib/react/gather.jsx
index e3377b3..6b5616a 100644
--- a/lib/react/gather.jsx
+++ b/lib/react/gather.jsx
@@ -69,17 +69,11 @@ var SelectPlayerButton = React.createClass({
}
});
-var GatherTeams = React.createClass({
- alienGatherers: function () {
+var GathererList = React.createClass({
+ memberList: function () {
+ var self = this;
return this.props.gather.gatherers.filter(function (gatherer) {
- return gatherer.team === "alien";
- }).sort(function (gatherer) {
- return (gatherer.leader) ? 1 : -1;
- });
- },
- marineGatherers: function () {
- return this.props.gather.gatherers.filter(function (gatherer) {
- return gatherer.team === "marine";
+ return gatherer.team === self.props.team;
}).sort(function (gatherer) {
return (gatherer.leader) ? 1 : -1;
});
@@ -100,8 +94,19 @@ var GatherTeams = React.createClass({
);
}
- var marines = this.marineGatherers().map(extractGatherer);
- var aliens = this.alienGatherers().map(extractGatherer);
+ var members = this.memberList().map(extractGatherer);
+ return (
+
+ );
+ }
+});
+
+var GatherTeams = React.createClass({
+ render: function () {
return (
@@ -110,11 +115,7 @@ var GatherTeams = React.createClass({
Aliens
-
+
@@ -122,18 +123,14 @@ var GatherTeams = React.createClass({
Marines
-
+
);
}
-})
+});
var ElectionProgressBar = React.createClass({
componentDidMount: function () {
@@ -458,7 +455,6 @@ var Gather = React.createClass({
componentDidMount: function () {
var self = this;
socket.on("gather:refresh", function (data) {
- console.log(data);
self.setProps(data);
});
},
@@ -566,7 +562,7 @@ var Gatherers = React.createClass({
return (
- {country} {gatherer.user.username} |
+ {country} {gatherer.user.username} ({gatherer.user.id}) |
{lifeform} {division} {team}
|
@@ -599,24 +595,44 @@ var Gatherers = React.createClass({
});
var CompletedGather = React.createClass({
- votedMaps: function () {
-
+ countVotes: function (voteType) {
+ return this.props.gather.gatherers.reduce(function (acc, gatherer) {
+ if (gatherer[voteType] !== null) acc.push(gatherer[voteType]);
+ return acc;
+ }, []);
},
- votedServer: function () {
-
+ selectedMaps: function () {
+ // console.log(this.countVotes('mapVote'))
+ return rankVotes(this.countVotes('mapVote'), this.props.maps).slice(0, 2)
+ },
+ selectedServer: function () {
+ return rankVotes(this.countVotes('serverVote'), this.props.servers).slice(0, 1);
},
render: function () {
+ var maps = this.selectedMaps();
+ var server = this.selectedServer().pop();
return (
- Gather Completed
-
-
-
Join Up:
-
Map Voted: To be completed
-
Server Voted: To be completed
+
Gather Details
+
+
+ - Maps
+ - {maps.map(function(map) { return map.name}).join(" & ")}
+ - Server
+ - {server.name}
+ - Address
+ - {server.ip}:{server.port}
+ - Password
+ - {server.password}
+
+ -
+ - Click to Join
+
+
);
}
diff --git a/lib/react/user.jsx b/lib/react/user.jsx
index f3d8506..8d7f9c0 100644
--- a/lib/react/user.jsx
+++ b/lib/react/user.jsx
@@ -7,7 +7,7 @@ var UserLogin = React.createClass({
});
setTimeout(function () {
socket.emit("gather:refresh");
- }, 5000);
+ }, 1000);
},
handleSubmit: function (e) {
e.preventDefault();
@@ -112,7 +112,7 @@ var CurrentUser = React.createClass({
render: function () {
if (this.props.user) {
return (
-
+
{this.props.user.username}
+
\ No newline at end of file