main-project/app/client/src/Components/Admin/SelectClass.js
/*
    Creates the list of Links displayed to the user.
    Only renders those views that are selected (i.e. only one of active and
    archived at a time).
    Rerendered on state change (specifically, after selection of the other kind of
    class).
   */
Creates the list of Links displayed to the user.
Only renders those views that are selected .
Rerendered on state change (specifically, after selection of the other kind of
class).
Creates the list of Links displayed to the user . Only renders those views that are selected . Rerendered on state change ( specifically after selection of the other kind of class ) .
generateSelectionList() {
    const compiledList = [];
    for (let classEntry of this.state.classList) {
      if (classEntry.ongoing === this.state.onGoing) {
        compiledList.push(
          <tr
            className={`${classEntry.ongoing ? "sluTeacher" : "sluAdmin"}`}
            onClick={e => {
              this.props.history.push(`/a/class/${classEntry.id}`);
            }}
            key={classEntry.id}
          >
            <td>{classEntry.title}</td>
          </tr>
        );
      }
    }
    return compiledList;
  }
generateSelectionList ( ) { const compiledList = [ ] ; for ( let classEntry of this . state . classList ) { if ( classEntry . ongoing === this . state . onGoing ) { compiledList . push ( < tr className = { ` ${ classEntry . ongoing ? "sluTeacher" : "sluAdmin" } ` } onClick = { e => { this . props . history . push ( ` ${ classEntry . id } ` ) ; } } key = { classEntry . id } > < td > { classEntry . title } < / td > < / tr > ) ; } } return compiledList ; }
Creates the list of Links displayed to the user.
Creates the list of Links displayed to the user .
//ClassNames refer to colours. This is a port of SelectUser, after all.