<commit_before>EC.TeacherPricingMini = React.createClass({

  // TODO: make route for free trial that depends on if they are signed in or not, add stripe integration to free trial

  charge: function() {
    if (this.state.signedIn === true) {
      new EC.modules.Stripe();
    } else {
      this.pleaseLoginModal();
    }
  },

  getInitialState: function() {
    return {isUserSignedIn: $('#user-logged-in').data().signedIn === true};
  },

  beginTrial: function() {
  if (this.state.signedIn === true) {
    $.post('/subscriptions', {account_limit: 1000, account_type: 'trial'})
    .success(function(){window.location.assign('/teachers/classrooms/scorebook');});
  } else {
    this.pleaseLoginModal();
  }
  },

  pleaseLoginModal: function() {
    $(this.refs.pleaseLoginModal.getDOMNode()).modal();
  },

  render: function() {
    return (
      <div className='pricing-mini'>
        <header className='pricing-mini-header blue'>
          <div className='img-holder'>
            <img src="/images/teacher_premium_icon.png" alt="teacher_premium_icon"/>
          </div>

          <h4>Teacher Premium</h4><commit_msg>fixes bug affecting modals for signed in users<commit_after>EC.TeacherPricingMini = React.createClass({

  // TODO: make route for free trial that depends on if they are signed in or not, add stripe integration to free trial

  charge: function() {
    if (this.state.signedIn === true) {
      new EC.modules.Stripe();
    } else {
      this.pleaseLoginModal();
    }
  },

  getInitialState: function() {
    return {isUserSignedIn: ($('#user-logged-in').data().signedIn === true)};
  },

  beginTrial: function() {
  if (this.state.isUserSignedIn === true) {
    $.post('/subscriptions', {account_limit: 1000, account_type: 'trial'})
    .success(function(){window.location.assign('/teachers/classrooms/scorebook');});
  } else {
    this.pleaseLoginModal();
  }
  },

  pleaseLoginModal: function() {
    $(this.refs.pleaseLoginModal.getDOMNode()).modal();
  },

  render: function() {
    return (
      <div className='pricing-mini'>
        <header className='pricing-mini-header blue'>
          <div className='img-holder'>
            <img src="/images/teacher_premium_icon.png" alt="teacher_premium_icon"/>
          </div>

          <h4>Teacher Premium</h4>
{'fraction_non_alphanumeric': 0.15645371577574968, 'fraction_numerical': 0.005215123859191656, 'mean_word_length': 3.2316176470588234, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '5107937', 'n_tokens_mistral': 756, 'n_tokens_neox': 705, 'n_words': 148}