Blame view

imports/client/views/org/admin/students/StudentView.js 6.05 KB
7aa6f173b   Deepak   added student view
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   anuj_thakur   student view and ...
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   Deepak   fixed bug and add...
11
  import { StudentTable }                   from './view/StudentTable';
d75229d74   Deepak   fixed dob issue a...
12
13
14
  import { Header }                         from '../Header';
  import { AdminSidebar }                   from '../Sidebar'
  import { AdminBreadcrumb }                from '../Breadcrumb'
15998a6af   Deepak   added datepicker
15
  import { UploadCsv }                      from './UploadCsv';
dbafa68d2   Deepak   added teachers mo...
16
  import { AddStudent }                     from './add/addStudent';
b02441289   Deepak   added verify module
17
  import { Students }                       from '/imports/collections/students/index';
dbafa68d2   Deepak   added teachers mo...
18
  import './student.css'
7aa6f173b   Deepak   added student view
19
20
21
22
23
24
  
  export class StudentView extends Component {
  
    constructor(props) {
      super(props);
      this.state = {
af71e7fcd   Deepak   added search func...
25
26
27
        show: false,
        firstNameSearch: "",
        lastNameSearch: "",
7aa6f173b   Deepak   added student view
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   Deepak   added search func...
46
      firstNameSearch = this.state.firstNameSearch;
b02441289   Deepak   added verify module
47
      lastNameSearch = this.state.lastNameSearch;
af71e7fcd   Deepak   added search func...
48
      var students =_.filter(this.props.data.students,function(item){
5d043355e   Deepak   fixed bug and add...
49
50
51
        if(item.firstName){
            return _.includes(item.firstName.toLowerCase(),firstNameSearch.toLowerCase());
        }
af71e7fcd   Deepak   added search func...
52
      });
7aa6f173b   Deepak   added student view
53
      return (
02bf55675   anuj_thakur   student view and ...
54
55
56
          <div className="appLayout-box">
              <div className="page-container">
                  <div className="page-content">
d75229d74   Deepak   fixed dob issue a...
57
58
59
60
                  <AdminSidebar
                    user = {this.props.data.user}
                    org = {this.props.data.org}
                  />
02bf55675   anuj_thakur   student view and ...
61
62
              {/*end sidebar*/}
                      <div className="content-wrapper">
d75229d74   Deepak   fixed dob issue a...
63
                          <AdminBreadcrumb />
02bf55675   anuj_thakur   student view and ...
64
              {/*content*/}
5d043355e   Deepak   fixed bug and add...
65

02bf55675   anuj_thakur   student view and ...
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
                          <div className="content has-detached-left">
                              <div className="container-detached">
                                  <div className="content-detached">
                                      <Header/>
                                      <StudentTable
                                      data = {this.props.data}
                                      students = {students}
                                      />
                                    <AddStudent/>
                                    <UploadCsv />
                                  </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">
                                                          <input type="search" className="form-control"
                                                              value={this.state.firstNameSearch}
                                                              onChange={e=>this.onUpdate('firstNameSearch',e.target.value)}
                                                              placeholder="First Name"
                                                              />
                                                          <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">
                                                          <input type="search" className="form-control"
                                                              value={this.state.lastNameSearch}
                                                              onChange={e=>this.onUpdate('lastNameSearch',e.target.value)}
                                                              placeholder="Last Name" />
                                                          <div className="form-control-feedback">
                                                              <i className="icon-search4 text-size-base text-muted"></i>
                                                          </div>
                                                      </div>
                                                  </form>
                                              </div>
                                          </div>
                                      </div>
                                  </div>
                              </div>
                          </div>
                      </div>
                  </div>
              </div>
          </div>
7aa6f173b   Deepak   added student view
126
127
128
129
      );
    };
  
  };