Blame view
imports/client/views/org/admin/students/StudentView.js
2.96 KB
7aa6f173b
|
1 2 3 4 5 |
import _ from 'lodash'; import { Meteor } from 'meteor/meteor'; import React, { Component } from 'react'; import { Link,browserHistory } from 'react-router'; |
02bf55675
|
6 7 8 9 10 |
import { Navbar,Modal, Nav, NavItem, Glyphicon, Collapse, FormGroup, FormControl, Panel, NavbarToggler, NavbarBrand, Table, ButtonToolbar, NavLink, DropdownItem, DropdownToggle, DropdownMenu, NavDropdown, MenuItem, Breadcrumb, Button } from 'react-bootstrap'; |
5d043355e
|
11 |
import { StudentTable } from './view/StudentTable'; |
d75229d74
|
12 13 14 |
import { Header } from '../Header'; import { AdminSidebar } from '../Sidebar' import { AdminBreadcrumb } from '../Breadcrumb' |
15998a6af
|
15 |
import { UploadCsv } from './UploadCsv'; |
dbafa68d2
|
16 |
import { AddStudent } from './add/addStudent'; |
b02441289
|
17 |
import { Students } from '/imports/collections/students/index'; |
dbafa68d2
|
18 |
import './student.css' |
7aa6f173b
|
19 20 21 22 23 24 |
export class StudentView extends Component { constructor(props) { super(props); this.state = { |
af71e7fcd
|
25 26 27 |
show: false, firstNameSearch: "", lastNameSearch: "", |
7aa6f173b
|
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
}; 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() { |
af71e7fcd
|
46 |
firstNameSearch = this.state.firstNameSearch; |
b02441289
|
47 |
lastNameSearch = this.state.lastNameSearch; |
af71e7fcd
|
48 |
var students =_.filter(this.props.data.students,function(item){ |
5d043355e
|
49 50 51 |
if(item.firstName){ return _.includes(item.firstName.toLowerCase(),firstNameSearch.toLowerCase()); } |
af71e7fcd
|
52 |
}); |
7aa6f173b
|
53 |
return ( |
02bf55675
|
54 55 56 |
<div className="appLayout-box"> <div className="page-container"> <div className="page-content"> |
d75229d74
|
57 58 59 60 |
<AdminSidebar user = {this.props.data.user} org = {this.props.data.org} /> |
02bf55675
|
61 62 |
{/*end sidebar*/} <div className="content-wrapper"> |
d75229d74
|
63 |
<AdminBreadcrumb /> |
02bf55675
|
64 |
{/*content*/} |
5d043355e
|
65 |
|
02bf55675
|
66 67 |
<div className="content has-detached-left"> <div className="container-detached"> |
df05c55ea
|
68 |
<div className=""> |
02bf55675
|
69 70 71 72 73 74 75 76 77 |
<Header/> <StudentTable data = {this.props.data} students = {students} /> <AddStudent/> <UploadCsv /> </div> </div> |
02bf55675
|
78 79 80 81 82 |
</div> </div> </div> </div> </div> |
7aa6f173b
|
83 84 85 86 |
); }; }; |