Skip to content

Commit

Permalink
Hides branch button if url missing admin=1
Browse files Browse the repository at this point in the history
This adds the branch button to the interface, if the admin=1 parameter
is present in the url.
  • Loading branch information
neomorphic committed Jan 12, 2016
1 parent 8e676d5 commit d3610b0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/components/RepoDAG.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,13 @@ var RepoDAGDisplay = React.createClass({
},

render: function() {
var admin = this.context.router.getCurrentQuery().admin;

var branchButton = '';
if (admin) {
branchButton = <button className="btn btn-default" onClick={this.branchNode}>Branch</button>
}

return (
<div>
<h4>Version DAG <small> (Nodes with thick borders are locked.)</small></h4>
Expand All @@ -353,7 +360,7 @@ var RepoDAGDisplay = React.createClass({
<button className="btn btn-default" onClick={this.fitDAG}>Fit graph to window</button>
<button className="btn btn-default" onClick={this.expandGraph}>Expand graph</button>
<button className="btn btn-default" onClick={this.collapseGraph}>Collapse graph</button>
<button className="btn btn-default" onClick={this.branchNode}>Branch</button>
{branchButton}
</div>
<div className="dag">
<div>
Expand Down

0 comments on commit d3610b0

Please sign in to comment.