<commit_before>React = require 'react'
BS = require 'react-bootstrap'
_  = require 'underscore'

{RosterStore, RosterActions} = require '../../flux/roster'
ChangePeriodLink  = require './change-period'
DeleteStudentLink = require './delete-student'
ResetPasswordLink = require './reset-password'
AddStudentButton  = require './add-student'
module.exports = React.createClass
  displayName: 'PeriodRoster'
  propTypes:
    courseId: React.PropTypes.string.isRequired
    period: React.PropTypes.object.isRequired

  renderStudentRow: (student) ->
    <tr key={student.id}>
      <td>{student.full_name}</td>
      <td>{student.id}</td>
      <td>{student.email}</td>
      <td className="actions">
        <ResetPasswordLink courseId={@props.courseId} student={student} />
        <ChangePeriodLink courseId={@props.courseId} student={student} />
        <DeleteStudentLink student={student} />
      </td>
    </tr>

  render: ->
    <div className="period">
      <h3>Period: {@props.period.name}</h3>
      <BS.Row>
        <BS.Col sm=2>
          <AddStudentButton {...@props} />
        </BS.Col>
        <BS.Col smOffset=8 sm=2>
          <BS.Button block bsStyle='danger' className='btn-flat'>
            <i className='fa fa-trash' />
            Delete Period
            </BS.Button>
        </BS.Col>
      </BS.Row>
      <BS.Table striped bordered condensed hover className="roster">
        <thead>
          <tr>
            <th>Name</th>
            <th>Tutor ID</th>
            <th>Email</th>
            <th>Actions</th>
          </tr>
        </thead>
        <tbody>
          {for student in RosterStore.getStudentsForPeriod(@props.courseId, @props.period.id)
            @renderStudentRow(student)}
        </tbody>
      </BS.Table>
    </div><commit_msg>Hide email column.  Teacher can't view that data<commit_after>React = require 'react'
BS = require 'react-bootstrap'
_  = require 'underscore'

{RosterStore, RosterActions} = require '../../flux/roster'
ChangePeriodLink  = require './change-period'
DeleteStudentLink = require './delete-student'
ResetPasswordLink = require './reset-password'
AddStudentButton  = require './add-student'
module.exports = React.createClass
  displayName: 'PeriodRoster'
  propTypes:
    courseId: React.PropTypes.string.isRequired
    period: React.PropTypes.object.isRequired

  renderStudentRow: (student) ->
    <tr key={student.id}>
      <td>{student.full_name}</td>
      <td>{student.id}</td>
      <td className="actions">
        <ResetPasswordLink courseId={@props.courseId} student={student} />
        <ChangePeriodLink courseId={@props.courseId} student={student} />
        <DeleteStudentLink student={student} />
      </td>
    </tr>

  render: ->
    <div className="period">
      <h3>Period: {@props.period.name}</h3>
      <BS.Row>
        <BS.Col sm=2>
          <AddStudentButton {...@props} />
        </BS.Col>
        <BS.Col smOffset=8 sm=2>
          <BS.Button block bsStyle='danger' className='btn-flat'>
            <i className='fa fa-trash' />
            Delete Period
            </BS.Button>
        </BS.Col>
      </BS.Row>
      <BS.Table striped bordered condensed hover className="roster">
        <thead>
          <tr>
            <th>Name</th>
            <th>Tutor ID</th>
            <th>Actions</th>
          </tr>
        </thead>
        <tbody>
          {for student in RosterStore.getStudentsForPeriod(@props.courseId, @props.period.id)
            @renderStudentRow(student)}
        </tbody>
      </BS.Table>
    </div>
{'fraction_non_alphanumeric': 0.1519094766619519, 'fraction_numerical': 0.002828854314002829, 'mean_word_length': 2.3644148430066605, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 89, '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': '5103881', 'n_tokens_mistral': 1098, 'n_tokens_neox': 1078, 'n_words': 210}