<commit_before>var React = require("react");
var Reflux = require("reflux");
var Router = require("react-router");

var api = require("../api");
var BreadcrumbMixin = require("../mixins/breadcrumbMixin");
var LoadingError = require("../components/loadingError");
var LoadingIndicator = require("../components/loadingIndicator");
var PropTypes = require("../proptypes");
var utils = require("../utils");

var GroupDetails = React.createClass({
  contextTypes: {
    router: React.PropTypes.func
  },

  mixins: [
    BreadcrumbMixin
  ],

  propTypes: {
    setProjectNavSection: React.PropTypes.func.isRequired
  },

  crumbReservations: 1,

  childContextTypes: {
    release: PropTypes.AnyModel,
  },

  getChildContext() {
    return {
      release: this.state.release,
    };
  },

  getInitialState() {
    return {
      release: null,
      loading: true,
      error: false
    };
  },

  componentWillMount() {
    var params = this.context.router.getCurrentParams();
    this.setBreadcrumbs([
      {name: params.version, to: 'releaseDetails'}
    ]);
    this.props.setProjectNavSection('releases');
    this.fetchData();
  },

  fetchData() {
    this.setState({
      loading: true,
      error: false
    });

    api.request(this.getReleaseDetailsEndpoint(), {
      success: (data) => {
        this.setState({
          loading: false,
          release: data
        });
      }, error: () => {
        this.setState({
          loading: false,
          error: true
        });
      }
    });
  },

  getReleaseDetailsEndpoint() {
    var params = this.context.router.getCurrentParams();
    var orgId = params.orgId;
    var projectId = params.projectId;
    var version = params.version;

    return '/projects/' + orgId + '/' + projectId + '/releases/' + version + '/';
  },

  render() {
    if (this.state.loading)
      return <LoadingIndicator />;
    else if (this.state.error)
      return <LoadingError onRetry={this.fetchData} />;

    return (
      <div className={this.props.className}>
        <div className="release-details">
          <div className="row">
            <div className="col-md-7">
              <h2>Release <strong>7.7.0.dev0</strong></h2>
              <div className="release-meta">
                <span className="icon icon-clock"></span> <time>2 hours ago</time>
              </div>
            </div>
            <div className="col-md-5">
              <div className="row release-stats">
                <div className="col-md-4">
                  <h6 className="nav-header">events</h6>
                  <div className="count">123</div>
                </div>
                <div className="col-md-4">
                  <h6 className="nav-header">users</h6>
                  <div className="count">123</div><commit_msg>Add byline to release<commit_after>var React = require("react");
var Reflux = require("reflux");
var Router = require("react-router");

var api = require("../api");
var BreadcrumbMixin = require("../mixins/breadcrumbMixin");
var LoadingError = require("../components/loadingError");
var LoadingIndicator = require("../components/loadingIndicator");
var PropTypes = require("../proptypes");
var utils = require("../utils");

var GroupDetails = React.createClass({
  contextTypes: {
    router: React.PropTypes.func
  },

  mixins: [
    BreadcrumbMixin
  ],

  propTypes: {
    setProjectNavSection: React.PropTypes.func.isRequired
  },

  crumbReservations: 1,

  childContextTypes: {
    release: PropTypes.AnyModel,
  },

  getChildContext() {
    return {
      release: this.state.release,
    };
  },

  getInitialState() {
    return {
      release: null,
      loading: true,
      error: false
    };
  },

  componentWillMount() {
    var params = this.context.router.getCurrentParams();
    this.setBreadcrumbs([
      {name: params.version, to: 'releaseDetails'}
    ]);
    this.props.setProjectNavSection('releases');
    this.fetchData();
  },

  fetchData() {
    this.setState({
      loading: true,
      error: false
    });

    api.request(this.getReleaseDetailsEndpoint(), {
      success: (data) => {
        this.setState({
          loading: false,
          release: data
        });
      }, error: () => {
        this.setState({
          loading: false,
          error: true
        });
      }
    });
  },

  getReleaseDetailsEndpoint() {
    var params = this.context.router.getCurrentParams();
    var orgId = params.orgId;
    var projectId = params.projectId;
    var version = params.version;

    return '/projects/' + orgId + '/' + projectId + '/releases/' + version + '/';
  },

  render() {
    if (this.state.loading)
      return <LoadingIndicator />;
    else if (this.state.error)
      return <LoadingError onRetry={this.fetchData} />;

    return (
      <div className={this.props.className}>
        <div className="release-details">
          <div className="row">
            <div className="col-md-7">
              <h2>Release <strong>7.7.0.dev0</strong></h2>
              <div className="release-meta">
                <span className="icon icon-clock"></span> <time>2 hours ago</time> by <a href="#">dcramer</a>
              </div>
            </div>
            <div className="col-md-5">
              <div className="row release-stats">
                <div className="col-md-4">
                  <h6 className="nav-header">events</h6>
                  <div className="count">123</div>
                </div>
                <div className="col-md-4">
                  <h6 className="nav-header">users</h6>
                  <div className="count">123</div>
{'fraction_non_alphanumeric': 0.15284465846263598, 'fraction_numerical': 0.007847333690030319, 'mean_word_length': 2.2453703703703702, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 69, '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': '6739074', 'n_tokens_mistral': 1690, 'n_tokens_neox': 1645, 'n_words': 315}