<commit_before>/** @jsx React.DOM */

var Link = require('react-router').Link;
var RouteHandler = require('react-router').RouteHandler;
var React = require('react');
var gravatar = require('gravatar');

var Navbar = require('react-bootstrap').Navbar;
var Nav = require('react-bootstrap').Nav;
var NavItem = require('react-bootstrap').NavItem;

var FBUtils = require('../FBUtils');

var Tab = require('./Tab');

require('./ArthrobotApp.css');

var ArthrobotApp = React.createClass({

  getInitialState: function() {
    return {
      isAdministrator: false
    };
  },

  loadIsAdministrator: function() {
    if (!Parse.User.current()) {
      return;
    }
    var roleQuery = new Parse.Query(Parse.Role);
    roleQuery.equalTo('name', 'Administrator');
    roleQuery.find({
      success: function(roles) {
        if (roles.length > 0) {
          roles[0].getUsers().query().find({
            success: function(users) {
              for (var i = 0; i < users.length; i++) {
                if (users[i].id == Parse.User.current().id) {
                  this.setState({isAdministrator:true});
                  break;
                }
              }
            }.bind(this)
          });
        }
      }.bind(this)
    });
  },

  componentDidMount: function() {
    this.loadIsAdministrator();
  },

  render: function() {
    var navbar = [];
    var user = Parse.User.current();
    var anonUserNotice = null;
    if (user) {
      if (!user.get('email') && !user.get('authData')) {
        anonUserNotice = (
          <div className="text-center alert alert-danger">
          You are logged in anonymously! <Link to="signup" className="btn btn-primary">Create an Account</Link> to save your progress.
          </div>
        );
      }
      navbar = [
        <Link key="1" to="profile" params={{userId:user.id}}><img className="gravatar" src={FBUtils.getProfilePic(user)} /></Link>,
        <Tab key="2" to="logout">Logout</Tab>
      ];
    } else {
      navbar = [
        <Tab key="1" to="signup"><strong>Sign Up</strong></Tab>,
        <Tab key="2" to="login">Log In</Tab>
      ];
    }
    var brand = <Link to="landing">Arthrobots</Link>;
    return (
      <div className="container ArthrobotApp">
        {anonUserNotice}
        <Navbar brand={brand} fluid={true} className="navbar-inverse">
          <Nav>
            <Tab to="landing">Home</Tab>
            <Tab to="leaderboard">Leaderboard</Tab>
            {this.state.isAdministrator ? <Tab to="worlds">Worlds</Tab> : null}
          </Nav>
          <Nav className="navbar-right">
            {navbar}
          </Nav>
        </Navbar>

        <div className="row">
          <div className="col-md-12 app-content">
            <RouteHandler/>
          </div>
        </div>
        <div className="row footer">
          <div className="col-md-12">
            Created by <a href="http://github.com/pcardune" target="_blank">pcardune</a>
          </div>
        </div>
      </div>
    );
  }
});
<commit_msg>remove link to worlds page altogether<commit_after>/** @jsx React.DOM */

var Link = require('react-router').Link;
var RouteHandler = require('react-router').RouteHandler;
var React = require('react');
var gravatar = require('gravatar');

var Navbar = require('react-bootstrap').Navbar;
var Nav = require('react-bootstrap').Nav;
var NavItem = require('react-bootstrap').NavItem;

var FBUtils = require('../FBUtils');

var Tab = require('./Tab');

require('./ArthrobotApp.css');

var ArthrobotApp = React.createClass({

  render: function() {
    var navbar = [];
    var user = Parse.User.current();
    var anonUserNotice = null;
    if (user) {
      if (!user.get('email') && !user.get('authData')) {
        anonUserNotice = (
          <div className="text-center alert alert-danger">
          You are logged in anonymously! <Link to="signup" className="btn btn-primary">Create an Account</Link> to save your progress.
          </div>
        );
      }
      navbar = [
        <Link key="1" to="profile" params={{userId:user.id}}><img className="gravatar" src={FBUtils.getProfilePic(user)} /></Link>,
        <Tab key="2" to="logout">Logout</Tab>
      ];
    } else {
      navbar = [
        <Tab key="1" to="signup"><strong>Sign Up</strong></Tab>,
        <Tab key="2" to="login">Log In</Tab>
      ];
    }
    var brand = <Link to="landing">Arthrobots</Link>;
    return (
      <div className="container ArthrobotApp">
        {anonUserNotice}
        <Navbar brand={brand} fluid={true} className="navbar-inverse">
          <Nav>
            <Tab to="landing">Home</Tab>
            <Tab to="leaderboard">Leaderboard</Tab>
          </Nav>
          <Nav className="navbar-right">
            {navbar}
          </Nav>
        </Navbar>

        <div className="row">
          <div className="col-md-12 app-content">
            <RouteHandler/>
          </div>
        </div>
        <div className="row footer">
          <div className="col-md-12">
            Created by <a href="http://github.com/pcardune" target="_blank">pcardune</a>
          </div>
        </div>
      </div>
    );
  }
});

{'fraction_non_alphanumeric': 0.1706364701288559, 'fraction_numerical': 0.003709488481062085, 'mean_word_length': 2.2881899871630296, 'pattern_counts': {'":': 0, '<': 86, '<?xml version=': 0, '>': 86, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1036023', 'n_tokens_mistral': 1615, 'n_tokens_neox': 1557, 'n_words': 323}