diff --git a/imports/client/app/routes.js b/imports/client/app/routes.js
index 048eee0..53b217a 100644
--- a/imports/client/app/routes.js
+++ b/imports/client/app/routes.js
@@ -26,10 +26,14 @@ import { importCsvController } from '/imports/client/views/org/impo
/**
Admin
**/
-import { StudentDataController } from '/imports/client/views/org/admin/settings/students/index'
-import { staffViewController } from '/imports/client/views/org/admin/settings/staff/index'
-import { ParentViewController } from '/imports/client/views/org/admin/settings/parents/index'
import { AdminSettingsController } from '/imports/client/views/org/admin/settings/index'
+//
+import { AdminUsersModule } from '/imports/client/views/org/admin/users/module/index'
+import { AdminUsersListController } from '/imports/client/views/org/admin/users/list/index'
+import { StudentDataController } from '/imports/client/views/org/admin/users/students/index'
+import { staffViewController } from '/imports/client/views/org/admin/users/staff/index'
+import { ParentViewController } from '/imports/client/views/org/admin/users/parents/index'
+
//Admin mail
import { AdminMailModule } from '/imports/client/views/org/admin/mailbox/module/index'
import { AdminInboxController } from '/imports/client/views/org/admin/mailbox/inbox/index'
@@ -56,20 +60,23 @@ There are three types of routes
**/
const getOrgAdminRoutes = () => (
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
)
diff --git a/imports/client/views/org/admin/settings/Header.js b/imports/client/views/org/admin/settings/Header.js
deleted file mode 100644
index 5659f97..0000000
--- a/imports/client/views/org/admin/settings/Header.js
+++ /dev/null
@@ -1,85 +0,0 @@
-import _ from 'lodash';
-import { Meteor } from 'meteor/meteor';
-
-import React, { Component } from 'react';
-import { Link,browserHistory } from 'react-router';
-import { FormGroup,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-import './header.css';
-
-
-export class Header extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
-
- };
- this.onUpdate = this.onUpdate.bind(this);
- };
-
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
-
- render() {
- return (
-
-
-
-
-
-
-
-
-

-
-
-
-
Students
-
Click to view
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
Teachers
-
Click to view
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
Parents
-
Click to view
-
-
-
-
-
-
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/header.css b/imports/client/views/org/admin/settings/header.css
deleted file mode 100644
index e45826e..0000000
--- a/imports/client/views/org/admin/settings/header.css
+++ /dev/null
@@ -1,10 +0,0 @@
-.img-circle
-{
- width: 70px;
- height: 70px;
-}
-
-.panel-body
-{
- overflow-y:hidden;
-}
diff --git a/imports/client/views/org/admin/settings/parents/index.js b/imports/client/views/org/admin/settings/parents/index.js
deleted file mode 100644
index a765b86..0000000
--- a/imports/client/views/org/admin/settings/parents/index.js
+++ /dev/null
@@ -1,72 +0,0 @@
-import _ from 'lodash';
-import {
- composeWithTracker,
- compose,
- composeAll
- } from 'react-komposer';
-import { Loading } from '/imports/client/components/Loading';
-
-import { Orgs } from '/imports/collections/orgs/index';
-import { Users } from '/imports/collections/users/index';
-import { Parents } from '/imports/collections/parents/index';
-import { ParentsView } from './parentsview';
-
-
-
-const meteorTick = (props, onData) => {
- Shelf.layout.set({
- bulb: 'SETTINGS',
- subbulb: 'USERS',
- view: 'PARENTS'
- });
- const handles = [
- Meteor.subscribe('users.current'),
- Meteor.subscribe('orgs.current'),
- Meteor.subscribe('users.forMyOrg'),
- Meteor.subscribe('parent.forMyOrg'),
- ];
-
- if(_.every(handles, (handle) => (handle.ready()) )) {
- const user = Users.current();
- const org = Orgs.current();
- console.log("parents");
- parent = Users.find({"role":"PARENT"}).fetch() ? Users.find({"role":"PARENT"}).fetch() : "";
- console.log(Users.find({"role":"PARENT"}).fetch());
- parentData = Parents.find().fetch() ? Parents.find().fetch() : "";
- console.log("parentData");
- console.log(parentData);
- for(var i=0; i< parent.length; i++){
- for(var j=0; j< parentData.length; j++){
- if(parent[i]._id == parentData[j].userId){
- parent[i].relationship = parentData[j].relationship;
- parent[i].profession = parentData[j].profession;
- parent[i].relationship = parentData[j].relationship;
- }
- }
- }
- onData(null, {
- data: {
- user: user,
- org: org,
- parent: parent
- },
- });
- }
-
- return () => {
- _.each(handles, (handle) => handle.stop() );
- };
-};
-
-
-const reduxTick = (props, onData) => {
- onData(null, {
- data: {}
- });
-};
-
-
-export const ParentViewController = composeAll(
- composeWithTracker(meteorTick, Loading),
- compose(reduxTick, Loading),
-)(ParentsView);
diff --git a/imports/client/views/org/admin/settings/parents/parentsview.js b/imports/client/views/org/admin/settings/parents/parentsview.js
deleted file mode 100644
index 432c86f..0000000
--- a/imports/client/views/org/admin/settings/parents/parentsview.js
+++ /dev/null
@@ -1,48 +0,0 @@
-import _ from 'lodash';
-import { Meteor } from 'meteor/meteor';
-
-import React, { Component } from 'react';
-import { Link,browserHistory } from 'react-router';
-import { FormGroup,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-import { Header } from '../Header';
-import { ParentTable } from './view/ParentTable'
-
-
-export class ParentsView extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
-
- };
- this.onUpdate = this.onUpdate.bind(this);
- };
-
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
- togglePanel(){
- this.setState({panleOpen: !this.state.panleOpen});
- }
-
- render() {
- const {user, org, parent} = this.props.data;
- return (
-
- );
- };
-
-
-};
diff --git a/imports/client/views/org/admin/settings/parents/view/ParentRow.js b/imports/client/views/org/admin/settings/parents/view/ParentRow.js
deleted file mode 100644
index 130b080..0000000
--- a/imports/client/views/org/admin/settings/parents/view/ParentRow.js
+++ /dev/null
@@ -1,54 +0,0 @@
-import _ from 'lodash';
-import { Meteor } from 'meteor/meteor';
-
-import React, { Component } from 'react';
-import { Link,browserHistory } from 'react-router';
-import { FormGroup,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-
-
- export class ParentRow extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
-
- };
- this.onUpdate = this.onUpdate.bind(this);
- };
-
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
-
- render() {
- const {parent} = this.props;
- if(parent.firstName){
- return (
-
- {parent.firstName} |
- {parent.relationship} | {/* relationship doesnt reflect here */}
- Active |
-
-
- |
-
- );
- }else {
- return null;
- }
-
- };
-
- };
diff --git a/imports/client/views/org/admin/settings/parents/view/ParentTable.js b/imports/client/views/org/admin/settings/parents/view/ParentTable.js
deleted file mode 100644
index 8bf1e54..0000000
--- a/imports/client/views/org/admin/settings/parents/view/ParentTable.js
+++ /dev/null
@@ -1,70 +0,0 @@
-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';
-import {moment} from 'meteor/momentjs:moment'
-import {ParentRow} from './ParentRow'
-import {BootstrapTable, TableHeaderColumn}from 'react-bootstrap-table';
-const options = {
- page: 0, // which page you want to show as default
- sizePerPageList: [ {
- text: '5', value: 5
- }, {
- text: '10', value: 10
- }], // you can change the dropdown list for size per page
- sizePerPage: 5, // which size per page you want to locate as default
- pageStartIndex: 0, // where to start counting the pages
- paginationSize: 3, // the pagination bar size.
- prePage: 'Prev', // Previous page button text
- nextPage: 'Next', // Next page button text
- firstPage: 'First', // First page button text
- lastPage: 'Last', // Last page button text
- paginationShowsTotal: false, // Accept bool or function
- paginationPosition: 'bottom' // default is bottom, top and both is all available
- // hideSizePerPage: true > You can hide the dropdown for sizePerPage
- // alwaysShowAllBtns: true // Always show next and previous button
- // withFirstAndLast: false > Hide the going to First and Last page button
- };
-
-export class ParentTable extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- show: false,
- panleOpen: true,
- };
- this.onUpdate = this.onUpdate.bind(this);
- };
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
-
- render() {
- return (
-
-
-
-
- Sr No
- Name
- Relationship
- Profession
-
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/staff/StaffView.js b/imports/client/views/org/admin/settings/staff/StaffView.js
deleted file mode 100644
index 47c73b8..0000000
--- a/imports/client/views/org/admin/settings/staff/StaffView.js
+++ /dev/null
@@ -1,44 +0,0 @@
-import _ from 'lodash';
-import { Meteor } from 'meteor/meteor';
-
-import React, { Component } from 'react';
-import { Link,browserHistory } from 'react-router';
-import { FormGroup,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-import { Header } from '../Header';
-import { StaffTable } from './view/StaffTable'
-import { AddStaff } from './add/addStaff'
-import { UploadCsvStaff } from './UploadCsvStaff'
-
-export class StaffView extends Component {
- constructor(props) {
- super(props);
- this.state = {
-
- };
- this.onUpdate = this.onUpdate.bind(this);
- };
-
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
-
- render() {
- const {user, org, staff} = this.props.data;
- return (
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/staff/UploadCsvStaff.js b/imports/client/views/org/admin/settings/staff/UploadCsvStaff.js
deleted file mode 100644
index 62da6d4..0000000
--- a/imports/client/views/org/admin/settings/staff/UploadCsvStaff.js
+++ /dev/null
@@ -1,103 +0,0 @@
-// import {UploadCsv } from '/imports/collections/students/UploadCsv'
-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,ControlLabel,HelpBlock,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-// import { AddStudentForm } from './addStudentForm';
-import { FilesCollection } from 'meteor/ostrio:files';
-const Papa = this.Papa;
-// console.log(this);
-const style = {
- margin: 12,
-};
-function FieldGroup({ id, label, help, ...props }) {
- return (
-
- {label}
-
- {help && {help}}
-
- );
-}
-export class UploadCsvStaff extends Component {
- constructor(props) {
- super(props);
- this.state = {
- show: false
- };
- 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});
- };
- uploadStaffCsv(e){
- e.preventDefault();
- e.persist();
- var file = $('input[type="file"]').prop("files")[0];
- Papa.parse(file, {
- header: true,
- complete: function(csvData) {
- console.log("csvData");
- console.log(csvData);
- if(csvData){
- Meteor.call('staff.uploadCsv', csvData, function (error, result) {
- console.log("error");
- console.log(error);
- console.log("result");
- console.log(result);
- })
- }
- }
- });
- }
-
- render() {
- console.log(this.props);
- return (
-
-
-
-
- Upload Csv
-
-
-
-
-
-
-
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/staff/add/AddStaffFormContainer.js b/imports/client/views/org/admin/settings/staff/add/AddStaffFormContainer.js
deleted file mode 100644
index da3af70..0000000
--- a/imports/client/views/org/admin/settings/staff/add/AddStaffFormContainer.js
+++ /dev/null
@@ -1,123 +0,0 @@
-import React, { Component } from 'react'
-import StaffForm from './StaffForm'
-import Form from '/imports/client/views/core/Form'
-import Validator from '/imports/client/views/core/Validator'
-import { isRequired, isValidEmail } from '/imports/client/views/core/validations'
-
-export class AddStaffFormContainer extends Component {
-
- constructor(props) {
- super(props)
- this.state = { currentStep: 0 }
- this.handleNextClick = this.handleNextClick.bind(this)
- this.handleBackClick = this.handleBackClick.bind(this)
- this.handleSubmit = this.handleSubmit.bind(this)
- }
-
- handleNextClick() {
- console.log("clicked");
- this.form.handleSubmit()
- if (this.validator.getErrors() && Object.keys(this.validator.getErrors()).length > 0) return
- console.log("after submit");
- this.setState({ currentStep: this.state.currentStep + 1 })
- this.form.resetSubmitted()
- }
-
- handleBackClick() {
- this.setState({ currentStep: this.state.currentStep + -1 })
- }
-
- handleSubmit() {
- if (this.state.currentStep === 3) {
- Meteor.call('staff.addNew', this.form.state.values, (error, result) => {
- console.log(error);
- console.log(result);
- if(!error){
- this.props.modalState();
- }
- });
- }
- }
-
- //render callback
- render() {
- return (
-
- )
- }
-}
diff --git a/imports/client/views/org/admin/settings/staff/add/StaffForm.js b/imports/client/views/org/admin/settings/staff/add/StaffForm.js
deleted file mode 100644
index ec763b6..0000000
--- a/imports/client/views/org/admin/settings/staff/add/StaffForm.js
+++ /dev/null
@@ -1,417 +0,0 @@
-import React, { PropTypes } from 'react'
-import {
- Row,
- Col,
- FormGroup,
- FormControl,
- Button
-} from 'react-bootstrap'
-import DatePicker from '/imports/client/views/core/DatePicker'
-import Label from '/imports/client/views/core/Label'
-import Stepper from '/imports/client/views/core/Stepper'
-import ErrorLabel from '/imports/client/views/core/ErrorLabel'
-
-const StaffForm = props => (
-
-
- {props.currentStep === 0 && (
-
- )}
- {props.currentStep === 1 && (
-
- )}
- {props.currentStep === 2 && (
-
- )}
- {props.currentStep === 3 && (
-
- )}
-
- {props.currentStep > 0 && (
-
-
-
-
- )}
- {props.currentStep < 3 && (
-
-
-
- )}
- {props.currentStep === 3 && (
-
-
-
- )}
-
-
-)
-
-StaffForm.propTypes = {
- currentStep: PropTypes.number.isRequired,
- onNextClick: PropTypes.func.isRequired,
- onBackClick: PropTypes.func.isRequired,
- setValue: PropTypes.func.isRequired,
- getValue: PropTypes.func.isRequired,
-}
-
-export default StaffForm
diff --git a/imports/client/views/org/admin/settings/staff/add/addStaff.js b/imports/client/views/org/admin/settings/staff/add/addStaff.js
deleted file mode 100644
index 2819b6b..0000000
--- a/imports/client/views/org/admin/settings/staff/add/addStaff.js
+++ /dev/null
@@ -1,66 +0,0 @@
-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';
-import { AddStaffFormContainer } from './AddStaffFormContainer';
-
-const style = {
- margin: 12,
-};
-export class AddStaff extends Component {
- constructor(props) {
- super(props);
- this.state = {
- show: false
- };
- 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() {
- return (
-
-
-
-
- Add New Staff
-
-
-
-
- {/*
-
-
-
- */}
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/staff/index.js b/imports/client/views/org/admin/settings/staff/index.js
deleted file mode 100644
index 75b547a..0000000
--- a/imports/client/views/org/admin/settings/staff/index.js
+++ /dev/null
@@ -1,70 +0,0 @@
-// import { InviteSignupController } from '/imports/client/views/invite/signup/index'
-import _ from 'lodash';
-import {
- composeWithTracker,
- compose,
- composeAll
- } from 'react-komposer';
-import { Loading } from '/imports/client/components/Loading';
-
-import { Orgs } from '/imports/collections/orgs/index';
-import { Users } from '/imports/collections/users/index';
-import { Staffs } from '/imports/collections/staff/index';
-import { StaffView } from './StaffView';
-
-const meteorTick = (props, onData) => {
- Shelf.layout.set({
- bulb: 'SETTINGS',
- subbulb: 'USERS',
- view: 'STAFF'
- });
- const handles = [
- Meteor.subscribe('users.current'),
- Meteor.subscribe('orgs.current'),
- Meteor.subscribe('users.forMyOrg'),
- Meteor.subscribe('staff.forMyOrg'),
- ];
-
- if(_.every(handles, (handle) => (handle.ready()) )) {
- const user = Users.current();
- const org = Orgs.current();
- staff = Users.find({"role":"STAFF"}).fetch() ? Users.find({"role":"STAFF"}).fetch() : "";
- console.log(Users.find({"role":"STAFF"}).fetch());
- staffData = Staffs.find().fetch() ? Staffs.find().fetch() : "";
- console.log("staffData");
- console.log(staffData);
- for(var i=0; i< staff.length; i++){
- for(var j=0; j< staffData.length; j++){
- if(staff[i]._id == staffData[j].userId){
- staff[i].type = staffData[j].type;
- staff[i].employeeId = staffData[j].employeeId;
- staff[i].dob = staffData[j].dob;
- }
- }
- }
- onData(null, {
- data: {
- user: user,
- org: org,
- staff: staff
- },
- });
- }
-
- return () => {
- _.each(handles, (handle) => handle.stop() );
- };
-};
-
-
-const reduxTick = (props, onData) => {
- onData(null, {
- data: {}
- });
-};
-
-
-export const staffViewController = composeAll(
- composeWithTracker(meteorTick, Loading),
- compose(reduxTick, Loading),
-)(StaffView);
diff --git a/imports/client/views/org/admin/settings/staff/view/StaffRow.js b/imports/client/views/org/admin/settings/staff/view/StaffRow.js
deleted file mode 100644
index f2438f6..0000000
--- a/imports/client/views/org/admin/settings/staff/view/StaffRow.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import _ from 'lodash';
-import { Meteor } from 'meteor/meteor';
-
-import React, { Component } from 'react';
-import { Link,browserHistory } from 'react-router';
-import { FormGroup,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-
-
-export class StaffRow extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
-
- };
- this.onUpdate = this.onUpdate.bind(this);
- };
-
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
-
- render() {
- const {staff} = this.props;
- if(staff.firstName){
- return (
-
- {staff.firstName} |
- {staff.lastName} |
- {staff.type} |
- {staff.dob? moment(staff.dob).format("LL") : } |
- Active |
-
-
- |
-
- );
- }else {
- return null;
- }
-
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/staff/view/StaffTable.js b/imports/client/views/org/admin/settings/staff/view/StaffTable.js
deleted file mode 100644
index 357d37a..0000000
--- a/imports/client/views/org/admin/settings/staff/view/StaffTable.js
+++ /dev/null
@@ -1,85 +0,0 @@
-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';
-import {moment} from 'meteor/momentjs:moment'
-import {StaffRow} from './StaffRow'
-import {BootstrapTable, TableHeaderColumn}from 'react-bootstrap-table';
-const options = {
- page: 0, // which page you want to show as default
- sizePerPageList: [ {
- text: '5', value: 5
- }, {
- text: '10', value: 10
- }], // you can change the dropdown list for size per page
- sizePerPage: 5, // which size per page you want to locate as default
- pageStartIndex: 0, // where to start counting the pages
- paginationSize: 3, // the pagination bar size.
- prePage: 'Prev', // Previous page button text
- nextPage: 'Next', // Next page button text
- firstPage: 'First', // First page button text
- lastPage: 'Last', // Last page button text
- paginationShowsTotal: false, // Accept bool or function
- paginationPosition: 'bottom' // default is bottom, top and both is all available
- // hideSizePerPage: true > You can hide the dropdown for sizePerPage
- // alwaysShowAllBtns: true // Always show next and previous button
- // withFirstAndLast: false > Hide the going to First and Last page button
- };
-
-function dateFormatter(cell, row) {
- console.log("cell");
- console.log(cell);
- if(cell){
- cell = new Date(cell);
- console.log(cell);
- return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`;
- }
-}
-
-export class StaffTable extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- show: false,
- panleOpen: true,
- };
- this.onUpdate = this.onUpdate.bind(this);
- };
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
- togglePanel(){
- this.setState({panleOpen: !this.state.panleOpen});
- }
- render() {
- console.log("this.props.staff");
- console.log(this.props.staff);
- return (
-
-
-
-
- Employee Id
- First Name
- Last Name
- Type
- DOB
-
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/students/StudentDataView.js b/imports/client/views/org/admin/settings/students/StudentDataView.js
deleted file mode 100644
index 750102e..0000000
--- a/imports/client/views/org/admin/settings/students/StudentDataView.js
+++ /dev/null
@@ -1,274 +0,0 @@
-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';
- import { AddStudentForm } from './addStudentForm';
-
-export class StudentDataView extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- show: false
- };
- 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() {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
Students
- Click to view
-
-
-
-
-
-
-
-
-
-
-
-
Teachers
- Click to view
-
-
-
-
-
-
-
-
-
-
-
-
Parents
- Click to view
-
-
-
-
-
-
-
-
-
-
-
-
Non Teaching Staff
- Click to view
-
-
-
-
-
-
-
-
-
-
-
-
-
- First Name |
- Last Name |
- className |
- DOB |
- Status |
- Actions |
-
-
-
-
- Marth |
- Enright |
- VII |
- 22 Jun 1972 |
- Active |
-
-
- |
-
-
- Jackelyn |
- Weible |
- XI |
- 3 Oct 1981 |
- Inactive |
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/students/StudentDataView0.js b/imports/client/views/org/admin/settings/students/StudentDataView0.js
deleted file mode 100644
index 03a3f53..0000000
--- a/imports/client/views/org/admin/settings/students/StudentDataView0.js
+++ /dev/null
@@ -1,88 +0,0 @@
-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';
- import { AddStudentForm } from './addStudentForm';
-
-export class StudentDataView extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- show: false
- };
- 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() {
- return (
-
-
-
-
-
- # |
- First Name |
- Last Name |
-
-
-
- {
- this.props.data.students.map(function(student, i)
- {
- return(
-
- {i+1} |
- {student.firstName} |
- {student.lastName} |
-
- )
- })
- }
-
-
-
-
-
-
-
- New Student
-
-
-
-
-
-
-
-
-
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/students/StudentView.js b/imports/client/views/org/admin/settings/students/StudentView.js
deleted file mode 100644
index 8c07979..0000000
--- a/imports/client/views/org/admin/settings/students/StudentView.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import _ from 'lodash';
-import { Meteor } from 'meteor/meteor';
-
-import React, { Component } from 'react';
-import { Link,browserHistory } from 'react-router';
-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';
-import { StudentTable } from './view/StudentTable';
-import { Header } from '../Header';
-import { UploadCsv } from './UploadCsv';
-import { AddStudent } from './add/addStudent';
-import { Students } from '/imports/collections/students/index';
-import './student.css'
-
-export class StudentView extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- show: false,
- firstNameSearch: "",
- lastNameSearch: "",
- };
- 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() {
- firstNameSearch = this.state.firstNameSearch;
- lastNameSearch = this.state.lastNameSearch;
- var students =_.filter(this.props.data.students,function(item){
- if(item.firstName){
- return _.includes(item.firstName.toLowerCase(),firstNameSearch.toLowerCase());
- }
- });
- return (
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/students/UploadCsv.js b/imports/client/views/org/admin/settings/students/UploadCsv.js
deleted file mode 100644
index 78dfc52..0000000
--- a/imports/client/views/org/admin/settings/students/UploadCsv.js
+++ /dev/null
@@ -1,103 +0,0 @@
-// import {UploadCsv } from '/imports/collections/students/UploadCsv'
-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,ControlLabel,HelpBlock,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-// import { AddStudentForm } from './addStudentForm';
-import { FilesCollection } from 'meteor/ostrio:files';
-const Papa = this.Papa;
-// console.log(this);
-const style = {
- margin: 12,
-};
-function FieldGroup({ id, label, help, ...props }) {
- return (
-
- {label}
-
- {help && {help}}
-
- );
-}
-export class UploadCsv extends Component {
- constructor(props) {
- super(props);
- this.state = {
- show: false
- };
- 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});
- };
- uploadStudentCsv(e){
- e.preventDefault();
- e.persist();
- var file = $('input[type="file"]').prop("files")[0];
- Papa.parse(file, {
- header: true,
- complete: function(csvData) {
- console.log("csvData");
- console.log(csvData);
- if(csvData){
- Meteor.call('student.uploadCsv', csvData, function (error, result) {
- console.log("error");
- console.log(error);
- console.log("result");
- console.log(result);
- })
- }
- }
- });
- }
-
- render() {
- console.log(this.props);
- return (
-
-
-
-
- Upload Csv file
-
-
-
-
-
-
-
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/students/add/AddStudentFormContainer.js b/imports/client/views/org/admin/settings/students/add/AddStudentFormContainer.js
deleted file mode 100644
index 46cc059..0000000
--- a/imports/client/views/org/admin/settings/students/add/AddStudentFormContainer.js
+++ /dev/null
@@ -1,130 +0,0 @@
-import React, { Component } from 'react'
-import { AddStudentForm } from './addStudentForm'
-import StudentForm from './StudentForm'
-import Form from '/imports/client/views/core/Form'
-import Validator from '/imports/client/views/core/Validator'
-import { isRequired, isValidEmail } from '/imports/client/views/core/validations'
-
-
-export class AddStudentFormContainer extends Component {
-
- constructor(props) {
- super(props)
- this.state = { currentStep: 0 }
- this.handleNextClick = this.handleNextClick.bind(this)
- this.handleBackClick = this.handleBackClick.bind(this)
- this.handleSubmit = this.handleSubmit.bind(this)
- }
-
- handleNextClick() {
- this.form.handleSubmit()
- if (this.validator.getErrors() && Object.keys(this.validator.getErrors()).length > 0) return
- this.setState({ currentStep: this.state.currentStep + 1 })
- this.form.resetSubmitted()
- }
-
- handleBackClick() {
- this.setState({ currentStep: this.state.currentStep + -1 })
- }
-
- handleSubmit() {
- self = this;
- if (this.state.currentStep === 3) {
- Meteor.call('student.addManually',this.form.state.values, function(err, result){
- console.log("err");
- console.log(err);
- console.log("result");
- console.log(result);
- if(!err){
- self.props.hideModal();
- }
- });
- }
- }
-
- //render callback
- render() {
- return (
-
- )
- }
-}
diff --git a/imports/client/views/org/admin/settings/students/add/StudentForm.js b/imports/client/views/org/admin/settings/students/add/StudentForm.js
deleted file mode 100644
index a321be7..0000000
--- a/imports/client/views/org/admin/settings/students/add/StudentForm.js
+++ /dev/null
@@ -1,474 +0,0 @@
-import React, { PropTypes } from 'react'
-import {
- Row,
- Col,
- FormGroup,
- FormControl,
- Button
-} from 'react-bootstrap'
-import DatePicker from '/imports/client/views/core/DatePicker'
-import Label from '/imports/client/views/core/Label'
-import Stepper from '/imports/client/views/core/Stepper'
-import ErrorLabel from '/imports/client/views/core/ErrorLabel'
-
-const StudentForm = props => (
-
-
- {props.currentStep === 0 && (
-
- )}
- {props.currentStep === 1 && (
-
- )}
- {props.currentStep === 2 && (
-
- )}
- {props.currentStep === 3 && (
-
- )}
-
- {props.currentStep > 0 && (
-
-
-
-
- )}
- {props.currentStep < 3 && (
-
-
-
- )}
- {props.currentStep === 3 && (
-
-
-
- )}
-
-
-)
-
-StudentForm.propTypes = {
- currentStep: PropTypes.number.isRequired,
- onNextClick: PropTypes.func.isRequired,
- onBackClick: PropTypes.func.isRequired,
- setValue: PropTypes.func.isRequired,
- getValue: PropTypes.func.isRequired,
-}
-
-export default StudentForm
diff --git a/imports/client/views/org/admin/settings/students/add/addStudent.js b/imports/client/views/org/admin/settings/students/add/addStudent.js
deleted file mode 100644
index 69bfc4a..0000000
--- a/imports/client/views/org/admin/settings/students/add/addStudent.js
+++ /dev/null
@@ -1,66 +0,0 @@
-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';
-import { AddStudentFormContainer } from './AddStudentFormContainer';
-
-const style = {
- margin: 12,
-};
-export class AddStudent extends Component {
- constructor(props) {
- super(props);
- this.state = {
- show: false
- };
- 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() {
- return (
-
-
-
-
- Add Student
-
-
-
-
- {/*
-
-
-
- */}
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/students/add/addStudentForm.js b/imports/client/views/org/admin/settings/students/add/addStudentForm.js
deleted file mode 100644
index 9f41e25..0000000
--- a/imports/client/views/org/admin/settings/students/add/addStudentForm.js
+++ /dev/null
@@ -1,500 +0,0 @@
-import _ from 'lodash';
-import { Meteor } from 'meteor/meteor';
-
-import React, { Component } from 'react';
-import { Link,browserHistory } from 'react-router';
-import { Form, FormGroup,InputGroup,
- DropdownButton,MenuItem,ControlLabel,
- SplitButton,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-import DatePicker from 'react-bootstrap-date-picker'
-import {addStudentManually} from '/imports/collections/students/methods';
-
-export class AddStudentForm extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- admissionId: "123",
- firstName: "first",
- lastName: "last",
- middleName: "middle",
- email: "deepak125.dk+21@gmail.com",
- dob: "",
- formattedDob: "",
- gender: "male",
- rollNo: "1",
- class: "2",
- section: "B",
- community: "SC",
- bloodGroup: "B+",
- phone: "9876543321",
- address: "address",
- city: "chennai",
- state: "tn",
- parentName: "parentName",
- parentEmail: "deepak125.dk+41@gmail.com",
- relation: "father",
- profession: "farmer",
- parentGender: "male",
- parentPhone: "987655412",
- parentAddress: "parentAddress",
- parentCity: "parentCity",
- parentState: "parentState",
- parentZipcode: "parentZipcode",
- };
- this.onUpdate = this.onUpdate.bind(this);
- this.handleDob = this.handleDob.bind(this);
- };
-
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
-
- handleDob(value, formattedValue) {
- this.setState({
- dob: value, // ISO String, ex: "2016-11-19T12:00:00.000Z"
- formattedDob: formattedValue // Formatted String, ex: "11/19/2016"
- });
-}
- addStudent(e){
- e.preventDefault();
- e.persist();
- const firstName = this.state.firstName;
- const middleName = this.state.middleName;
- const lastName = this.state.lastName;
- const admissionId = this.state.admissionId;
- const email = this.state.email;
- const dob = this.state.dob;
- const formattedDob = this.state.formattedDob;
- const gender = this.state.gender;
- const rollNo = this.state.rollNo;
- const studentclass = this.state.class;
- const section = this.state.section;
- const community = this.state.community;
- const bloodGroup = this.state.bloodGroup;
- const phone = this.state.phone;
- const address = this.state.address;
- const city = this.state.city;
- const state = this.state.state;
- const parentName = this.state.parentName;
- const parentEmail = this.state.parentEmail;
- const relation = this.state.relation;
- const profession = this.state.profession;
- const parentGender = this.state.parentGender;
- const parentPhone = this.state.parentPhone;
- const parentAddress = this.state.parentAddress;
- const parentCity = this.state.parentCity;
- const parentState = this.state.parentState;
- const parentZipcode = this.state.parentZipcode;
- if(admissionId==""){
- Bert.alert('Enter Admission Id!', 'danger');
- }else if(firstName==""){
- Bert.alert('Enter Fist Name', 'danger');
- } else if(middleName==""){
- Bert.alert('Enter Middle name!', 'danger');
- }else if(lastName==""){
- Bert.alert('Enter Last name!', 'danger');
- }else if(email==""){
- Bert.alert('Enter email!', 'danger');
- }else if(dob==""){
- Bert.alert('Enter DOB!', 'danger');
- }else if(gender==""){
- Bert.alert('Enter Student Gender!', 'danger');
- }else if(studentclass==""){
- Bert.alert('Enter Class!', 'danger');
- }else if(section==""){
- Bert.alert('Enter Section!', 'danger');
- }else if(community==""){
- Bert.alert('Enter Section!', 'danger');
- }else if(bloodGroup==""){
- Bert.alert('Enter Blood Group!', 'danger');
- }else if(phone==""){
- Bert.alert('Enter phone!', 'danger');
- }else if(address==""){
- Bert.alert('Enter address!', 'danger');
- }else if(city==""){
- Bert.alert('Enter city!', 'danger');
- }else if(state==""){
- Bert.alert('Enter state!', 'danger');
- }else if(parentName==""){
- Bert.alert('Enter Parent name!', 'danger');
- }else if(parentEmail==""){
- Bert.alert('Enter Parent Email!', 'danger');
- }else if(relation==""){
- Bert.alert('Enter relation!', 'danger');
- }else if(profession==""){
- Bert.alert('Enter parent profession!', 'danger');
- }else if(parentGender==""){
- Bert.alert("Enter Parent's Gender!", 'danger');
- }else if(parentPhone==""){
- Bert.alert("Enter Parent's Phone!", 'danger');
- }else if(parentAddress==""){
- Bert.alert("Enter Parent's Address!", 'danger');
- }else if(parentCity==""){
- Bert.alert("Enter Parent's City!", 'danger');
- }else if(parentState==""){
- Bert.alert("Enter Parent's State!", 'danger');
- }else if(parentZipcode==""){
- Bert.alert("Enter Parent's zipcode!", 'danger');
- }else{
- addStudentManually.call({
- admissionId,
- firstName,
- middleName,
- lastName,
- email,
- dob,
- formattedDob,
- gender,
- rollNo,
- studentclass,
- section,
- community,
- bloodGroup,
- phone,
- address,
- city,
- state,
- parentName,
- parentEmail,
- relation,
- profession,
- parentGender,
- parentPhone,
- parentAddress,
- parentCity,
- parentState,
- parentZipcode
- }, function (error, result) {
- console.log(error);
- console.log(result);
- });
- }
- }
- render() {
- return (
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/students/index.js b/imports/client/views/org/admin/settings/students/index.js
deleted file mode 100644
index 016dcde..0000000
--- a/imports/client/views/org/admin/settings/students/index.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// import { StudentDataController } from '/imports/client/views/org/admin/students/index'
-import _ from 'lodash';
-import {
- composeWithTracker,
- compose,
- composeAll
- } from 'react-komposer';
-import { Loading } from '/imports/client/components/Loading';
-
-import { Orgs } from '/imports/collections/orgs/index';
-import { Users } from '/imports/collections/users/index';
-import { StudentView } from './StudentView';
-import { Students } from '/imports/collections/students/index';
-
-
-const meteorTick = (props, onData) => {
- Shelf.layout.set({
- bulb: 'SETTINGS',
- subbulb: 'USERS',
- view: 'STUDENTS'
- });
- const handles = [
- Meteor.subscribe('users.current'),
- Meteor.subscribe('orgs.current'),
- Meteor.subscribe('users.forMyOrg'),
- Meteor.subscribe('student.forMyOrg'),
- ];
-
- if(_.every(handles, (handle) => (handle.ready()) )) {
- const user = Users.current();
- const org = Orgs.current();
- students = Users.find({"role":"STUDENT"}).fetch() ? Users.find({"role":"STUDENT"}).fetch() : "";
- studentData = Students.find().fetch() ? Students.find().fetch() : "";
- for(var i=0; i< studentData.length; i++){
- for(var j=0; j< students.length; j++){
- if(studentData[i].userId == students[j]._id && studentData[i].admissionId){
- studentData[i].firstName = students[j].firstName;
- studentData[i].lastName = students[j].lastName;
- }else{
-
- }
- }
- }
- onData(null, {
- data: {
- user: user,
- org: org,
- studentData: studentData
- },
- });
- }
-
- return () => {
- _.each(handles, (handle) => handle.stop() );
- };
-};
-
-
-const reduxTick = (props, onData) => {
- onData(null, {
- data: {}
- });
-};
-
-
-export const StudentDataController = composeAll(
- composeWithTracker(meteorTick, Loading),
- compose(reduxTick, Loading),
-)(StudentView);
diff --git a/imports/client/views/org/admin/settings/students/student.css b/imports/client/views/org/admin/settings/students/student.css
deleted file mode 100644
index dc886d1..0000000
--- a/imports/client/views/org/admin/settings/students/student.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.btn-toolbar {
- display: inline-block;
- font-size: 0;
- margin-right: 12px;
-}
diff --git a/imports/client/views/org/admin/settings/students/view/StudentRow.js b/imports/client/views/org/admin/settings/students/view/StudentRow.js
deleted file mode 100644
index a02bbf6..0000000
--- a/imports/client/views/org/admin/settings/students/view/StudentRow.js
+++ /dev/null
@@ -1,66 +0,0 @@
-import _ from 'lodash';
-import { Meteor } from 'meteor/meteor';
-
-import React, { Component } from 'react';
-import { Link,browserHistory } from 'react-router';
-import { FormGroup,
- FormControl,Glyphicon,Button } from 'react-bootstrap';
-
-
-export class StudentRow extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- editOpen: false,
- };
- this.onUpdate = this.onUpdate.bind(this);
- this.toggleEditOpen = this.toggleEditOpen.bind(this);
- this.deleteStudent = this.deleteStudent.bind(this);
- };
-
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
- toggleEditOpen(){
- this.setState({
- editOpen : !this.state.editOpen
- })
- }
- deleteStudent(){
- console.log("Delete");
- console.log(this.props.student._id);
- }
- render() {
- const {student} = this.props;
- if(student.firstName){
- return (
-
- {student.firstName} |
- {student.lastName} |
- {student.class} |
- {student.dob? moment(student.dob).format("LL") : } |
- Active |
-
-
- |
-
- );
- }else {
- return null;
- }
-
- };
-
-};
diff --git a/imports/client/views/org/admin/settings/students/view/StudentTable.js b/imports/client/views/org/admin/settings/students/view/StudentTable.js
deleted file mode 100644
index 5f331fa..0000000
--- a/imports/client/views/org/admin/settings/students/view/StudentTable.js
+++ /dev/null
@@ -1,85 +0,0 @@
-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';
-import {moment} from 'meteor/momentjs:moment'
-import {StudentRow} from './StudentRow'
-import {BootstrapTable, TableHeaderColumn}from 'react-bootstrap-table';
-
-const options = {
- page: 0, // which page you want to show as default
- sizePerPageList: [ {
- text: '5', value: 5
- }, {
- text: '10', value: 10
- }], // you can change the dropdown list for size per page
- sizePerPage: 5, // which size per page you want to locate as default
- pageStartIndex: 0, // where to start counting the pages
- paginationSize: 3, // the pagination bar size.
- prePage: 'Prev', // Previous page button text
- nextPage: 'Next', // Next page button text
- firstPage: 'First', // First page button text
- lastPage: 'Last', // Last page button text
- paginationShowsTotal: false, // Accept bool or function
- paginationPosition: 'bottom' // default is bottom, top and both is all available
- // hideSizePerPage: true > You can hide the dropdown for sizePerPage
- // alwaysShowAllBtns: true // Always show next and previous button
- // withFirstAndLast: false > Hide the going to First and Last page button
- };
-
-function dateFormatter(cell, row) {
- if(cell){
- cell = new Date(cell);
- return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`;
- }
-}
-export class StudentTable extends Component {
-
- constructor(props) {
- super(props);
- this.state = {
- show: false,
- panleOpen: true,
- };
- this.onUpdate = this.onUpdate.bind(this);
- this.togglePanel = this.togglePanel.bind(this);
- };
- onUpdate(key, value) {
- this.setState({[key]: value});
- };
- togglePanel(){
- this.setState({panleOpen: !this.state.panleOpen});
- }
-
- render() {
- studentData = this.props.studentData;
- console.log("this.props.studentData");
- console.log(this.props.studentData);
- return (
-
-
-
-
- Admission Id
- First Name
- Last Name
- Class
- DOB
-
-
-
- );
- };
-
-};
diff --git a/imports/client/views/org/admin/users/list/AdminUsersList.js b/imports/client/views/org/admin/users/list/AdminUsersList.js
new file mode 100644
index 0000000..8f08686
--- /dev/null
+++ b/imports/client/views/org/admin/users/list/AdminUsersList.js
@@ -0,0 +1,63 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+import React, { Component } from 'react';
+import { Link } from 'react-router';
+import { Avatar } from '/imports/client/components/Avatar';
+import { Icon } from '/imports/client/components/Icon';
+import classNames from 'classnames';
+import { EnterModule } from '/imports/client/views/org/enter/module/index';
+// import { VerifyModule } from '/imports/client/views/verify/module/index';
+import { Navbar,Modal, Nav, NavItem,
+ Glyphicon, Collapse,
+ NavbarToggler, NavbarBrand,
+ NavLink, DropdownItem, DropdownToggle, DropdownMenu,
+ NavDropdown, MenuItem, Breadcrumb } from 'react-bootstrap';
+ import { VerifyModule } from '/imports/client/views/verify/module/index'
+
+var Accordion = require('react-bootstrap').Accordion;
+var Panel = require('react-bootstrap').Panel;
+export class AdminUsersList extends Component {
+ render() {
+ return (
+
+
+
+
+
+

+
+
+
Students Click to view
+
+
+
+
+
+
+
+
+

+
+
+
Teachers Click to view
+
+
+
+
+
+
+
+
+

+
+
+
Parents Click to view
+
+
+
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/list/index.js b/imports/client/views/org/admin/users/list/index.js
new file mode 100644
index 0000000..24a8d7e
--- /dev/null
+++ b/imports/client/views/org/admin/users/list/index.js
@@ -0,0 +1,50 @@
+// import { MailModule } from '/imports/client/views/org/admin/mailbox/module/index'
+import {
+ composeWithTracker,
+ compose,
+ composeAll
+ } from 'react-komposer';
+import { AdminUsersList } from './AdminUsersList';
+import { Loading } from '/imports/client/components/Loading';
+
+import { Users } from '/imports/collections/users/index';
+import { Orgs } from '/imports/collections/orgs/index';
+
+
+const meteorTick = (props, onData) => {
+
+ const handles = [
+ Meteor.subscribe('users.current'),
+ Meteor.subscribe('orgs.current'),
+ ];
+
+ const user = Users.current();
+
+ if(_.every(handles, (handle) => (handle.ready()) ) && user) {
+ onData(null, {
+ layout: Shelf.layout.get(),
+ data: {
+ companyId: props.params.companyId,
+ user: Users.current(),
+ org: Orgs.current(),
+ },
+ });
+ }
+
+ return () => {
+ _.each(handles, (handle) => handle.stop() );
+ };
+};
+
+
+const reduxTick = (props, onData) => {
+ onData(null, {
+ data: {}
+ });
+};
+
+
+export const AdminUsersListController = composeAll(
+ composeWithTracker(meteorTick, Loading),
+ compose(reduxTick, Loading),
+)(AdminUsersList);
diff --git a/imports/client/views/org/admin/users/module/AdminUserViewLayout.js b/imports/client/views/org/admin/users/module/AdminUserViewLayout.js
new file mode 100644
index 0000000..897f3ac
--- /dev/null
+++ b/imports/client/views/org/admin/users/module/AdminUserViewLayout.js
@@ -0,0 +1,50 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link } from 'react-router';
+import classNames from 'classnames';
+import { Users } from '/imports/collections/users/index';
+import { If, Case } from '/imports/client/components/Logic';
+import {Header} from './Header'
+
+
+export class AdminUserViewLayout extends Component {
+
+ renderMenuItem(bulb, label, path, auth) {
+ const user = Users.current();
+ return (
+ (
+
+ {label}
+
+ )}
+ />
+ );
+ };
+
+ renderSeparator() {
+ return ;
+ };
+
+ render() {
+ const user = this.props.data.user;
+ return (
+
+
+
+ { this.props.children }
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/module/Header.js b/imports/client/views/org/admin/users/module/Header.js
new file mode 100644
index 0000000..5659f97
--- /dev/null
+++ b/imports/client/views/org/admin/users/module/Header.js
@@ -0,0 +1,85 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link,browserHistory } from 'react-router';
+import { FormGroup,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+import './header.css';
+
+
+export class Header extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ };
+
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+
+ render() {
+ return (
+
+
+
+
+
+
+
+
+

+
+
+
+
Students
+
Click to view
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
Teachers
+
Click to view
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
Parents
+
Click to view
+
+
+
+
+
+
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/module/header.css b/imports/client/views/org/admin/users/module/header.css
new file mode 100644
index 0000000..e45826e
--- /dev/null
+++ b/imports/client/views/org/admin/users/module/header.css
@@ -0,0 +1,10 @@
+.img-circle
+{
+ width: 70px;
+ height: 70px;
+}
+
+.panel-body
+{
+ overflow-y:hidden;
+}
diff --git a/imports/client/views/org/admin/users/module/index.js b/imports/client/views/org/admin/users/module/index.js
new file mode 100644
index 0000000..a29aa4d
--- /dev/null
+++ b/imports/client/views/org/admin/users/module/index.js
@@ -0,0 +1,50 @@
+// import { MailModule } from '/imports/client/views/org/admin/mailbox/module/index'
+import {
+ composeWithTracker,
+ compose,
+ composeAll
+ } from 'react-komposer';
+import { AdminUserViewLayout } from './AdminUserViewLayout';
+import { Loading } from '/imports/client/components/Loading';
+
+import { Users } from '/imports/collections/users/index';
+import { Orgs } from '/imports/collections/orgs/index';
+
+
+const meteorTick = (props, onData) => {
+
+ const handles = [
+ Meteor.subscribe('users.current'),
+ Meteor.subscribe('orgs.current'),
+ ];
+
+ const user = Users.current();
+
+ if(_.every(handles, (handle) => (handle.ready()) ) && user) {
+ onData(null, {
+ layout: Shelf.layout.get(),
+ data: {
+ companyId: props.params.companyId,
+ user: Users.current(),
+ org: Orgs.current(),
+ },
+ });
+ }
+
+ return () => {
+ _.each(handles, (handle) => handle.stop() );
+ };
+};
+
+
+const reduxTick = (props, onData) => {
+ onData(null, {
+ data: {}
+ });
+};
+
+
+export const AdminUsersModule = composeAll(
+ composeWithTracker(meteorTick, Loading),
+ compose(reduxTick, Loading),
+)(AdminUserViewLayout);
diff --git a/imports/client/views/org/admin/users/parents/index.js b/imports/client/views/org/admin/users/parents/index.js
new file mode 100644
index 0000000..a765b86
--- /dev/null
+++ b/imports/client/views/org/admin/users/parents/index.js
@@ -0,0 +1,72 @@
+import _ from 'lodash';
+import {
+ composeWithTracker,
+ compose,
+ composeAll
+ } from 'react-komposer';
+import { Loading } from '/imports/client/components/Loading';
+
+import { Orgs } from '/imports/collections/orgs/index';
+import { Users } from '/imports/collections/users/index';
+import { Parents } from '/imports/collections/parents/index';
+import { ParentsView } from './parentsview';
+
+
+
+const meteorTick = (props, onData) => {
+ Shelf.layout.set({
+ bulb: 'SETTINGS',
+ subbulb: 'USERS',
+ view: 'PARENTS'
+ });
+ const handles = [
+ Meteor.subscribe('users.current'),
+ Meteor.subscribe('orgs.current'),
+ Meteor.subscribe('users.forMyOrg'),
+ Meteor.subscribe('parent.forMyOrg'),
+ ];
+
+ if(_.every(handles, (handle) => (handle.ready()) )) {
+ const user = Users.current();
+ const org = Orgs.current();
+ console.log("parents");
+ parent = Users.find({"role":"PARENT"}).fetch() ? Users.find({"role":"PARENT"}).fetch() : "";
+ console.log(Users.find({"role":"PARENT"}).fetch());
+ parentData = Parents.find().fetch() ? Parents.find().fetch() : "";
+ console.log("parentData");
+ console.log(parentData);
+ for(var i=0; i< parent.length; i++){
+ for(var j=0; j< parentData.length; j++){
+ if(parent[i]._id == parentData[j].userId){
+ parent[i].relationship = parentData[j].relationship;
+ parent[i].profession = parentData[j].profession;
+ parent[i].relationship = parentData[j].relationship;
+ }
+ }
+ }
+ onData(null, {
+ data: {
+ user: user,
+ org: org,
+ parent: parent
+ },
+ });
+ }
+
+ return () => {
+ _.each(handles, (handle) => handle.stop() );
+ };
+};
+
+
+const reduxTick = (props, onData) => {
+ onData(null, {
+ data: {}
+ });
+};
+
+
+export const ParentViewController = composeAll(
+ composeWithTracker(meteorTick, Loading),
+ compose(reduxTick, Loading),
+)(ParentsView);
diff --git a/imports/client/views/org/admin/users/parents/parentsview.js b/imports/client/views/org/admin/users/parents/parentsview.js
new file mode 100644
index 0000000..6bbf764
--- /dev/null
+++ b/imports/client/views/org/admin/users/parents/parentsview.js
@@ -0,0 +1,43 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link,browserHistory } from 'react-router';
+import { FormGroup,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+import { ParentTable } from './view/ParentTable'
+
+
+export class ParentsView extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ };
+
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+ togglePanel(){
+ this.setState({panleOpen: !this.state.panleOpen});
+ }
+
+ render() {
+ const {user, org, parent} = this.props.data;
+ return (
+
+ );
+ };
+
+
+};
diff --git a/imports/client/views/org/admin/users/parents/view/ParentRow.js b/imports/client/views/org/admin/users/parents/view/ParentRow.js
new file mode 100644
index 0000000..130b080
--- /dev/null
+++ b/imports/client/views/org/admin/users/parents/view/ParentRow.js
@@ -0,0 +1,54 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link,browserHistory } from 'react-router';
+import { FormGroup,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+
+
+ export class ParentRow extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ };
+
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+
+ render() {
+ const {parent} = this.props;
+ if(parent.firstName){
+ return (
+
+ {parent.firstName} |
+ {parent.relationship} | {/* relationship doesnt reflect here */}
+ Active |
+
+
+ |
+
+ );
+ }else {
+ return null;
+ }
+
+ };
+
+ };
diff --git a/imports/client/views/org/admin/users/parents/view/ParentTable.js b/imports/client/views/org/admin/users/parents/view/ParentTable.js
new file mode 100644
index 0000000..8bf1e54
--- /dev/null
+++ b/imports/client/views/org/admin/users/parents/view/ParentTable.js
@@ -0,0 +1,70 @@
+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';
+import {moment} from 'meteor/momentjs:moment'
+import {ParentRow} from './ParentRow'
+import {BootstrapTable, TableHeaderColumn}from 'react-bootstrap-table';
+const options = {
+ page: 0, // which page you want to show as default
+ sizePerPageList: [ {
+ text: '5', value: 5
+ }, {
+ text: '10', value: 10
+ }], // you can change the dropdown list for size per page
+ sizePerPage: 5, // which size per page you want to locate as default
+ pageStartIndex: 0, // where to start counting the pages
+ paginationSize: 3, // the pagination bar size.
+ prePage: 'Prev', // Previous page button text
+ nextPage: 'Next', // Next page button text
+ firstPage: 'First', // First page button text
+ lastPage: 'Last', // Last page button text
+ paginationShowsTotal: false, // Accept bool or function
+ paginationPosition: 'bottom' // default is bottom, top and both is all available
+ // hideSizePerPage: true > You can hide the dropdown for sizePerPage
+ // alwaysShowAllBtns: true // Always show next and previous button
+ // withFirstAndLast: false > Hide the going to First and Last page button
+ };
+
+export class ParentTable extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false,
+ panleOpen: true,
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ };
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+
+ render() {
+ return (
+
+
+
+
+ Sr No
+ Name
+ Relationship
+ Profession
+
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/staff/StaffView.js b/imports/client/views/org/admin/users/staff/StaffView.js
new file mode 100644
index 0000000..c1909c9
--- /dev/null
+++ b/imports/client/views/org/admin/users/staff/StaffView.js
@@ -0,0 +1,39 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link,browserHistory } from 'react-router';
+import { FormGroup,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+import { StaffTable } from './view/StaffTable'
+import { AddStaff } from './add/addStaff'
+import { UploadCsvStaff } from './UploadCsvStaff'
+
+export class StaffView extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ };
+
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+
+ render() {
+ const {user, org, staff} = this.props.data;
+ return (
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/staff/UploadCsvStaff.js b/imports/client/views/org/admin/users/staff/UploadCsvStaff.js
new file mode 100644
index 0000000..62da6d4
--- /dev/null
+++ b/imports/client/views/org/admin/users/staff/UploadCsvStaff.js
@@ -0,0 +1,103 @@
+// import {UploadCsv } from '/imports/collections/students/UploadCsv'
+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,ControlLabel,HelpBlock,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+// import { AddStudentForm } from './addStudentForm';
+import { FilesCollection } from 'meteor/ostrio:files';
+const Papa = this.Papa;
+// console.log(this);
+const style = {
+ margin: 12,
+};
+function FieldGroup({ id, label, help, ...props }) {
+ return (
+
+ {label}
+
+ {help && {help}}
+
+ );
+}
+export class UploadCsvStaff extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false
+ };
+ 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});
+ };
+ uploadStaffCsv(e){
+ e.preventDefault();
+ e.persist();
+ var file = $('input[type="file"]').prop("files")[0];
+ Papa.parse(file, {
+ header: true,
+ complete: function(csvData) {
+ console.log("csvData");
+ console.log(csvData);
+ if(csvData){
+ Meteor.call('staff.uploadCsv', csvData, function (error, result) {
+ console.log("error");
+ console.log(error);
+ console.log("result");
+ console.log(result);
+ })
+ }
+ }
+ });
+ }
+
+ render() {
+ console.log(this.props);
+ return (
+
+
+
+
+ Upload Csv
+
+
+
+
+
+
+
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/staff/add/AddStaffFormContainer.js b/imports/client/views/org/admin/users/staff/add/AddStaffFormContainer.js
new file mode 100644
index 0000000..da3af70
--- /dev/null
+++ b/imports/client/views/org/admin/users/staff/add/AddStaffFormContainer.js
@@ -0,0 +1,123 @@
+import React, { Component } from 'react'
+import StaffForm from './StaffForm'
+import Form from '/imports/client/views/core/Form'
+import Validator from '/imports/client/views/core/Validator'
+import { isRequired, isValidEmail } from '/imports/client/views/core/validations'
+
+export class AddStaffFormContainer extends Component {
+
+ constructor(props) {
+ super(props)
+ this.state = { currentStep: 0 }
+ this.handleNextClick = this.handleNextClick.bind(this)
+ this.handleBackClick = this.handleBackClick.bind(this)
+ this.handleSubmit = this.handleSubmit.bind(this)
+ }
+
+ handleNextClick() {
+ console.log("clicked");
+ this.form.handleSubmit()
+ if (this.validator.getErrors() && Object.keys(this.validator.getErrors()).length > 0) return
+ console.log("after submit");
+ this.setState({ currentStep: this.state.currentStep + 1 })
+ this.form.resetSubmitted()
+ }
+
+ handleBackClick() {
+ this.setState({ currentStep: this.state.currentStep + -1 })
+ }
+
+ handleSubmit() {
+ if (this.state.currentStep === 3) {
+ Meteor.call('staff.addNew', this.form.state.values, (error, result) => {
+ console.log(error);
+ console.log(result);
+ if(!error){
+ this.props.modalState();
+ }
+ });
+ }
+ }
+
+ //render callback
+ render() {
+ return (
+
+ )
+ }
+}
diff --git a/imports/client/views/org/admin/users/staff/add/StaffForm.js b/imports/client/views/org/admin/users/staff/add/StaffForm.js
new file mode 100644
index 0000000..ec763b6
--- /dev/null
+++ b/imports/client/views/org/admin/users/staff/add/StaffForm.js
@@ -0,0 +1,417 @@
+import React, { PropTypes } from 'react'
+import {
+ Row,
+ Col,
+ FormGroup,
+ FormControl,
+ Button
+} from 'react-bootstrap'
+import DatePicker from '/imports/client/views/core/DatePicker'
+import Label from '/imports/client/views/core/Label'
+import Stepper from '/imports/client/views/core/Stepper'
+import ErrorLabel from '/imports/client/views/core/ErrorLabel'
+
+const StaffForm = props => (
+
+
+ {props.currentStep === 0 && (
+
+ )}
+ {props.currentStep === 1 && (
+
+ )}
+ {props.currentStep === 2 && (
+
+ )}
+ {props.currentStep === 3 && (
+
+ )}
+
+ {props.currentStep > 0 && (
+
+
+
+
+ )}
+ {props.currentStep < 3 && (
+
+
+
+ )}
+ {props.currentStep === 3 && (
+
+
+
+ )}
+
+
+)
+
+StaffForm.propTypes = {
+ currentStep: PropTypes.number.isRequired,
+ onNextClick: PropTypes.func.isRequired,
+ onBackClick: PropTypes.func.isRequired,
+ setValue: PropTypes.func.isRequired,
+ getValue: PropTypes.func.isRequired,
+}
+
+export default StaffForm
diff --git a/imports/client/views/org/admin/users/staff/add/addStaff.js b/imports/client/views/org/admin/users/staff/add/addStaff.js
new file mode 100644
index 0000000..2819b6b
--- /dev/null
+++ b/imports/client/views/org/admin/users/staff/add/addStaff.js
@@ -0,0 +1,66 @@
+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';
+import { AddStaffFormContainer } from './AddStaffFormContainer';
+
+const style = {
+ margin: 12,
+};
+export class AddStaff extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false
+ };
+ 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() {
+ return (
+
+
+
+
+ Add New Staff
+
+
+
+
+ {/*
+
+
+
+ */}
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/staff/index.js b/imports/client/views/org/admin/users/staff/index.js
new file mode 100644
index 0000000..75b547a
--- /dev/null
+++ b/imports/client/views/org/admin/users/staff/index.js
@@ -0,0 +1,70 @@
+// import { InviteSignupController } from '/imports/client/views/invite/signup/index'
+import _ from 'lodash';
+import {
+ composeWithTracker,
+ compose,
+ composeAll
+ } from 'react-komposer';
+import { Loading } from '/imports/client/components/Loading';
+
+import { Orgs } from '/imports/collections/orgs/index';
+import { Users } from '/imports/collections/users/index';
+import { Staffs } from '/imports/collections/staff/index';
+import { StaffView } from './StaffView';
+
+const meteorTick = (props, onData) => {
+ Shelf.layout.set({
+ bulb: 'SETTINGS',
+ subbulb: 'USERS',
+ view: 'STAFF'
+ });
+ const handles = [
+ Meteor.subscribe('users.current'),
+ Meteor.subscribe('orgs.current'),
+ Meteor.subscribe('users.forMyOrg'),
+ Meteor.subscribe('staff.forMyOrg'),
+ ];
+
+ if(_.every(handles, (handle) => (handle.ready()) )) {
+ const user = Users.current();
+ const org = Orgs.current();
+ staff = Users.find({"role":"STAFF"}).fetch() ? Users.find({"role":"STAFF"}).fetch() : "";
+ console.log(Users.find({"role":"STAFF"}).fetch());
+ staffData = Staffs.find().fetch() ? Staffs.find().fetch() : "";
+ console.log("staffData");
+ console.log(staffData);
+ for(var i=0; i< staff.length; i++){
+ for(var j=0; j< staffData.length; j++){
+ if(staff[i]._id == staffData[j].userId){
+ staff[i].type = staffData[j].type;
+ staff[i].employeeId = staffData[j].employeeId;
+ staff[i].dob = staffData[j].dob;
+ }
+ }
+ }
+ onData(null, {
+ data: {
+ user: user,
+ org: org,
+ staff: staff
+ },
+ });
+ }
+
+ return () => {
+ _.each(handles, (handle) => handle.stop() );
+ };
+};
+
+
+const reduxTick = (props, onData) => {
+ onData(null, {
+ data: {}
+ });
+};
+
+
+export const staffViewController = composeAll(
+ composeWithTracker(meteorTick, Loading),
+ compose(reduxTick, Loading),
+)(StaffView);
diff --git a/imports/client/views/org/admin/users/staff/view/StaffRow.js b/imports/client/views/org/admin/users/staff/view/StaffRow.js
new file mode 100644
index 0000000..f2438f6
--- /dev/null
+++ b/imports/client/views/org/admin/users/staff/view/StaffRow.js
@@ -0,0 +1,56 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link,browserHistory } from 'react-router';
+import { FormGroup,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+
+
+export class StaffRow extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ };
+
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+
+ render() {
+ const {staff} = this.props;
+ if(staff.firstName){
+ return (
+
+ {staff.firstName} |
+ {staff.lastName} |
+ {staff.type} |
+ {staff.dob? moment(staff.dob).format("LL") : } |
+ Active |
+
+
+ |
+
+ );
+ }else {
+ return null;
+ }
+
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/staff/view/StaffTable.js b/imports/client/views/org/admin/users/staff/view/StaffTable.js
new file mode 100644
index 0000000..357d37a
--- /dev/null
+++ b/imports/client/views/org/admin/users/staff/view/StaffTable.js
@@ -0,0 +1,85 @@
+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';
+import {moment} from 'meteor/momentjs:moment'
+import {StaffRow} from './StaffRow'
+import {BootstrapTable, TableHeaderColumn}from 'react-bootstrap-table';
+const options = {
+ page: 0, // which page you want to show as default
+ sizePerPageList: [ {
+ text: '5', value: 5
+ }, {
+ text: '10', value: 10
+ }], // you can change the dropdown list for size per page
+ sizePerPage: 5, // which size per page you want to locate as default
+ pageStartIndex: 0, // where to start counting the pages
+ paginationSize: 3, // the pagination bar size.
+ prePage: 'Prev', // Previous page button text
+ nextPage: 'Next', // Next page button text
+ firstPage: 'First', // First page button text
+ lastPage: 'Last', // Last page button text
+ paginationShowsTotal: false, // Accept bool or function
+ paginationPosition: 'bottom' // default is bottom, top and both is all available
+ // hideSizePerPage: true > You can hide the dropdown for sizePerPage
+ // alwaysShowAllBtns: true // Always show next and previous button
+ // withFirstAndLast: false > Hide the going to First and Last page button
+ };
+
+function dateFormatter(cell, row) {
+ console.log("cell");
+ console.log(cell);
+ if(cell){
+ cell = new Date(cell);
+ console.log(cell);
+ return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`;
+ }
+}
+
+export class StaffTable extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false,
+ panleOpen: true,
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ };
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+ togglePanel(){
+ this.setState({panleOpen: !this.state.panleOpen});
+ }
+ render() {
+ console.log("this.props.staff");
+ console.log(this.props.staff);
+ return (
+
+
+
+
+ Employee Id
+ First Name
+ Last Name
+ Type
+ DOB
+
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/students/StudentDataView.js b/imports/client/views/org/admin/users/students/StudentDataView.js
new file mode 100644
index 0000000..750102e
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/StudentDataView.js
@@ -0,0 +1,274 @@
+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';
+ import { AddStudentForm } from './addStudentForm';
+
+export class StudentDataView extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false
+ };
+ 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() {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
Students
+ Click to view
+
+
+
+
+
+
+
+
+
+
+
+
Teachers
+ Click to view
+
+
+
+
+
+
+
+
+
+
+
+
Parents
+ Click to view
+
+
+
+
+
+
+
+
+
+
+
+
Non Teaching Staff
+ Click to view
+
+
+
+
+
+
+
+
+
+
+
+
+
+ First Name |
+ Last Name |
+ className |
+ DOB |
+ Status |
+ Actions |
+
+
+
+
+ Marth |
+ Enright |
+ VII |
+ 22 Jun 1972 |
+ Active |
+
+
+ |
+
+
+ Jackelyn |
+ Weible |
+ XI |
+ 3 Oct 1981 |
+ Inactive |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/students/StudentDataView0.js b/imports/client/views/org/admin/users/students/StudentDataView0.js
new file mode 100644
index 0000000..03a3f53
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/StudentDataView0.js
@@ -0,0 +1,88 @@
+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';
+ import { AddStudentForm } from './addStudentForm';
+
+export class StudentDataView extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false
+ };
+ 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() {
+ return (
+
+
+
+
+
+ # |
+ First Name |
+ Last Name |
+
+
+
+ {
+ this.props.data.students.map(function(student, i)
+ {
+ return(
+
+ {i+1} |
+ {student.firstName} |
+ {student.lastName} |
+
+ )
+ })
+ }
+
+
+
+
+
+
+
+ New Student
+
+
+
+
+
+
+
+
+
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/students/StudentView.js b/imports/client/views/org/admin/users/students/StudentView.js
new file mode 100644
index 0000000..d65f66c
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/StudentView.js
@@ -0,0 +1,64 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link,browserHistory } from 'react-router';
+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';
+import { StudentTable } from './view/StudentTable';
+import { UploadCsv } from './UploadCsv';
+import { AddStudent } from './add/addStudent';
+import { Students } from '/imports/collections/students/index';
+import './student.css'
+
+export class StudentView extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false,
+ firstNameSearch: "",
+ lastNameSearch: "",
+ };
+ 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() {
+ firstNameSearch = this.state.firstNameSearch;
+ lastNameSearch = this.state.lastNameSearch;
+ var students =_.filter(this.props.data.students,function(item){
+ if(item.firstName){
+ return _.includes(item.firstName.toLowerCase(),firstNameSearch.toLowerCase());
+ }
+ });
+ return (
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/students/UploadCsv.js b/imports/client/views/org/admin/users/students/UploadCsv.js
new file mode 100644
index 0000000..78dfc52
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/UploadCsv.js
@@ -0,0 +1,103 @@
+// import {UploadCsv } from '/imports/collections/students/UploadCsv'
+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,ControlLabel,HelpBlock,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+// import { AddStudentForm } from './addStudentForm';
+import { FilesCollection } from 'meteor/ostrio:files';
+const Papa = this.Papa;
+// console.log(this);
+const style = {
+ margin: 12,
+};
+function FieldGroup({ id, label, help, ...props }) {
+ return (
+
+ {label}
+
+ {help && {help}}
+
+ );
+}
+export class UploadCsv extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false
+ };
+ 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});
+ };
+ uploadStudentCsv(e){
+ e.preventDefault();
+ e.persist();
+ var file = $('input[type="file"]').prop("files")[0];
+ Papa.parse(file, {
+ header: true,
+ complete: function(csvData) {
+ console.log("csvData");
+ console.log(csvData);
+ if(csvData){
+ Meteor.call('student.uploadCsv', csvData, function (error, result) {
+ console.log("error");
+ console.log(error);
+ console.log("result");
+ console.log(result);
+ })
+ }
+ }
+ });
+ }
+
+ render() {
+ console.log(this.props);
+ return (
+
+
+
+
+ Upload Csv file
+
+
+
+
+
+
+
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/students/add/AddStudentFormContainer.js b/imports/client/views/org/admin/users/students/add/AddStudentFormContainer.js
new file mode 100644
index 0000000..46cc059
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/add/AddStudentFormContainer.js
@@ -0,0 +1,130 @@
+import React, { Component } from 'react'
+import { AddStudentForm } from './addStudentForm'
+import StudentForm from './StudentForm'
+import Form from '/imports/client/views/core/Form'
+import Validator from '/imports/client/views/core/Validator'
+import { isRequired, isValidEmail } from '/imports/client/views/core/validations'
+
+
+export class AddStudentFormContainer extends Component {
+
+ constructor(props) {
+ super(props)
+ this.state = { currentStep: 0 }
+ this.handleNextClick = this.handleNextClick.bind(this)
+ this.handleBackClick = this.handleBackClick.bind(this)
+ this.handleSubmit = this.handleSubmit.bind(this)
+ }
+
+ handleNextClick() {
+ this.form.handleSubmit()
+ if (this.validator.getErrors() && Object.keys(this.validator.getErrors()).length > 0) return
+ this.setState({ currentStep: this.state.currentStep + 1 })
+ this.form.resetSubmitted()
+ }
+
+ handleBackClick() {
+ this.setState({ currentStep: this.state.currentStep + -1 })
+ }
+
+ handleSubmit() {
+ self = this;
+ if (this.state.currentStep === 3) {
+ Meteor.call('student.addManually',this.form.state.values, function(err, result){
+ console.log("err");
+ console.log(err);
+ console.log("result");
+ console.log(result);
+ if(!err){
+ self.props.hideModal();
+ }
+ });
+ }
+ }
+
+ //render callback
+ render() {
+ return (
+
+ )
+ }
+}
diff --git a/imports/client/views/org/admin/users/students/add/StudentForm.js b/imports/client/views/org/admin/users/students/add/StudentForm.js
new file mode 100644
index 0000000..a321be7
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/add/StudentForm.js
@@ -0,0 +1,474 @@
+import React, { PropTypes } from 'react'
+import {
+ Row,
+ Col,
+ FormGroup,
+ FormControl,
+ Button
+} from 'react-bootstrap'
+import DatePicker from '/imports/client/views/core/DatePicker'
+import Label from '/imports/client/views/core/Label'
+import Stepper from '/imports/client/views/core/Stepper'
+import ErrorLabel from '/imports/client/views/core/ErrorLabel'
+
+const StudentForm = props => (
+
+
+ {props.currentStep === 0 && (
+
+ )}
+ {props.currentStep === 1 && (
+
+ )}
+ {props.currentStep === 2 && (
+
+ )}
+ {props.currentStep === 3 && (
+
+ )}
+
+ {props.currentStep > 0 && (
+
+
+
+
+ )}
+ {props.currentStep < 3 && (
+
+
+
+ )}
+ {props.currentStep === 3 && (
+
+
+
+ )}
+
+
+)
+
+StudentForm.propTypes = {
+ currentStep: PropTypes.number.isRequired,
+ onNextClick: PropTypes.func.isRequired,
+ onBackClick: PropTypes.func.isRequired,
+ setValue: PropTypes.func.isRequired,
+ getValue: PropTypes.func.isRequired,
+}
+
+export default StudentForm
diff --git a/imports/client/views/org/admin/users/students/add/addStudent.js b/imports/client/views/org/admin/users/students/add/addStudent.js
new file mode 100644
index 0000000..69bfc4a
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/add/addStudent.js
@@ -0,0 +1,66 @@
+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';
+import { AddStudentFormContainer } from './AddStudentFormContainer';
+
+const style = {
+ margin: 12,
+};
+export class AddStudent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false
+ };
+ 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() {
+ return (
+
+
+
+
+ Add Student
+
+
+
+
+ {/*
+
+
+
+ */}
+
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/students/add/addStudentForm.js b/imports/client/views/org/admin/users/students/add/addStudentForm.js
new file mode 100644
index 0000000..9f41e25
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/add/addStudentForm.js
@@ -0,0 +1,500 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link,browserHistory } from 'react-router';
+import { Form, FormGroup,InputGroup,
+ DropdownButton,MenuItem,ControlLabel,
+ SplitButton,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+import DatePicker from 'react-bootstrap-date-picker'
+import {addStudentManually} from '/imports/collections/students/methods';
+
+export class AddStudentForm extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ admissionId: "123",
+ firstName: "first",
+ lastName: "last",
+ middleName: "middle",
+ email: "deepak125.dk+21@gmail.com",
+ dob: "",
+ formattedDob: "",
+ gender: "male",
+ rollNo: "1",
+ class: "2",
+ section: "B",
+ community: "SC",
+ bloodGroup: "B+",
+ phone: "9876543321",
+ address: "address",
+ city: "chennai",
+ state: "tn",
+ parentName: "parentName",
+ parentEmail: "deepak125.dk+41@gmail.com",
+ relation: "father",
+ profession: "farmer",
+ parentGender: "male",
+ parentPhone: "987655412",
+ parentAddress: "parentAddress",
+ parentCity: "parentCity",
+ parentState: "parentState",
+ parentZipcode: "parentZipcode",
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ this.handleDob = this.handleDob.bind(this);
+ };
+
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+
+ handleDob(value, formattedValue) {
+ this.setState({
+ dob: value, // ISO String, ex: "2016-11-19T12:00:00.000Z"
+ formattedDob: formattedValue // Formatted String, ex: "11/19/2016"
+ });
+}
+ addStudent(e){
+ e.preventDefault();
+ e.persist();
+ const firstName = this.state.firstName;
+ const middleName = this.state.middleName;
+ const lastName = this.state.lastName;
+ const admissionId = this.state.admissionId;
+ const email = this.state.email;
+ const dob = this.state.dob;
+ const formattedDob = this.state.formattedDob;
+ const gender = this.state.gender;
+ const rollNo = this.state.rollNo;
+ const studentclass = this.state.class;
+ const section = this.state.section;
+ const community = this.state.community;
+ const bloodGroup = this.state.bloodGroup;
+ const phone = this.state.phone;
+ const address = this.state.address;
+ const city = this.state.city;
+ const state = this.state.state;
+ const parentName = this.state.parentName;
+ const parentEmail = this.state.parentEmail;
+ const relation = this.state.relation;
+ const profession = this.state.profession;
+ const parentGender = this.state.parentGender;
+ const parentPhone = this.state.parentPhone;
+ const parentAddress = this.state.parentAddress;
+ const parentCity = this.state.parentCity;
+ const parentState = this.state.parentState;
+ const parentZipcode = this.state.parentZipcode;
+ if(admissionId==""){
+ Bert.alert('Enter Admission Id!', 'danger');
+ }else if(firstName==""){
+ Bert.alert('Enter Fist Name', 'danger');
+ } else if(middleName==""){
+ Bert.alert('Enter Middle name!', 'danger');
+ }else if(lastName==""){
+ Bert.alert('Enter Last name!', 'danger');
+ }else if(email==""){
+ Bert.alert('Enter email!', 'danger');
+ }else if(dob==""){
+ Bert.alert('Enter DOB!', 'danger');
+ }else if(gender==""){
+ Bert.alert('Enter Student Gender!', 'danger');
+ }else if(studentclass==""){
+ Bert.alert('Enter Class!', 'danger');
+ }else if(section==""){
+ Bert.alert('Enter Section!', 'danger');
+ }else if(community==""){
+ Bert.alert('Enter Section!', 'danger');
+ }else if(bloodGroup==""){
+ Bert.alert('Enter Blood Group!', 'danger');
+ }else if(phone==""){
+ Bert.alert('Enter phone!', 'danger');
+ }else if(address==""){
+ Bert.alert('Enter address!', 'danger');
+ }else if(city==""){
+ Bert.alert('Enter city!', 'danger');
+ }else if(state==""){
+ Bert.alert('Enter state!', 'danger');
+ }else if(parentName==""){
+ Bert.alert('Enter Parent name!', 'danger');
+ }else if(parentEmail==""){
+ Bert.alert('Enter Parent Email!', 'danger');
+ }else if(relation==""){
+ Bert.alert('Enter relation!', 'danger');
+ }else if(profession==""){
+ Bert.alert('Enter parent profession!', 'danger');
+ }else if(parentGender==""){
+ Bert.alert("Enter Parent's Gender!", 'danger');
+ }else if(parentPhone==""){
+ Bert.alert("Enter Parent's Phone!", 'danger');
+ }else if(parentAddress==""){
+ Bert.alert("Enter Parent's Address!", 'danger');
+ }else if(parentCity==""){
+ Bert.alert("Enter Parent's City!", 'danger');
+ }else if(parentState==""){
+ Bert.alert("Enter Parent's State!", 'danger');
+ }else if(parentZipcode==""){
+ Bert.alert("Enter Parent's zipcode!", 'danger');
+ }else{
+ addStudentManually.call({
+ admissionId,
+ firstName,
+ middleName,
+ lastName,
+ email,
+ dob,
+ formattedDob,
+ gender,
+ rollNo,
+ studentclass,
+ section,
+ community,
+ bloodGroup,
+ phone,
+ address,
+ city,
+ state,
+ parentName,
+ parentEmail,
+ relation,
+ profession,
+ parentGender,
+ parentPhone,
+ parentAddress,
+ parentCity,
+ parentState,
+ parentZipcode
+ }, function (error, result) {
+ console.log(error);
+ console.log(result);
+ });
+ }
+ }
+ render() {
+ return (
+
+ );
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/students/index.js b/imports/client/views/org/admin/users/students/index.js
new file mode 100644
index 0000000..016dcde
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/index.js
@@ -0,0 +1,69 @@
+// import { StudentDataController } from '/imports/client/views/org/admin/students/index'
+import _ from 'lodash';
+import {
+ composeWithTracker,
+ compose,
+ composeAll
+ } from 'react-komposer';
+import { Loading } from '/imports/client/components/Loading';
+
+import { Orgs } from '/imports/collections/orgs/index';
+import { Users } from '/imports/collections/users/index';
+import { StudentView } from './StudentView';
+import { Students } from '/imports/collections/students/index';
+
+
+const meteorTick = (props, onData) => {
+ Shelf.layout.set({
+ bulb: 'SETTINGS',
+ subbulb: 'USERS',
+ view: 'STUDENTS'
+ });
+ const handles = [
+ Meteor.subscribe('users.current'),
+ Meteor.subscribe('orgs.current'),
+ Meteor.subscribe('users.forMyOrg'),
+ Meteor.subscribe('student.forMyOrg'),
+ ];
+
+ if(_.every(handles, (handle) => (handle.ready()) )) {
+ const user = Users.current();
+ const org = Orgs.current();
+ students = Users.find({"role":"STUDENT"}).fetch() ? Users.find({"role":"STUDENT"}).fetch() : "";
+ studentData = Students.find().fetch() ? Students.find().fetch() : "";
+ for(var i=0; i< studentData.length; i++){
+ for(var j=0; j< students.length; j++){
+ if(studentData[i].userId == students[j]._id && studentData[i].admissionId){
+ studentData[i].firstName = students[j].firstName;
+ studentData[i].lastName = students[j].lastName;
+ }else{
+
+ }
+ }
+ }
+ onData(null, {
+ data: {
+ user: user,
+ org: org,
+ studentData: studentData
+ },
+ });
+ }
+
+ return () => {
+ _.each(handles, (handle) => handle.stop() );
+ };
+};
+
+
+const reduxTick = (props, onData) => {
+ onData(null, {
+ data: {}
+ });
+};
+
+
+export const StudentDataController = composeAll(
+ composeWithTracker(meteorTick, Loading),
+ compose(reduxTick, Loading),
+)(StudentView);
diff --git a/imports/client/views/org/admin/users/students/student.css b/imports/client/views/org/admin/users/students/student.css
new file mode 100644
index 0000000..dc886d1
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/student.css
@@ -0,0 +1,5 @@
+.btn-toolbar {
+ display: inline-block;
+ font-size: 0;
+ margin-right: 12px;
+}
diff --git a/imports/client/views/org/admin/users/students/view/StudentRow.js b/imports/client/views/org/admin/users/students/view/StudentRow.js
new file mode 100644
index 0000000..a02bbf6
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/view/StudentRow.js
@@ -0,0 +1,66 @@
+import _ from 'lodash';
+import { Meteor } from 'meteor/meteor';
+
+import React, { Component } from 'react';
+import { Link,browserHistory } from 'react-router';
+import { FormGroup,
+ FormControl,Glyphicon,Button } from 'react-bootstrap';
+
+
+export class StudentRow extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ editOpen: false,
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ this.toggleEditOpen = this.toggleEditOpen.bind(this);
+ this.deleteStudent = this.deleteStudent.bind(this);
+ };
+
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+ toggleEditOpen(){
+ this.setState({
+ editOpen : !this.state.editOpen
+ })
+ }
+ deleteStudent(){
+ console.log("Delete");
+ console.log(this.props.student._id);
+ }
+ render() {
+ const {student} = this.props;
+ if(student.firstName){
+ return (
+
+ {student.firstName} |
+ {student.lastName} |
+ {student.class} |
+ {student.dob? moment(student.dob).format("LL") : } |
+ Active |
+
+
+ |
+
+ );
+ }else {
+ return null;
+ }
+
+ };
+
+};
diff --git a/imports/client/views/org/admin/users/students/view/StudentTable.js b/imports/client/views/org/admin/users/students/view/StudentTable.js
new file mode 100644
index 0000000..5f331fa
--- /dev/null
+++ b/imports/client/views/org/admin/users/students/view/StudentTable.js
@@ -0,0 +1,85 @@
+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';
+import {moment} from 'meteor/momentjs:moment'
+import {StudentRow} from './StudentRow'
+import {BootstrapTable, TableHeaderColumn}from 'react-bootstrap-table';
+
+const options = {
+ page: 0, // which page you want to show as default
+ sizePerPageList: [ {
+ text: '5', value: 5
+ }, {
+ text: '10', value: 10
+ }], // you can change the dropdown list for size per page
+ sizePerPage: 5, // which size per page you want to locate as default
+ pageStartIndex: 0, // where to start counting the pages
+ paginationSize: 3, // the pagination bar size.
+ prePage: 'Prev', // Previous page button text
+ nextPage: 'Next', // Next page button text
+ firstPage: 'First', // First page button text
+ lastPage: 'Last', // Last page button text
+ paginationShowsTotal: false, // Accept bool or function
+ paginationPosition: 'bottom' // default is bottom, top and both is all available
+ // hideSizePerPage: true > You can hide the dropdown for sizePerPage
+ // alwaysShowAllBtns: true // Always show next and previous button
+ // withFirstAndLast: false > Hide the going to First and Last page button
+ };
+
+function dateFormatter(cell, row) {
+ if(cell){
+ cell = new Date(cell);
+ return `${('0' + cell.getDate()).slice(-2)}/${('0' + (cell.getMonth() + 1)).slice(-2)}/${cell.getFullYear()}`;
+ }
+}
+export class StudentTable extends Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ show: false,
+ panleOpen: true,
+ };
+ this.onUpdate = this.onUpdate.bind(this);
+ this.togglePanel = this.togglePanel.bind(this);
+ };
+ onUpdate(key, value) {
+ this.setState({[key]: value});
+ };
+ togglePanel(){
+ this.setState({panleOpen: !this.state.panleOpen});
+ }
+
+ render() {
+ studentData = this.props.studentData;
+ console.log("this.props.studentData");
+ console.log(this.props.studentData);
+ return (
+
+
+
+
+ Admission Id
+ First Name
+ Last Name
+ Class
+ DOB
+
+
+
+ );
+ };
+
+};