<commit_before>$(function() {
  var ele = $('#students_classrooms_manager')[0]
  if (ele) {
    React.render(React.createElement(EC.StudentsClassroomsManager), ele)
  }
});


'use strict'
EC.StudentsClassroomsManager = React.createClass({

  getInitialState: function() {
    return {loading: true, classrooms: null};
  },

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

  getClassrooms: function() {
    $.ajax({
      url: "/students_classrooms/classroom_manager_data",
      context: this,
      success: function(data) {
        this.setState({classrooms: data, loading: false});
      }
    });
  },

 classAction: function(status, id) {
   var path = status == 'Archive' ? 'hide':'unhide';
   path = "/students_classrooms/" + id + '/' + path;
   $.ajax({url: path, type: 'POST', context: this, done: this.getClassrooms()});
 },

  mapClassrooms: function(classrooms, status) {
    var that = this;
    var classes = _.map(classrooms, function(cl) {
      return (
        <tr key={cl.id}>
          <td>{cl.teacherName}</td><commit_msg>adds students classroom manager<commit_after>$(function() {
  var ele = $('#students_classrooms_manager')[0]
  if (ele) {
    React.render(React.createElement(EC.StudentsClassroomsManager), ele)
  }
});


'use strict'
EC.StudentsClassroomsManager = React.createClass({

  getInitialState: function() {
    return {loading: true, classrooms: null};
  },

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

  getClassrooms: function() {
    $.ajax({
      url: "/students_classrooms/classroom_manager_data",
      context: this,
      success: function(data) {
        this.setState({classrooms: data, loading: false});
      }
    });
  },

 classAction: function(status, id) {
   var path = status == 'Archive' ? 'hide':'unhide';
   path = "/students_classrooms/" + id + '/' + path;
   $.ajax({url: path, type: 'POST', context: this, done: function() {
     this.getInitialState();
    //  this.getClassrooms()});
 },

  mapClassrooms: function(classrooms, status) {
    var that = this;
    var classes = _.map(classrooms, function(cl) {
      return (
        <tr key={cl.id}>
          <td>{cl.teacherName}</td>
{'fraction_non_alphanumeric': 0.1639269406392694, 'fraction_numerical': 0.0009132420091324201, 'mean_word_length': 3.3907815631262523, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5664545', 'n_tokens_mistral': 705, 'n_tokens_neox': 692, 'n_words': 142}