Commit b02441289faa525d44e328f455bf8e626079d822
1 parent
c6b4fc634c
Exists in
master
added verify module
Showing
8 changed files
with
56 additions
and
17 deletions
Show diff stats
imports/client/views/nonOrg/app/module/AppLayout.js
... | ... | @@ -7,6 +7,7 @@ import { Icon } from '/imports/client/components/Icon' |
7 | 7 | import classNames from 'classnames'; |
8 | 8 | |
9 | 9 | import { logout } from '/imports/client/app/utils/loginMethods'; |
10 | +import { VerifyModule } from '/imports/client/views/verify/module/index' | |
10 | 11 | |
11 | 12 | import Signup from '/imports/client/views/nonOrg/enter/SignupView'; |
12 | 13 | import { Collapse, Navbar, NavbarToggler, | ... | ... |
imports/client/views/nonOrg/enter/SignupView.js
... | ... | @@ -5,6 +5,7 @@ import { Row, Col, FormGroup, |
5 | 5 | InputGroup, Button } from 'react-bootstrap'; |
6 | 6 | import handleSignup from './signup'; |
7 | 7 | import { Orgs } from '/imports/collections/orgs/index'; |
8 | +import './signup.css' | |
8 | 9 | |
9 | 10 | export default class Signup extends React.Component { |
10 | 11 | constructor(props) { | ... | ... |
imports/client/views/nonOrg/enter/signup.css
imports/client/views/org/admin/students/StudentTable.js
... | ... | @@ -7,6 +7,7 @@ import { FormGroup,Panel,Table, |
7 | 7 | ButtonToolbar,Modal, |
8 | 8 | FormControl,Glyphicon,Button } from 'react-bootstrap'; |
9 | 9 | import { AddStudentForm } from './addStudentForm'; |
10 | +import {moment} from 'meteor/momentjs:moment' | |
10 | 11 | |
11 | 12 | export class StudentTable extends Component { |
12 | 13 | |
... | ... | @@ -53,7 +54,7 @@ export class StudentTable extends Component { |
53 | 54 | <td>{student.firstName}</td> |
54 | 55 | <td>{student.lastName}</td> |
55 | 56 | <td>{student.class}</td> |
56 | - <td>{}</td> | |
57 | + <td>{student.dob? moment(student.dob).format("LL") : <span></span>}</td> | |
57 | 58 | <td><span className="label label-success">Active</span></td> |
58 | 59 | <td className="text-center"> |
59 | 60 | <ul className="icons-list"> | ... | ... |
imports/client/views/org/admin/students/StudentView.js
... | ... | @@ -11,6 +11,7 @@ import { StudentTable } from './StudentTable'; |
11 | 11 | import { Header } from './Header'; |
12 | 12 | import { FabMenuView } from './FabMenu'; |
13 | 13 | import { UploadCsv } from './UploadCsv'; |
14 | +import { Students } from '/imports/collections/students/index'; | |
14 | 15 | |
15 | 16 | |
16 | 17 | export class StudentView extends Component { |
... | ... | @@ -39,7 +40,9 @@ export class StudentView extends Component { |
39 | 40 | }; |
40 | 41 | |
41 | 42 | render() { |
43 | + console.log(this.props); | |
42 | 44 | firstNameSearch = this.state.firstNameSearch; |
45 | + lastNameSearch = this.state.lastNameSearch; | |
43 | 46 | var students =_.filter(this.props.data.students,function(item){ |
44 | 47 | return _.includes(item.firstName.toLowerCase(),firstNameSearch.toLowerCase()); |
45 | 48 | }); | ... | ... |
imports/client/views/org/admin/students/UploadCsv.js
... | ... | @@ -4,13 +4,22 @@ import { Meteor } from 'meteor/meteor'; |
4 | 4 | import React, { Component } from 'react'; |
5 | 5 | import { Link,browserHistory } from 'react-router'; |
6 | 6 | import { FormGroup,Panel,Table, |
7 | - ButtonToolbar,Modal, FieldGroup, | |
7 | + ButtonToolbar,Modal,ControlLabel,HelpBlock, | |
8 | 8 | FormControl,Glyphicon,Button } from 'react-bootstrap'; |
9 | -import { AddStudentForm } from './addStudentForm'; | |
9 | +// import { AddStudentForm } from './addStudentForm'; | |
10 | 10 | |
11 | 11 | const style = { |
12 | 12 | margin: 12, |
13 | 13 | }; |
14 | +function FieldGroup({ id, label, help, ...props }) { | |
15 | + return ( | |
16 | + <FormGroup controlId={id}> | |
17 | + <ControlLabel>{label}</ControlLabel> | |
18 | + <FormControl {...props} /> | |
19 | + {help && <HelpBlock>{help}</HelpBlock>} | |
20 | + </FormGroup> | |
21 | + ); | |
22 | +} | |
14 | 23 | export class UploadCsv extends Component { |
15 | 24 | constructor(props) { |
16 | 25 | super(props); |
... | ... | @@ -34,6 +43,7 @@ export class UploadCsv extends Component { |
34 | 43 | }; |
35 | 44 | |
36 | 45 | render() { |
46 | + console.log(this.props); | |
37 | 47 | return ( |
38 | 48 | <ButtonToolbar> |
39 | 49 | <Button bsStyle="primary" onClick={this.showModal}> |
... | ... | @@ -49,12 +59,14 @@ export class UploadCsv extends Component { |
49 | 59 | <Modal.Title id="contained-modal-title-lg">New Student</Modal.Title> |
50 | 60 | </Modal.Header> |
51 | 61 | <Modal.Body> |
62 | + <form> | |
52 | 63 | <FieldGroup |
53 | 64 | id="formControlsFile" |
54 | 65 | type="file" |
55 | 66 | label="File" |
56 | 67 | help="Example block-level help text here." |
57 | 68 | /> |
69 | + </form> | |
58 | 70 | </Modal.Body> |
59 | 71 | <Modal.Footer> |
60 | 72 | <Button onClick={this.hideModal}>Close</Button> | ... | ... |
imports/client/views/org/admin/students/index.js
... | ... | @@ -25,15 +25,22 @@ const meteorTick = (props, onData) => { |
25 | 25 | if(_.every(handles, (handle) => (handle.ready()) )) { |
26 | 26 | const user = Users.current(); |
27 | 27 | const org = Orgs.current(); |
28 | - const students = Users.find({"role":"STUDENT"}).fetch(); | |
29 | - const StudentData = Students.find().fetch(); | |
30 | - console.log("StudentData"); | |
31 | - console.log(StudentData); | |
28 | + students = Users.find({"role":"STUDENT"}).fetch(); | |
29 | + studentData = Students.find().fetch(); | |
30 | + for(var i=0; i< students.length; i++){ | |
31 | + for(var j=0; j< studentData.length; j++){ | |
32 | + if(students[i]._id == studentData[j].userId){ | |
33 | + students[i].class = studentData[j].class; | |
34 | + students[i].dob = studentData[j].dob; | |
35 | + } | |
36 | + } | |
37 | + } | |
32 | 38 | onData(null, { |
33 | 39 | data: { |
34 | - user: user, | |
35 | - org: org, | |
36 | - students:students | |
40 | + user: user, | |
41 | + org: org, | |
42 | + students: students, | |
43 | + studentData: studentData | |
37 | 44 | }, |
38 | 45 | }); |
39 | 46 | } | ... | ... |
imports/client/views/org/app/module/AppLayout.js
... | ... | @@ -8,11 +8,12 @@ import classNames from 'classnames'; |
8 | 8 | import { EnterModule } from '/imports/client/views/org/enter/module/index'; |
9 | 9 | // import { VerifyModule } from '/imports/client/views/verify/module/index'; |
10 | 10 | import { Navbar,Modal, Nav, NavItem, |
11 | - Glyphicon, Collapse, | |
11 | + Glyphicon, Collapse, | |
12 | 12 | NavbarToggler, NavbarBrand, |
13 | 13 | NavLink, DropdownItem, DropdownToggle, DropdownMenu, |
14 | 14 | NavDropdown, MenuItem } from 'react-bootstrap'; |
15 | - | |
15 | + import { VerifyModule } from '/imports/client/views/verify/module/index' | |
16 | + | |
16 | 17 | var Accordion = require('react-bootstrap').Accordion; |
17 | 18 | var Panel = require('react-bootstrap').Panel; |
18 | 19 | export class AppLayout extends Component { |
... | ... | @@ -29,27 +30,35 @@ export class AppLayout extends Component { |
29 | 30 | /> |
30 | 31 | ); |
31 | 32 | } |
33 | + if(!user.isEmailVerified()) { | |
34 | + return ( | |
35 | + <VerifyModule | |
36 | + pane = {this.props.location.query.verify} | |
37 | + location = {this.props.location} | |
38 | + /> | |
39 | + ); | |
40 | + } | |
32 | 41 | return ( |
33 | - | |
42 | + | |
34 | 43 | <div className = "appLayout-box"> |
35 | 44 | <div className="page-container"> |
36 | 45 | <div className="page-content"> |
37 | 46 | <div className="sidebar sidebar-main sidebar-default"> |
38 | 47 | <div className="sidebar-content"> |
39 | - | |
48 | + | |
40 | 49 | <div className="sidebar-category sidebar-category-visible"> |
41 | 50 | <div className="category-content no-padding"> |
42 | 51 | <Nav className="navigation navigation-main navigation-accordion"> |
43 | 52 | <NavItem className="navigation-header"><span>#schoolname</span> <i className="icon-menu" title="Main pages"></i></NavItem> |
44 | 53 | <NavItem className="active" eventKey={1} href="#"><i className="icon-home4"></i> <span>Dashboard</span></NavItem> |
45 | - | |
54 | + | |
46 | 55 | <NavDropdown eventKey={2} title="Settings" id="setting"> |
47 | 56 | <MenuItem eventKey={2.1}>Information</MenuItem> |
48 | 57 | <MenuItem eventKey={2.2}>Infrastructure</MenuItem> |
49 | 58 | <MenuItem eventKey={2.3}>Users</MenuItem> |
50 | 59 | <MenuItem eventKey={2.4}>Academic Settings</MenuItem> |
51 | 60 | <MenuItem eventKey={2.5}>Account Configuration</MenuItem> |
52 | - | |
61 | + | |
53 | 62 | </NavDropdown> |
54 | 63 | <li> |
55 | 64 | <a href="#"><i className="icon-copy"></i> <span>Academic</span></a> |
... | ... | @@ -154,7 +163,7 @@ export class AppLayout extends Component { |
154 | 163 | </div> |
155 | 164 | </div> |
156 | 165 | {/*end content*/} |
157 | - | |
166 | + | |
158 | 167 | </div> |
159 | 168 | </div> |
160 | 169 | ... | ... |