Blame view
imports/client/views/org/admin/students/StudentView.js
3.41 KB
7aa6f173b
|
1 2 3 4 5 6 7 8 |
import _ from 'lodash'; import { Meteor } from 'meteor/meteor'; import React, { Component } from 'react'; import { Link,browserHistory } from 'react-router'; import { FormGroup,Panel,Table, ButtonToolbar,Modal, FormControl,Glyphicon,Button } from 'react-bootstrap'; |
796a9c53f
|
9 |
import { AddStudent } from './addStudent'; |
7aa6f173b
|
10 11 |
import { StudentTable } from './StudentTable'; import { Header } from './Header'; |
796a9c53f
|
12 |
import { FabMenuView } from './FabMenu'; |
15998a6af
|
13 |
import { UploadCsv } from './UploadCsv'; |
b02441289
|
14 |
import { Students } from '/imports/collections/students/index'; |
15998a6af
|
15 |
|
7aa6f173b
|
16 17 18 19 20 21 |
export class StudentView extends Component { constructor(props) { super(props); this.state = { |
af71e7fcd
|
22 23 24 |
show: false, firstNameSearch: "", lastNameSearch: "", |
7aa6f173b
|
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
}; this.showModal = this.showModal.bind(this); this.hideModal = this.hideModal.bind(this); this.onUpdate = this.onUpdate.bind(this); }; showModal() { this.setState({show: true}); } hideModal() { this.setState({show: false}); } onUpdate(key, value) { this.setState({[key]: value}); }; render() { |
b02441289
|
43 |
console.log(this.props); |
af71e7fcd
|
44 |
firstNameSearch = this.state.firstNameSearch; |
b02441289
|
45 |
lastNameSearch = this.state.lastNameSearch; |
af71e7fcd
|
46 |
var students =_.filter(this.props.data.students,function(item){ |
af71e7fcd
|
47 48 |
return _.includes(item.firstName.toLowerCase(),firstNameSearch.toLowerCase()); }); |
7aa6f173b
|
49 50 51 52 53 54 55 |
return ( <div className="content has-detached-left"> <div className="container-detached"> <div className="content-detached"> <Header/> <StudentTable data = {this.props.data} |
af71e7fcd
|
56 |
students = {students} |
7aa6f173b
|
57 |
/> |
796a9c53f
|
58 |
<AddStudent/> |
15998a6af
|
59 |
<UploadCsv /> |
7aa6f173b
|
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
</div> </div> <div className="sidebar-detached affix-top"> <div className="sidebar sidebar-default"> <div className="sidebar-content"> <div className="sidebar-category"> <div className="category-title"> <span>Advanced Search</span> <ul className="icons-list"> <li><a href="#" data-action="collapse"></a></li> </ul> </div> <div className="category-content"> <form action="#"> <div className="has-feedback has-feedback-left"> |
af71e7fcd
|
77 78 79 80 81 |
<input type="search" className="form-control" value={this.state.firstNameSearch} onChange={e=>this.onUpdate('firstNameSearch',e.target.value)} placeholder="First Name" /> |
7aa6f173b
|
82 83 84 85 86 87 88 89 90 |
<div className="form-control-feedback"> <i className="icon-search4 text-size-base text-muted"></i> </div> </div> </form> </div> <div className="category-content"> <form action="#"> <div className="has-feedback has-feedback-left"> |
af71e7fcd
|
91 92 93 94 |
<input type="search" className="form-control" value={this.state.lastNameSearch} onChange={e=>this.onUpdate('lastNameSearch',e.target.value)} placeholder="Last Name" /> |
7aa6f173b
|
95 96 97 98 99 100 |
<div className="form-control-feedback"> <i className="icon-search4 text-size-base text-muted"></i> </div> </div> </form> </div> |
796a9c53f
|
101 |
|
7aa6f173b
|
102 103 104 105 106 107 108 109 110 111 112 |
</div> </div> </div> </div> </div> ); }; }; |