Fix gather time and smarten up dropdown

This commit is contained in:
Chris Blanchard 2015-07-31 17:20:52 +01:00
parent d6d0e94b01
commit 028bae41c3
5 changed files with 56 additions and 34 deletions

View file

@ -25,7 +25,7 @@ function Gather (options) {
this.TEAM_SIZE = 6;
this.gatherers = [];
this.ELECTION_INTERVAL = 10000; // 10 Seconds (temporarily)
this.ELECTION_INTERVAL = 300000; // 5 mins
this.electionStartTime = null;
this.initState();
}

View file

@ -143,7 +143,7 @@ var ElectionProgressBar = React.createClass({
return {
num: msTranspired,
den: interval,
barMessage: Math.floor((interval - msTranspired) / 100) + "s remaining"
barMessage: Math.floor((interval - msTranspired) / 1000) + "s remaining"
}
},
componentWillUnmount: function () {

View file

@ -112,10 +112,32 @@ var CurrentUser = React.createClass({
render: function () {
if (this.props.user) {
return (
<a href="#">{this.props.user.username} &nbsp;<img src={this.props.user.avatar}
alt="User Avatar"
height="20"
width="20" /></a>
<li class="dropdown">
<a className="dropdown-toggle" data-toggle="dropdown" href="#">
{this.props.user.username} &nbsp;<img src={this.props.user.avatar}
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 {
return false;

View file

@ -143,7 +143,7 @@ var ElectionProgressBar = React.createClass({displayName: "ElectionProgressBar",
return {
num: msTranspired,
den: interval,
barMessage: Math.floor((interval - msTranspired) / 100) + "s remaining"
barMessage: Math.floor((interval - msTranspired) / 1000) + "s remaining"
}
},
componentWillUnmount: function () {
@ -910,10 +910,32 @@ var CurrentUser = React.createClass({displayName: "CurrentUser",
render: function () {
if (this.props.user) {
return (
React.createElement("a", {href: "#"}, this.props.user.username, "  ", React.createElement("img", {src: this.props.user.avatar,
alt: "User Avatar",
height: "20",
width: "20"}))
React.createElement("li", {class: "dropdown"},
React.createElement("a", {className: "dropdown-toggle", "data-toggle": "dropdown", href: "#"},
this.props.user.username, "  ", React.createElement("img", {src: this.props.user.avatar,
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 {
return false;

View file

@ -36,29 +36,7 @@
<a class="navbar-brand" href="/">ENSL.org Gathers <strong>Alpha</strong></a>
</div>
<ul class="nav navbar-top-links navbar-right">
<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 class="nav navbar-top-links navbar-right" id="currentuser">
</ul>
<div class="navbar-default sidebar" role="navigation">