mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2025-02-17 01:12:20 +00:00
Fix gather time and smarten up dropdown
This commit is contained in:
parent
d6d0e94b01
commit
028bae41c3
5 changed files with 56 additions and 34 deletions
|
@ -25,7 +25,7 @@ function Gather (options) {
|
||||||
|
|
||||||
this.TEAM_SIZE = 6;
|
this.TEAM_SIZE = 6;
|
||||||
this.gatherers = [];
|
this.gatherers = [];
|
||||||
this.ELECTION_INTERVAL = 10000; // 10 Seconds (temporarily)
|
this.ELECTION_INTERVAL = 300000; // 5 mins
|
||||||
this.electionStartTime = null;
|
this.electionStartTime = null;
|
||||||
this.initState();
|
this.initState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ var ElectionProgressBar = React.createClass({
|
||||||
return {
|
return {
|
||||||
num: msTranspired,
|
num: msTranspired,
|
||||||
den: interval,
|
den: interval,
|
||||||
barMessage: Math.floor((interval - msTranspired) / 100) + "s remaining"
|
barMessage: Math.floor((interval - msTranspired) / 1000) + "s remaining"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
componentWillUnmount: function () {
|
componentWillUnmount: function () {
|
||||||
|
|
|
@ -112,10 +112,32 @@ var CurrentUser = React.createClass({
|
||||||
render: function () {
|
render: function () {
|
||||||
if (this.props.user) {
|
if (this.props.user) {
|
||||||
return (
|
return (
|
||||||
<a href="#">{this.props.user.username} <img src={this.props.user.avatar}
|
<li class="dropdown">
|
||||||
alt="User Avatar"
|
<a className="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||||
height="20"
|
{this.props.user.username} <img src={this.props.user.avatar}
|
||||||
width="20" /></a>
|
alt="User Avatar"
|
||||||
|
height="20"
|
||||||
|
width="20" /> <i className="fa fa-caret-down"></i>
|
||||||
|
</a>
|
||||||
|
<ul className="dropdown-menu dropdown-user">
|
||||||
|
<li>
|
||||||
|
<a href="#"><i className="fa fa-gear fa-fw"></i> Profile</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#"><i className="fa fa-flag fa-fw"></i> Notifications</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#"><i className="fa fa-music fa-fw"></i> Sounds</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#" data-toggle="modal" data-target="#designmodal">Design Goals</a>
|
||||||
|
</li>
|
||||||
|
<li className="divider"></li>
|
||||||
|
<li><a href="login.html"><i className="fa fa-sign-out fa-fw"></i> Logout</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -143,7 +143,7 @@ var ElectionProgressBar = React.createClass({displayName: "ElectionProgressBar",
|
||||||
return {
|
return {
|
||||||
num: msTranspired,
|
num: msTranspired,
|
||||||
den: interval,
|
den: interval,
|
||||||
barMessage: Math.floor((interval - msTranspired) / 100) + "s remaining"
|
barMessage: Math.floor((interval - msTranspired) / 1000) + "s remaining"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
componentWillUnmount: function () {
|
componentWillUnmount: function () {
|
||||||
|
@ -910,10 +910,32 @@ var CurrentUser = React.createClass({displayName: "CurrentUser",
|
||||||
render: function () {
|
render: function () {
|
||||||
if (this.props.user) {
|
if (this.props.user) {
|
||||||
return (
|
return (
|
||||||
React.createElement("a", {href: "#"}, this.props.user.username, " ", React.createElement("img", {src: this.props.user.avatar,
|
React.createElement("li", {class: "dropdown"},
|
||||||
alt: "User Avatar",
|
React.createElement("a", {className: "dropdown-toggle", "data-toggle": "dropdown", href: "#"},
|
||||||
height: "20",
|
this.props.user.username, " ", React.createElement("img", {src: this.props.user.avatar,
|
||||||
width: "20"}))
|
alt: "User Avatar",
|
||||||
|
height: "20",
|
||||||
|
width: "20"}), " ", React.createElement("i", {className: "fa fa-caret-down"})
|
||||||
|
),
|
||||||
|
React.createElement("ul", {className: "dropdown-menu dropdown-user"},
|
||||||
|
React.createElement("li", null,
|
||||||
|
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-gear fa-fw"}), " Profile")
|
||||||
|
),
|
||||||
|
React.createElement("li", null,
|
||||||
|
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-flag fa-fw"}), " Notifications")
|
||||||
|
),
|
||||||
|
React.createElement("li", null,
|
||||||
|
React.createElement("a", {href: "#"}, React.createElement("i", {className: "fa fa-music fa-fw"}), " Sounds")
|
||||||
|
),
|
||||||
|
React.createElement("li", null,
|
||||||
|
React.createElement("a", {href: "#", "data-toggle": "modal", "data-target": "#designmodal"}, "Design Goals")
|
||||||
|
),
|
||||||
|
React.createElement("li", {className: "divider"}),
|
||||||
|
React.createElement("li", null, React.createElement("a", {href: "login.html"}, React.createElement("i", {className: "fa fa-sign-out fa-fw"}), " Logout")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -36,29 +36,7 @@
|
||||||
<a class="navbar-brand" href="/">ENSL.org Gathers <strong>Alpha</strong></a>
|
<a class="navbar-brand" href="/">ENSL.org Gathers <strong>Alpha</strong></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="nav navbar-top-links navbar-right">
|
<ul class="nav navbar-top-links navbar-right" id="currentuser">
|
||||||
<li class="dropdown">
|
|
||||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
|
||||||
<i class="fa fa-user fa-fw"></i> Settings <i class="fa fa-caret-down"></i>
|
|
||||||
</a>
|
|
||||||
<ul class="dropdown-menu dropdown-user">
|
|
||||||
<li><a href="#"><i class="fa fa-gear fa-fw"></i> Profile</a>
|
|
||||||
</li>
|
|
||||||
<li><a href="#"><i class="fa fa-flag fa-fw"></i> Notifications</a>
|
|
||||||
</li>
|
|
||||||
<li><a href="#"><i class="fa fa-music fa-fw"></i> Sounds</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="#" data-toggle="modal" data-target="#designmodal">Design Goals</a>
|
|
||||||
</li>
|
|
||||||
<li class="divider"></li>
|
|
||||||
<li><a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
<li id="currentuser">
|
|
||||||
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="navbar-default sidebar" role="navigation">
|
<div class="navbar-default sidebar" role="navigation">
|
||||||
|
|
Loading…
Reference in a new issue