Commit d532f2f02b2cbf45d5c36d7121a722e42029640f

Authored by Deepak
1 parent bdd4abb610
Exists in master

made changes in routes

Showing 28 changed files with 1223 additions and 1024 deletions   Show diff stats
imports/client/app/routes.js
... ... @@ -5,6 +5,7 @@ import { render } from 'react-dom';
5 5 import { Router, Route,
6 6 IndexRoute, browserHistory } from 'react-router';
7 7 import { Meteor } from 'meteor/meteor';
  8 +import { Users } from '/imports/collections/users/index';
8 9  
9 10 /**
10 11 * General Components
... ... @@ -14,9 +15,11 @@ import NotFound from '/imports/client/views/org/NotF
14 15 /**
15 16 * Org Components
16 17 */
  18 +import { EnterModule } from '/imports/client/views/org/enter/module/index';
17 19  
18   -import { App } from '/imports/client/layouts/OrgApp';
19   -import { AppModule } from '/imports/client/views/org/app/module/Index';
  20 +
  21 +import { AdminAppModule } from '/imports/client/views/org/admin/app/module/Index';
  22 +import { DashboardController } from '/imports/client/views/org/admin/dashboard/index';
20 23 import { Orgs } from '/imports/collections/orgs/index';
21 24 import { importCsvController } from '/imports/client/views/org/importCsv/index'
22 25  
... ... @@ -41,10 +44,10 @@ There are three types of routes
41 44 2)getInvalidOrgRoute: all the routes where someone tries to enter a subdomain which hasn't been registered yet (404 mostly :D)
42 45 3)getNonOrgRoutes: all routes linked to normal site, ie signing up a new org. CHeking out demo and everything internal
43 46 **/
44   -const getOrgRoutes = () => (
  47 +const getOrgAdminRoutes = () => (
45 48 <Router history={ browserHistory }>
46   - <Route path="/" component={ App }>
47   - <IndexRoute name="index" component={ AppModule } />
  49 + <Route path="/" component={ AdminAppModule }>
  50 + <IndexRoute name="index" component={ DashboardController } />
48 51 <Route name="import" path="/import" component={ importCsvController } />
49 52 <Route name="student" path="/students" component={ StudentDataController } />
50 53 <Route name="staff" path="/staff" component={ staffViewController } />
... ... @@ -54,7 +57,13 @@ const getOrgRoutes = () =&gt; (
54 57 </Route>
55 58 </Router>
56 59 )
57   -
  60 +const getOrgNonLoggedInRoutes = () => (
  61 + <Router history={ browserHistory }>
  62 + <Route path="/" component={ EnterModule }>
  63 + <Route path="*" component={ NotFound } />
  64 + </Route>
  65 + </Router>
  66 +)
58 67  
59 68 const getInvalidOrgRoute = () => (
60 69 <Router history={ browserHistory }>
... ... @@ -118,10 +127,21 @@ const detectOrg = () =&gt; {
118 127 Meteor.call('checkExistingOrg', {slug:orgSlug}, function(err, res) {
119 128 console.log(err);
120 129 console.log(res);
  130 +
121 131 if(res){
122 132 Session.set('orgId', res._id);
123 133 Session.set('orgSlug', orgSlug);
124   - render(getOrgRoutes(),document.getElementById('app'));
  134 + if(Meteor.loggingIn() || Meteor.userId()){
  135 + userRole = _.find(res.users, {userId: Meteor.user()._id}).role;
  136 + Session.set('userRole', userRole);
  137 + if(userRole=='ADMIN'){
  138 + render(getOrgAdminRoutes(),document.getElementById('app'));
  139 + }else{
  140 +
  141 + }
  142 + }else{
  143 + render(getOrgNonLoggedInRoutes(),document.getElementById('app'));
  144 + }
125 145 }else{
126 146 render(getInvalidOrgRoute(),document.getElementById('app'));
127 147 }
... ...
imports/client/layouts/OrgApp.js
... ... @@ -1,21 +0,0 @@
1   -import React, { Component } from 'react';
2   -import { Grid } from 'react-bootstrap';
3   -import {AppNavigationController} from '/imports/client/views/org/app/module/navigation/index';
4   -/**
5   - * user based redirection will take place here
6   - */
7   - export class App extends Component {
8   - constructor(props) {
9   - super(props);
10   - this.state = {
11   -
12   - };
13   - };
14   - render(){
15   - return (
16   - <div className="app-main-layout">
17   - { this.props.children }
18   - </div>
19   - )
20   - }
21   - }
imports/client/views/org/admin/AdminLayout.js
... ... @@ -1,81 +0,0 @@
1   -import _ from 'lodash';
2   -import { Meteor } from 'meteor/meteor';
3   -import React, { Component } from 'react';
4   -import { Link } from 'react-router';
5   -import { Avatar } from '/imports/client/components/Avatar';
6   -import { Icon } from '/imports/client/components/Icon';
7   -import classNames from 'classnames';
8   -import { EnterModule } from '/imports/client/views/org/enter/module/index';
9   -import { AdminSidebar } from './Sidebar'
10   -import { AdminBreadcrumb } from './Breadcrumb'
11   -// import { VerifyModule } from '/imports/client/views/verify/module/index';
12   -import { Navbar,Modal, Nav, NavItem,
13   - Glyphicon, Collapse,
14   - NavbarToggler, NavbarBrand,
15   - NavLink, DropdownItem, DropdownToggle, DropdownMenu,
16   - NavDropdown, MenuItem, Breadcrumb } from 'react-bootstrap';
17   - import { VerifyModule } from '/imports/client/views/verify/module/index'
18   -
19   -var Accordion = require('react-bootstrap').Accordion;
20   -var Panel = require('react-bootstrap').Panel;
21   -export class AdminAppLayout extends Component {
22   - render() {
23   - const {user, org} = this.props;
24   - return (
25   - <div className = "appLayout-box">
26   - <div className="page-container">
27   - <div className="page-content">
28   - <AdminSidebar
29   - user = {user}
30   - org = {org}
31   - />
32   - <div className="content-wrapper">
33   - <AdminBreadcrumb />
34   - <div className="content">
35   - <div className="row">
36   - <div className="col-lg-3 col-md-6">
37   - <div className="thumbnail">
38   - <Link to="/students" >
39   - <div className="thumb thumb-rounded">
40   - <img src="assets/images/download2.png" alt="" />
41   - </div>
42   - <div className="caption text-center">
43   - <h6 className="text-semibold no-margin">Students <small className="display-block">Click to view</small></h6>
44   - </div>
45   - </Link>
46   - </div>
47   - </div>
48   - <div className="col-lg-3 col-md-6">
49   - <div className="thumbnail">
50   - <Link to="/staff" >
51   - <div className="thumb thumb-rounded">
52   - <img src="assets/images/download3.png" alt=""/>
53   - </div>
54   - <div className="caption text-center">
55   - <h6 className="text-semibold no-margin">Teachers <small className="display-block">Click to view</small></h6>
56   - </div>
57   - </Link>
58   - </div>
59   - </div>
60   - <div className="col-lg-3 col-md-6">
61   - <div className="thumbnail">
62   - <Link to="/parents" >
63   - <div className="thumb thumb-rounded">
64   - <img src="assets/images/download3.png" alt=""/>
65   - </div>
66   - <div className="caption text-center">
67   - <h6 className="text-semibold no-margin">Parents <small className="display-block">Click to view</small></h6>
68   - </div>
69   - </Link>
70   - </div>
71   - </div>
72   - </div>
73   - </div>
74   - </div>
75   - </div>
76   - </div>
77   - </div>
78   - );
79   - };
80   -
81   -};
imports/client/views/org/admin/app/AdminLayout.js
... ... @@ -0,0 +1,84 @@
  1 +import _ from 'lodash';
  2 +import { Meteor } from 'meteor/meteor';
  3 +import React, { Component } from 'react';
  4 +import { Link } from 'react-router';
  5 +import { Avatar } from '/imports/client/components/Avatar';
  6 +import { Icon } from '/imports/client/components/Icon';
  7 +import classNames from 'classnames';
  8 +import { EnterModule } from '/imports/client/views/org/enter/module/index';
  9 +import { AdminSidebar } from '../Sidebar'
  10 +import { AdminBreadcrumb } from '../Breadcrumb'
  11 +// import { VerifyModule } from '/imports/client/views/verify/module/index';
  12 +import { Navbar,Modal, Nav, NavItem,
  13 + Glyphicon, Collapse,
  14 + NavbarToggler, NavbarBrand,
  15 + NavLink, DropdownItem, DropdownToggle, DropdownMenu,
  16 + NavDropdown, MenuItem, Breadcrumb } from 'react-bootstrap';
  17 + import { VerifyModule } from '/imports/client/views/verify/module/index'
  18 +
  19 +var Accordion = require('react-bootstrap').Accordion;
  20 +var Panel = require('react-bootstrap').Panel;
  21 +export class AdminAppLayout extends Component {
  22 + render() {
  23 + const {user, org} = this.props;
  24 + return (
  25 + <div className="admin-app">
  26 + <div className = "appLayout-box">
  27 + <div className="page-container">
  28 + <div className="page-content">
  29 + <AdminSidebar
  30 + user = {user}
  31 + org = {org}
  32 + />
  33 + <div className="content-wrapper">
  34 + <AdminBreadcrumb />
  35 + <div className="content">
  36 + <div className="row">
  37 + <div className="col-lg-3 col-md-6">
  38 + <div className="thumbnail">
  39 + <Link to="/students" >
  40 + <div className="thumb thumb-rounded">
  41 + <img src="assets/images/download2.png" alt="" />
  42 + </div>
  43 + <div className="caption text-center">
  44 + <h6 className="text-semibold no-margin">Students <small className="display-block">Click to view</small></h6>
  45 + </div>
  46 + </Link>
  47 + </div>
  48 + </div>
  49 + <div className="col-lg-3 col-md-6">
  50 + <div className="thumbnail">
  51 + <Link to="/staff" >
  52 + <div className="thumb thumb-rounded">
  53 + <img src="assets/images/download3.png" alt=""/>
  54 + </div>
  55 + <div className="caption text-center">
  56 + <h6 className="text-semibold no-margin">Teachers <small className="display-block">Click to view</small></h6>
  57 + </div>
  58 + </Link>
  59 + </div>
  60 + </div>
  61 + <div className="col-lg-3 col-md-6">
  62 + <div className="thumbnail">
  63 + <Link to="/parents" >
  64 + <div className="thumb thumb-rounded">
  65 + <img src="assets/images/download3.png" alt=""/>
  66 + </div>
  67 + <div className="caption text-center">
  68 + <h6 className="text-semibold no-margin">Parents <small className="display-block">Click to view</small></h6>
  69 + </div>
  70 + </Link>
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </div>
  75 + </div>
  76 + </div>
  77 + </div>
  78 + </div>
  79 + </div>
  80 +
  81 + );
  82 + };
  83 +
  84 +};
... ...
imports/client/views/org/admin/app/Index.js
... ... @@ -0,0 +1,51 @@
  1 +// import { AppModule } from '/imports/client/views/app/module/index'
  2 +import {
  3 + composeWithTracker,
  4 + compose,
  5 + composeAll
  6 + } from 'react-komposer';
  7 +import { AdminAppLayout } from './AdminLayout';
  8 +import { Loading } from '/imports/client/components/Loading';
  9 +
  10 +import { Users } from '/imports/collections/users/index';
  11 +import { Orgs } from '/imports/collections/orgs/index';
  12 +
  13 +
  14 +const meteorTick = (props, onData) => {
  15 +
  16 + const handles = [
  17 + Meteor.subscribe('users.current'),
  18 + Meteor.subscribe('orgs.current'),
  19 + Meteor.subscribe('users.forMyOrg'),
  20 + Meteor.subscribe('student.forMyOrg'),
  21 + ];
  22 +
  23 + if(_.every(handles, (handle) => (handle.ready()) )) {
  24 + const user = Users.current();
  25 + const org = Orgs.current();
  26 + onData(null, {
  27 + data: {
  28 + user: user,
  29 + org: org,
  30 + },
  31 + });
  32 + }
  33 +
  34 + return () => {
  35 + _.each(handles, (handle) => handle.stop() );
  36 + };
  37 +};
  38 +
  39 +
  40 +const reduxTick = (props, onData) => {
  41 + onData(null, {
  42 + location: props.location,
  43 + data: {}
  44 + });
  45 +};
  46 +
  47 +
  48 +export const AdminModule = composeAll(
  49 + composeWithTracker(meteorTick, Loading),
  50 + compose(reduxTick, Loading),
  51 +)(AdminAppLayout);
... ...
imports/client/views/org/admin/app/module/AdminAppLayout.js
... ... @@ -0,0 +1,66 @@
  1 +import _ from 'lodash';
  2 +import { Meteor } from 'meteor/meteor';
  3 +import React, { Component } from 'react';
  4 +import { Link } from 'react-router';
  5 +import { Avatar } from '/imports/client/components/Avatar';
  6 +import { Icon } from '/imports/client/components/Icon';
  7 +import classNames from 'classnames';
  8 +import { EnterModule } from '/imports/client/views/org/enter/module/index';
  9 +import {AppNavigationController} from '/imports/client/views/org/admin/app/module/navigation/index';
  10 +import { AdminSidebar } from '../../Sidebar'
  11 +import { AdminBreadcrumb } from '../../Breadcrumb'
  12 +// import { VerifyModule } from '/imports/client/views/verify/module/index';
  13 +import { Navbar,Modal, Nav, NavItem,
  14 + Glyphicon, Collapse,
  15 + NavbarToggler, NavbarBrand,
  16 + NavLink, DropdownItem, DropdownToggle, DropdownMenu,
  17 + NavDropdown, MenuItem, Breadcrumb, Grid }
  18 + from 'react-bootstrap';
  19 +import { VerifyModule } from '/imports/client/views/verify/module/index'
  20 +import { AdminModule } from '/imports/client/views/org/admin/app/Index'
  21 +
  22 +var Accordion = require('react-bootstrap').Accordion;
  23 +var Panel = require('react-bootstrap').Panel;
  24 +export class AdminAppLayout extends Component {
  25 +
  26 + render() {
  27 + const {user, org} = this.props.data;
  28 +if(!user.isEmailVerified()) {
  29 + return (
  30 + <VerifyModule
  31 + pane = {this.props.location.query.verify}
  32 + location = {this.props.location}
  33 + />
  34 + );
  35 + }else{
  36 + return (
  37 + <div className="admin-app">
  38 + <AppNavigationController />
  39 + <div className = "appLayout-box">
  40 + <div className="page-container">
  41 + <div className="page-content">
  42 + <AdminSidebar
  43 + user = {user}
  44 + org = {org}
  45 + />
  46 + <div className="content-wrapper">
  47 + <AdminBreadcrumb />
  48 + <div className="content">
  49 + { this.props.children }
  50 + </div>
  51 + </div>
  52 + </div>
  53 + </div>
  54 + </div>
  55 + </div>
  56 + )
  57 + return(
  58 + <AdminModule
  59 + user = {user}
  60 + org = {org}
  61 + />
  62 + );
  63 + }
  64 + };
  65 +
  66 +};
... ...
imports/client/views/org/admin/app/module/Index.js
... ... @@ -0,0 +1,51 @@
  1 +// import { AppModule } from '/imports/client/views/app/module/index'
  2 +import {
  3 + composeWithTracker,
  4 + compose,
  5 + composeAll
  6 + } from 'react-komposer';
  7 +import { AdminAppLayout } from './AdminAppLayout';
  8 +import { Loading } from '/imports/client/components/Loading';
  9 +
  10 +import { Users } from '/imports/collections/users/index';
  11 +import { Orgs } from '/imports/collections/orgs/index';
  12 +
  13 +
  14 +const meteorTick = (props, onData) => {
  15 +
  16 + const handles = [
  17 + Meteor.subscribe('users.current'),
  18 + Meteor.subscribe('orgs.current'),
  19 + Meteor.subscribe('users.forMyOrg'),
  20 + Meteor.subscribe('student.forMyOrg'),
  21 + ];
  22 +
  23 + if(_.every(handles, (handle) => (handle.ready()) )) {
  24 + const user = Users.current();
  25 + const org = Orgs.current();
  26 + onData(null, {
  27 + data: {
  28 + user: user,
  29 + org: org,
  30 + },
  31 + });
  32 + }
  33 +
  34 + return () => {
  35 + _.each(handles, (handle) => handle.stop() );
  36 + };
  37 +};
  38 +
  39 +
  40 +const reduxTick = (props, onData) => {
  41 + onData(null, {
  42 + location: props.location,
  43 + data: {}
  44 + });
  45 +};
  46 +
  47 +
  48 +export const AdminAppModule = composeAll(
  49 + composeWithTracker(meteorTick, Loading),
  50 + compose(reduxTick, Loading),
  51 +)(AdminAppLayout);
... ...
imports/client/views/org/admin/app/module/navigation/AppNavigation.js
... ... @@ -0,0 +1,54 @@
  1 +import React, { Component } from 'react';
  2 +import { Navbar } from 'react-bootstrap';
  3 +import { Link } from 'react-router';
  4 +import {PublicNavigation} from './PublicNavigation.js';
  5 +import {AuthenticatedNavigation} from './AuthenticatedNavigation.js';
  6 +// import '/imports/client/assets/css/icons/icomoon/styles.css';
  7 +// import '/imports/client/assets/css/bootstrap.css';
  8 +// import '/imports/client/assets/css/core.css';
  9 +// import '/imports/client/assets/css/components.css';
  10 +// import '/imports/client/assets/css/colors.css';
  11 +// import '/imports/client/assets/css/colors.css';
  12 +export class AppNavigation extends Component {
  13 +
  14 + constructor(props) {
  15 + super(props);
  16 + this.state = {
  17 +
  18 + };
  19 + };
  20 +
  21 + onUpdate(key, value) {
  22 + this.setState({[key]: value});
  23 + };
  24 + render() {
  25 + const {user} = this.props.data;
  26 + if(user){
  27 + return(
  28 + <AuthenticatedNavigation
  29 + data = {this.props.data}
  30 + />
  31 + )
  32 + }else{
  33 + return(
  34 + <Navbar>
  35 + <Navbar.Header>
  36 + <Navbar.Brand>
  37 + <Link to="/">Application Name</Link>
  38 + </Navbar.Brand>
  39 + <Navbar.Toggle />
  40 + </Navbar.Header>
  41 + <Navbar.Collapse>
  42 + <PublicNavigation />
  43 + </Navbar.Collapse>
  44 + </Navbar>
  45 +
  46 + )
  47 + }
  48 +
  49 + return (
  50 + <div></div>
  51 + );
  52 + };
  53 +
  54 +};
... ...
imports/client/views/org/admin/app/module/navigation/AuthenticatedNavigation.js
... ... @@ -0,0 +1,312 @@
  1 +import React, { Component } from 'react';
  2 +import { browserHistory } from 'react-router';
  3 +import { LinkContainer } from 'react-router-bootstrap';
  4 +import { logout } from '/imports/client/app/utils/loginMethods';
  5 +import { Navbar,Modal, Nav, NavItem,
  6 + Glyphicon, Collapse,
  7 + NavbarToggler, NavbarBrand,
  8 + NavLink, DropdownItem, DropdownToggle, DropdownMenu,
  9 + NavDropdown, MenuItem } from 'react-bootstrap';
  10 +import { Meteor } from 'meteor/meteor';
  11 +import $ from 'jquery';
  12 +
  13 +
  14 +const handleLogout = () => Meteor.logout(() => browserHistory.push('/login'));
  15 +
  16 +export class AuthenticatedNavigation extends Component {
  17 + constructor(props) {
  18 + super(props);
  19 + this.toggle = this.toggle.bind(this);
  20 + this.changeBodyClass = this.changeBodyClass.bind(this);
  21 + this.state = {
  22 + dropdownOpen: false,
  23 + burgerMenu: false
  24 + };
  25 + }
  26 + toggle() {
  27 + this.setState({
  28 + dropdownOpen: !this.state.dropdownOpen
  29 + });
  30 + }
  31 + changeBodyClass(){
  32 + if(this.state.burgerMenu){
  33 + $('body').addClass('sidebar-xs');
  34 + this.setState({burgerMenu: false});
  35 + }else{
  36 + $('body').removeClass('sidebar-xs');
  37 + this.setState({burgerMenu: true});
  38 + }
  39 + }
  40 + render(){
  41 + const {user, org} = this.props.data;
  42 + return(
  43 + <Navbar inverse collapseOnSelect className="bg-crimson">
  44 + <Navbar.Header>
  45 + <Navbar.Brand>
  46 + <a href="#">
  47 + <Glyphicon glyph="link" />
  48 + &nbsp; YoungDesk
  49 + </a>
  50 + </Navbar.Brand>
  51 + <ul className="nav navbar-nav visible-xs-block">
  52 + <li><a href="#"><i className="icon-tree5"/></a></li>
  53 + <li><a className="sidebar-mobile-main-toggle"><i className="icon-paragraph-justify3"/></a></li>
  54 + </ul>
  55 + <Navbar.Toggle />
  56 + </Navbar.Header>
  57 + <Navbar.Collapse id="navbar-mobile">
  58 + <ul className="nav navbar-nav">
  59 + <NavItem eventKey={1} href="#" className="sidebar-control sidebar-main-toggle hidden-xs">
  60 + <i
  61 + className="icon-paragraph-justify3 burgerMenu"
  62 + onClick = {this.changeBodyClass}
  63 + />
  64 + </NavItem>
  65 +
  66 + <NavDropdown title="Dropdown" id="update">
  67 + <div className="dropdown-content">
  68 + <div className="dropdown-content-heading">
  69 + Git updates
  70 + <ul className="icons-list">
  71 + <li><a href="#"><i className="icon-sync"></i></a></li>
  72 + </ul>
  73 +
  74 + </div>
  75 + <ul className="media-list dropdown-content-body width-350">
  76 + <li className="media">
  77 + <div className="media-left">
  78 + <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a>
  79 + </div>
  80 +
  81 + <div className="media-body">
  82 + Drop the IE <a href="#">specific hacks</a> for temporal inputs
  83 + <div className="media-annotation">4 minutes ago</div>
  84 + </div>
  85 + </li>
  86 +
  87 + <li className="media">
  88 + <div className="media-left">
  89 + <a href="#" className="btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-commit"></i></a>
  90 + </div>
  91 +
  92 + <div className="media-body">
  93 + Add full font overrides for popovers and tooltips
  94 + <div className="media-annotation">36 minutes ago</div>
  95 + </div>
  96 + </li>
  97 +
  98 + <li className="media">
  99 + <div className="media-left">
  100 + <a href="#" className="btn border-info text-info btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-branch"></i></a>
  101 + </div>
  102 +
  103 + <div className="media-body">
  104 + <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch
  105 + <div className="media-annotation">2 hours ago</div>
  106 + </div>
  107 + </li>
  108 +
  109 + <li className="media">
  110 + <div className="media-left">
  111 + <a href="#" className="btn border-success text-success btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-merge"></i></a>
  112 + </div>
  113 +
  114 + <div className="media-body">
  115 + <a href="#">Eugene Kopyov</a> merged <span className="text-semibold">Master</span> and <span className="text-semibold">Dev</span> branches
  116 + <div className="media-annotation">Dec 18, 18:36</div>
  117 + </div>
  118 + </li>
  119 +
  120 + <li className="media">
  121 + <div className="media-left">
  122 + <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a>
  123 + </div>
  124 +
  125 + <div className="media-body">
  126 + Have Carousel ignore keyboard events
  127 + <div className="media-annotation">Dec 12, 05:46</div>
  128 + </div>
  129 + </li>
  130 + </ul>
  131 + <div className="dropdown-content-footer">
  132 + <a href="#" data-popup="tooltip" title="All activity"><i className="icon-menu display-block"></i></a>
  133 + </div>
  134 + </div>
  135 + </NavDropdown>
  136 + </ul>
  137 + <div className="navbar-right">
  138 + <p className="navbar-text">Hello {user.getFullName()}</p>
  139 + <p className="navbar-text"
  140 + onClick = {() => logout()}
  141 + >
  142 + <span className="label logout">logout</span>
  143 + </p>
  144 + <Nav>
  145 + <NavDropdown title="Activity" id="activity">
  146 + <div className="dropdown-content">
  147 + <div className="dropdown-content-heading">
  148 + Activity
  149 + <ul className="icons-list">
  150 + <li><a href="#"><i className="icon-menu7"></i></a></li>
  151 + </ul>
  152 + </div>
  153 + <ul className="media-list dropdown-content-body width-350">
  154 + <li className="media">
  155 + <div className="media-left">
  156 + <a href="#" className="btn bg-success-400 btn-rounded btn-icon btn-xs"><i className="icon-mention"></i></a>
  157 + </div>
  158 +
  159 + <div className="media-body">
  160 + <a href="#">Taylor Swift</a> mentioned you in a post "Angular JS. Tips and tricks"
  161 + <div className="media-annotation">4 minutes ago</div>
  162 + </div>
  163 + </li>
  164 + <li className="media">
  165 + <div className="media-left">
  166 + <a href="#" className="btn bg-pink-400 btn-rounded btn-icon btn-xs"><i className="icon-paperplane"></i></a>
  167 + </div>
  168 +
  169 + <div className="media-body">
  170 + Special offers have been sent to subscribed users by <a href="#">Donna Gordon</a>
  171 + <div className="media-annotation">36 minutes ago</div>
  172 + </div>
  173 + </li>
  174 + <li className="media">
  175 + <div className="media-left">
  176 + <a href="#" className="btn bg-blue btn-rounded btn-icon btn-xs"><i className="icon-plus3"></i></a>
  177 + </div>
  178 +
  179 + <div className="media-body">
  180 + <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch in <span className="text-semibold">Limitless</span> repository
  181 + <div className="media-annotation">2 hours ago</div>
  182 + </div>
  183 + </li>
  184 +
  185 + <li className="media">
  186 + <div className="media-left">
  187 + <a href="#" className="btn bg-purple-300 btn-rounded btn-icon btn-xs"><i className="icon-truck"></i></a>
  188 + </div>
  189 +
  190 + <div className="media-body">
  191 + Shipping cost to the Netherlands has been reduced, database updated
  192 + <div className="media-annotation">Feb 8, 11:30</div>
  193 + </div>
  194 + </li>
  195 +
  196 + <li className="media">
  197 + <div className="media-left">
  198 + <a href="#" className="btn bg-warning-400 btn-rounded btn-icon btn-xs"><i className="icon-bubble8"></i></a>
  199 + </div>
  200 +
  201 + <div className="media-body">
  202 + New review received on <a href="#">Server side integration</a> services
  203 + <div className="media-annotation">Feb 2, 10:20</div>
  204 + </div>
  205 + </li>
  206 +
  207 + <li className="media">
  208 + <div className="media-left">
  209 + <a href="#" className="btn bg-teal-400 btn-rounded btn-icon btn-xs"><i className="icon-spinner11"></i></a>
  210 + </div>
  211 +
  212 + <div className="media-body">
  213 + <strong>January, 2016</strong> - 1320 new users, 3284 orders, $49,390 revenue
  214 + <div className="media-annotation">Feb 1, 05:46</div>
  215 + </div>
  216 + </li>
  217 + </ul>
  218 + </div>
  219 + </NavDropdown>
  220 + <NavDropdown title="Messages" id="messages">
  221 + <div className="dropdown-content width-350">
  222 + <div className="dropdown-content-heading">
  223 + Messages
  224 + <ul className="icons-list">
  225 + <li><a href="#"><i className="icon-compose"></i></a></li>
  226 + </ul>
  227 + </div>
  228 +
  229 + <ul className="media-list dropdown-content-body">
  230 + <li className="media">
  231 + <div className="media-left">
  232 +
  233 + <span className="badge bg-danger-400 media-badge">5</span>
  234 + </div>
  235 +
  236 + <div className="media-body">
  237 + <a href="#" className="media-heading">
  238 + <span className="text-semibold">James Alexander</span>
  239 + <span className="media-annotation pull-right">04:58</span>
  240 + </a>
  241 +
  242 + <span className="text-muted">who knows, maybe that would be the best thing for me...</span>
  243 + </div>
  244 + </li>
  245 +
  246 + <li className="media">
  247 + <div className="media-left">
  248 +
  249 + <span className="badge bg-danger-400 media-badge">4</span>
  250 + </div>
  251 +
  252 + <div className="media-body">
  253 + <a href="#" className="media-heading">
  254 + <span className="text-semibold">Margo Baker</span>
  255 + <span className="media-annotation pull-right">12:16</span>
  256 + </a>
  257 +
  258 + <span className="text-muted">That was something he was unable to do because...</span>
  259 + </div>
  260 + </li>
  261 +
  262 + <li className="media">
  263 + <div className="media-left"></div>
  264 + <div className="media-body">
  265 + <a href="#" className="media-heading">
  266 + <span className="text-semibold">Jeremy Victorino</span>
  267 + <span className="media-annotation pull-right">22:48</span>
  268 + </a>
  269 +
  270 + <span className="text-muted">But that would be extremely strained and suspicious...</span>
  271 + </div>
  272 + </li>
  273 +
  274 + <li className="media">
  275 + <div className="media-left"></div>
  276 + <div className="media-body">
  277 + <a href="#" className="media-heading">
  278 + <span className="text-semibold">Beatrix Diaz</span>
  279 + <span className="media-annotation pull-right">Tue</span>
  280 + </a>
  281 +
  282 + <span className="text-muted">What a strenuous career it is that I have chosen...</span>
  283 + </div>
  284 + </li>
  285 +
  286 + <li className="media">
  287 + <div className="media-left">
  288 +
  289 + </div>
  290 + <div className="media-body">
  291 + <a href="#" className="media-heading">
  292 + <span className="text-semibold">Richard Vango</span>
  293 + <span className="media-annotation pull-right">Mon</span>
  294 + </a>
  295 +
  296 + <span className="text-muted">Other travelling salesmen live a life of luxury...</span>
  297 + </div>
  298 + </li>
  299 + </ul>
  300 +
  301 + <div className="dropdown-content-footer">
  302 + <a href="#" data-popup="tooltip" title="All messages"><i className="icon-menu display-block"></i></a>
  303 + </div>
  304 + </div>
  305 + </NavDropdown>
  306 + </Nav>
  307 + </div>
  308 + </Navbar.Collapse>
  309 + </Navbar>
  310 + );
  311 + }
  312 +}
... ...
imports/client/views/org/admin/app/module/navigation/AuthenticatedNavigation0.js
... ... @@ -0,0 +1,303 @@
  1 +import React, { Component } from 'react';
  2 +import { browserHistory } from 'react-router';
  3 +import { LinkContainer } from 'react-router-bootstrap';
  4 +import { Nav, NavItem,
  5 + NavDropdown, MenuItem } from 'react-bootstrap';
  6 +import { Meteor } from 'meteor/meteor';
  7 +
  8 +const handleLogout = () => Meteor.logout(() => browserHistory.push('/login'));
  9 +
  10 +export class AuthenticatedNavigation extends Component {
  11 + constructor(props) {
  12 + super(props);
  13 + this.state = {
  14 +
  15 + };
  16 + };
  17 +render(){
  18 + const {user} = this.props.data;
  19 + return(
  20 + <div>
  21 + <div className="navbar navbar-inverse bg-crimson">
  22 + <div className="navbar-header">
  23 + <a className="navbar-brand" href="index.html"><span className="glyphicon glyphicon-link"></span>
  24 + <span> YOUNGDESK </span>
  25 + </a>
  26 +
  27 + <ul className="nav navbar-nav visible-xs-block">
  28 + <li><a data-toggle="collapse" data-target="#navbar-mobile"><i className="icon-tree5"></i></a></li>
  29 + <li><a className="sidebar-mobile-main-toggle"><i className="icon-paragraph-justify3"></i></a></li>
  30 + </ul>
  31 + </div>
  32 +
  33 + <div className="navbar-collapse collapse" id="navbar-mobile">
  34 + <ul className="nav navbar-nav">
  35 + <li><a className="sidebar-control sidebar-main-toggle hidden-xs"><i className="icon-paragraph-justify3"></i></a></li>
  36 +
  37 + <li className="dropdown">
  38 + <a href="#" className="dropdown-toggle" data-toggle="dropdown">
  39 + <i className="icon-puzzle3"></i>
  40 + <span className="visible-xs-inline-block position-right">Git updates</span>
  41 + <span className="status-mark border-orange-400"></span>
  42 + </a>
  43 +
  44 + <div className="dropdown-menu dropdown-content">
  45 + <div className="dropdown-content-heading">
  46 + Git updates
  47 + <ul className="icons-list">
  48 + <li><a href="#"><i className="icon-sync"></i></a></li>
  49 + </ul>
  50 + </div>
  51 +
  52 + <ul className="media-list dropdown-content-body width-350">
  53 + <li className="media">
  54 + <div className="media-left">
  55 + <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a>
  56 + </div>
  57 +
  58 + <div className="media-body">
  59 + Drop the IE <a href="#">specific hacks</a> for temporal inputs
  60 + <div className="media-annotation">4 minutes ago</div>
  61 + </div>
  62 + </li>
  63 +
  64 + <li className="media">
  65 + <div className="media-left">
  66 + <a href="#" className="btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-commit"></i></a>
  67 + </div>
  68 +
  69 + <div className="media-body">
  70 + Add full font overrides for popovers and tooltips
  71 + <div className="media-annotation">36 minutes ago</div>
  72 + </div>
  73 + </li>
  74 +
  75 + <li className="media">
  76 + <div className="media-left">
  77 + <a href="#" className="btn border-info text-info btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-branch"></i></a>
  78 + </div>
  79 +
  80 + <div className="media-body">
  81 + <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch
  82 + <div className="media-annotation">2 hours ago</div>
  83 + </div>
  84 + </li>
  85 +
  86 + <li className="media">
  87 + <div className="media-left">
  88 + <a href="#" className="btn border-success text-success btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-merge"></i></a>
  89 + </div>
  90 +
  91 + <div className="media-body">
  92 + <a href="#">Eugene Kopyov</a> merged <span className="text-semibold">Master</span> and <span className="text-semibold">Dev</span> branches
  93 + <div className="media-annotation">Dec 18, 18:36</div>
  94 + </div>
  95 + </li>
  96 +
  97 + <li className="media">
  98 + <div className="media-left">
  99 + <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a>
  100 + </div>
  101 +
  102 + <div className="media-body">
  103 + Have Carousel ignore keyboard events
  104 + <div className="media-annotation">Dec 12, 05:46</div>
  105 + </div>
  106 + </li>
  107 + </ul>
  108 +
  109 + <div className="dropdown-content-footer">
  110 + <a href="#" data-popup="tooltip" title="All activity"><i className="icon-menu display-block"></i></a>
  111 + </div>
  112 + </div>
  113 + </li>
  114 + </ul>
  115 +
  116 + <div className="navbar-right">
  117 + <p className="navbar-text">Hello {`${user.firstName} ${user.lastName}`}!</p>
  118 + <p className="navbar-text"><span className="label bg-success-400">Online</span></p>
  119 +
  120 + <ul className="nav navbar-nav">
  121 + <li className="dropdown">
  122 + <a href="#" className="dropdown-toggle" data-toggle="dropdown">
  123 + <i className="icon-bell2"></i>
  124 + <span className="visible-xs-inline-block position-right">Activity</span>
  125 + <span className="status-mark border-orange-400"></span>
  126 + </a>
  127 +
  128 + <div className="dropdown-menu dropdown-content">
  129 + <div className="dropdown-content-heading">
  130 + Activity
  131 + <ul className="icons-list">
  132 + <li><a href="#"><i className="icon-menu7"></i></a></li>
  133 + </ul>
  134 + </div>
  135 +
  136 + <ul className="media-list dropdown-content-body width-350">
  137 + <li className="media">
  138 + <div className="media-left">
  139 + <a href="#" className="btn bg-success-400 btn-rounded btn-icon btn-xs"><i className="icon-mention"></i></a>
  140 + </div>
  141 +
  142 + <div className="media-body">
  143 + <a href="#">Taylor Swift</a> mentioned you in a post "Angular JS. Tips and tricks"
  144 + <div className="media-annotation">4 minutes ago</div>
  145 + </div>
  146 + </li>
  147 +
  148 + <li className="media">
  149 + <div className="media-left">
  150 + <a href="#" className="btn bg-pink-400 btn-rounded btn-icon btn-xs"><i className="icon-paperplane"></i></a>
  151 + </div>
  152 +
  153 + <div className="media-body">
  154 + Special offers have been sent to subscribed users by <a href="#">Donna Gordon</a>
  155 + <div className="media-annotation">36 minutes ago</div>
  156 + </div>
  157 + </li>
  158 +
  159 + <li className="media">
  160 + <div className="media-left">
  161 + <a href="#" className="btn bg-blue btn-rounded btn-icon btn-xs"><i className="icon-plus3"></i></a>
  162 + </div>
  163 +
  164 + <div className="media-body">
  165 + <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch in <span className="text-semibold">Limitless</span> repository
  166 + <div className="media-annotation">2 hours ago</div>
  167 + </div>
  168 + </li>
  169 +
  170 + <li className="media">
  171 + <div className="media-left">
  172 + <a href="#" className="btn bg-purple-300 btn-rounded btn-icon btn-xs"><i className="icon-truck"></i></a>
  173 + </div>
  174 +
  175 + <div className="media-body">
  176 + Shipping cost to the Netherlands has been reduced, database updated
  177 + <div className="media-annotation">Feb 8, 11:30</div>
  178 + </div>
  179 + </li>
  180 +
  181 + <li className="media">
  182 + <div className="media-left">
  183 + <a href="#" className="btn bg-warning-400 btn-rounded btn-icon btn-xs"><i className="icon-bubble8"></i></a>
  184 + </div>
  185 +
  186 + <div className="media-body">
  187 + New review received on <a href="#">Server side integration</a> services
  188 + <div className="media-annotation">Feb 2, 10:20</div>
  189 + </div>
  190 + </li>
  191 +
  192 + <li className="media">
  193 + <div className="media-left">
  194 + <a href="#" className="btn bg-teal-400 btn-rounded btn-icon btn-xs"><i className="icon-spinner11"></i></a>
  195 + </div>
  196 +
  197 + <div className="media-body">
  198 + <strong>January, 2016</strong> - 1320 new users, 3284 orders, $49,390 revenue
  199 + <div className="media-annotation">Feb 1, 05:46</div>
  200 + </div>
  201 + </li>
  202 + </ul>
  203 + </div>
  204 + </li>
  205 +
  206 + <li className="dropdown">
  207 + <a href="#" className="dropdown-toggle" data-toggle="dropdown">
  208 + <i className="icon-bubble8"></i>
  209 + <span className="visible-xs-inline-block position-right">Messages</span>
  210 + <span className="status-mark border-orange-400"></span>
  211 + </a>
  212 +
  213 + <div className="dropdown-menu dropdown-content width-350">
  214 + <div className="dropdown-content-heading">
  215 + Messages
  216 + <ul className="icons-list">
  217 + <li><a href="#"><i className="icon-compose"></i></a></li>
  218 + </ul>
  219 + </div>
  220 +
  221 + <ul className="media-list dropdown-content-body">
  222 + <li className="media">
  223 + <div className="media-left">
  224 + <img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" />
  225 + <span className="badge bg-danger-400 media-badge">5</span>
  226 + </div>
  227 +
  228 + <div className="media-body">
  229 + <a href="#" className="media-heading">
  230 + <span className="text-semibold">James Alexander</span>
  231 + <span className="media-annotation pull-right">04:58</span>
  232 + </a>
  233 +
  234 + <span className="text-muted">who knows, maybe that would be the best thing for me...</span>
  235 + </div>
  236 + </li>
  237 +
  238 + <li className="media">
  239 + <div className="media-left">
  240 + <img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" />
  241 + <span className="badge bg-danger-400 media-badge">4</span>
  242 + </div>
  243 +
  244 + <div className="media-body">
  245 + <a href="#" className="media-heading">
  246 + <span className="text-semibold">Margo Baker</span>
  247 + <span className="media-annotation pull-right">12:16</span>
  248 + </a>
  249 +
  250 + <span className="text-muted">That was something he was unable to do because...</span>
  251 + </div>
  252 + </li>
  253 +
  254 + <li className="media">
  255 + <div className="media-left"><img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" /></div>
  256 + <div className="media-body">
  257 + <a href="#" className="media-heading">
  258 + <span className="text-semibold">Jeremy Victorino</span>
  259 + <span className="media-annotation pull-right">22:48</span>
  260 + </a>
  261 +
  262 + <span className="text-muted">But that would be extremely strained and suspicious...</span>
  263 + </div>
  264 + </li>
  265 +
  266 + <li className="media">
  267 + <div className="media-left"><img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" /></div>
  268 + <div className="media-body">
  269 + <a href="#" className="media-heading">
  270 + <span className="text-semibold">Beatrix Diaz</span>
  271 + <span className="media-annotation pull-right">Tue</span>
  272 + </a>
  273 +
  274 + <span className="text-muted">What a strenuous career it is that I have chosen...</span>
  275 + </div>
  276 + </li>
  277 +
  278 + <li className="media">
  279 + <div className="media-left"><img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" /></div>
  280 + <div className="media-body">
  281 + <a href="#" className="media-heading">
  282 + <span className="text-semibold">Richard Vango</span>
  283 + <span className="media-annotation pull-right">Mon</span>
  284 + </a>
  285 +
  286 + <span className="text-muted">Other travelling salesmen live a life of luxury...</span>
  287 + </div>
  288 + </li>
  289 + </ul>
  290 +
  291 + <div className="dropdown-content-footer">
  292 + <a href="#" data-popup="tooltip" title="All messages"><i className="icon-menu display-block"></i></a>
  293 + </div>
  294 + </div>
  295 + </li>
  296 + </ul>
  297 + </div>
  298 + </div>
  299 + </div>
  300 + </div>
  301 +);
  302 +}
  303 +}
... ...
imports/client/views/org/admin/app/module/navigation/Loading.js
... ... @@ -0,0 +1,30 @@
  1 +import React from 'react';
  2 +
  3 +const Loading = () => (
  4 + <svg
  5 + version="1.1"
  6 + className="Loading"
  7 + xmlns="http://www.w3.org/2000/svg"
  8 + x="0px"
  9 + y="0px"
  10 + width="40px"
  11 + height="40px"
  12 + viewBox="0 0 40 40"
  13 + enableBackground="new 0 0 40 40">
  14 + <path
  15 + opacity="1.0"
  16 + fill="#eee"
  17 + d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,
  18 + 14.946,14.946s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,
  19 + 5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634c0-6.425,
  20 + 5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,
  21 + 26.541,26.626,31.749,20.201,31.749z"/>
  22 + <path
  23 + fill="#da5347"
  24 + d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
  25 + C22.32,8.481,24.301,9.057,26.013,10.047z">
  26 + </path>
  27 + </svg>
  28 +);
  29 +
  30 +export default Loading;
... ...
imports/client/views/org/admin/app/module/navigation/PublicNavigation.js
... ... @@ -0,0 +1,27 @@
  1 +import React, { Component } from 'react';
  2 +import { LinkContainer } from 'react-router-bootstrap';
  3 +import { setQueryParam } from '/imports/client/app/utils/setQueryParam';
  4 +import { browserHistory } from 'react-router';
  5 +import { Nav, NavItem } from 'react-bootstrap';
  6 +
  7 +
  8 +export class PublicNavigation extends Component {
  9 + constructor(props) {
  10 + super(props);
  11 + this.state = {
  12 +
  13 + };
  14 + };
  15 +render(){
  16 + console.log(this.props);
  17 + var mainSite = document.location.hostname.split( "." )[1];
  18 + var signup = `http://${mainSite}/signup`;
  19 + return(
  20 + <Nav pullRight>
  21 + <LinkContainer to="login">
  22 + <NavItem eventKey={ 2 } href="/login">Log In</NavItem>
  23 + </LinkContainer>
  24 + </Nav>
  25 + )
  26 +}
  27 +}
... ...
imports/client/views/org/admin/app/module/navigation/index.js
... ... @@ -0,0 +1,49 @@
  1 +// import { InviteSignupController } from '/imports/client/views/invite/signup/index'
  2 +import _ from 'lodash';
  3 +import {
  4 + composeWithTracker,
  5 + compose,
  6 + composeAll
  7 + } from 'react-komposer';
  8 +import { Loading } from '/imports/client/components/Loading';
  9 +
  10 +import { Orgs } from '/imports/collections/orgs/index';
  11 +import { Users } from '/imports/collections/users/index';
  12 +
  13 +import { AppNavigation } from './AppNavigation';
  14 +
  15 +const meteorTick = (props, onData) => {
  16 +
  17 + const handles = [
  18 + Meteor.subscribe('users.current'),
  19 + Meteor.subscribe('orgs.current')
  20 + ];
  21 +
  22 + if(_.every(handles, (handle) => (handle.ready()) )) {
  23 + const user = Users.current();
  24 + const org = Orgs.current();
  25 + onData(null, {
  26 + data: {
  27 + user: user,
  28 + org: org
  29 + },
  30 + });
  31 + }
  32 +
  33 + return () => {
  34 + _.each(handles, (handle) => handle.stop() );
  35 + };
  36 +};
  37 +
  38 +
  39 +const reduxTick = (props, onData) => {
  40 + onData(null, {
  41 + data: {}
  42 + });
  43 +};
  44 +
  45 +
  46 +export const AppNavigationController = composeAll(
  47 + composeWithTracker(meteorTick, Loading),
  48 + compose(reduxTick, Loading),
  49 +)(AppNavigation);
... ...
imports/client/views/org/admin/dashboard/dashboard.js
... ... @@ -0,0 +1,33 @@
  1 +import _ from 'lodash';
  2 +import { Meteor } from 'meteor/meteor';
  3 +
  4 +import React, { Component } from 'react';
  5 +import { Link,browserHistory } from 'react-router';
  6 +import { FormGroup,
  7 + FormControl,Glyphicon,Button } from 'react-bootstrap';
  8 +
  9 +
  10 +export class DashboardView extends Component {
  11 +
  12 + constructor(props) {
  13 + super(props);
  14 + this.state = {
  15 +
  16 + };
  17 + this.onUpdate = this.onUpdate.bind(this);
  18 + };
  19 +
  20 + onUpdate(key, value) {
  21 + this.setState({[key]: value});
  22 + };
  23 +
  24 + render() {
  25 + const {user, org} = this.props.data;
  26 + return (
  27 + <div className = "enterPane-box">
  28 + <h1>Dashboard</h1>
  29 + </div>
  30 + );
  31 + };
  32 +
  33 +};
... ...
imports/client/views/org/admin/dashboard/index.js
... ... @@ -0,0 +1,48 @@
  1 +// import { InviteSignupController } from '/imports/client/views/invite/signup/index'
  2 +import _ from 'lodash';
  3 +import {
  4 + composeWithTracker,
  5 + compose,
  6 + composeAll
  7 + } from 'react-komposer';
  8 +import { Loading } from '/imports/client/components/Loading';
  9 +
  10 +import { Orgs } from '/imports/collections/orgs/index';
  11 +import { Users } from '/imports/collections/users/index';
  12 +import { DashboardView } from './dashboard';
  13 +
  14 +const meteorTick = (props, onData) => {
  15 +
  16 + const handles = [
  17 + Meteor.subscribe('users.current'),
  18 + Meteor.subscribe('orgs.current')
  19 + ];
  20 +
  21 + if(_.every(handles, (handle) => (handle.ready()) )) {
  22 + const user = Users.current();
  23 + const org = Orgs.current();
  24 + onData(null, {
  25 + data: {
  26 + user: user,
  27 + org: org
  28 + },
  29 + });
  30 + }
  31 +
  32 + return () => {
  33 + _.each(handles, (handle) => handle.stop() );
  34 + };
  35 +};
  36 +
  37 +
  38 +const reduxTick = (props, onData) => {
  39 + onData(null, {
  40 + data: {}
  41 + });
  42 +};
  43 +
  44 +
  45 +export const DashboardController = composeAll(
  46 + composeWithTracker(meteorTick, Loading),
  47 + compose(reduxTick, Loading),
  48 +)(DashboardView);
... ...
imports/client/views/org/admin/parents/parentsview.js
... ... @@ -31,33 +31,17 @@ export class ParentsView extends Component {
31 31 render() {
32 32 const {user, org, parent} = this.props.data;
33 33 return (
34   - <div className="appLayout-box">
35   - <div className="page-container">
36   - <div className="page-content">
37   - <AdminSidebar
38   - user = {user}
39   - org = {org}
  34 + <div className="container-detached">
  35 + <Header
  36 + user = {user}
  37 + org = {org}
  38 + />
  39 + <ParentTable
  40 + data = {this.props.data}
  41 + parent = {parent}
40 42 />
41   - <div className="content-wrapper">
42   - <AdminBreadcrumb />
43   -
44   - <div className="content has-detached-left">
45   - <div className="container-detached">
46   - <Header
47   - user = {user}
48   - org = {org}
49   - />
50   - <ParentTable
51   - data = {this.props.data}
52   - parent = {parent}
53   - />
54   - {/* <AddStaff/>
55   - <UploadCsvStaff /> */}
56   - </div>
57   - </div>
58   - </div>
59   - </div>
60   - </div>
  43 + {/* <AddStaff/>
  44 + <UploadCsvStaff /> */}
61 45 </div>
62 46 );
63 47 };
... ...
imports/client/views/org/admin/staff/StaffView.js
... ... @@ -6,8 +6,6 @@ import { Link,browserHistory } from &#39;react-router&#39;;
6 6 import { FormGroup,
7 7 FormControl,Glyphicon,Button } from 'react-bootstrap';
8 8 import { Header } from '../Header';
9   -import { AdminSidebar } from '../Sidebar'
10   -import { AdminBreadcrumb } from '../Breadcrumb'
11 9 import { StaffTable } from './view/StaffTable'
12 10 import { AddStaff } from './add/addStaff'
13 11 import { UploadCsvStaff } from './UploadCsvStaff'
... ... @@ -28,32 +26,17 @@ export class StaffView extends Component {
28 26 render() {
29 27 const {user, org, staff} = this.props.data;
30 28 return (
31   - <div className="appLayout-box">
32   - <div className="page-container">
33   - <div className="page-content">
34   - <AdminSidebar
35   - user = {user}
36   - org = {org}
37   - />
38   - <div className="content-wrapper">
39   - <AdminBreadcrumb />
40   - <div className="content has-detached-left">
41   - <div className="container-detached">
42   - <Header
43   - user = {user}
44   - org = {org}
45   - />
46   - <StaffTable
47   - data = {this.props.data}
48   - staff = {staff}
49   - />
50   - <AddStaff/>
51   - <UploadCsvStaff />
52   - </div>
53   - </div>
54   - </div>
55   - </div>
56   - </div>
  29 + <div className="container-detached">
  30 + <Header
  31 + user = {user}
  32 + org = {org}
  33 + />
  34 + <StaffTable
  35 + data = {this.props.data}
  36 + staff = {staff}
  37 + />
  38 + <AddStaff/>
  39 + <UploadCsvStaff />
57 40 </div>
58 41 );
59 42 };
... ...
imports/client/views/org/admin/students/StudentView.js
... ... @@ -10,8 +10,6 @@ import { Navbar,Modal, Nav, NavItem,
10 10 NavDropdown, MenuItem, Breadcrumb, Button } from 'react-bootstrap';
11 11 import { StudentTable } from './view/StudentTable';
12 12 import { Header } from '../Header';
13   -import { AdminSidebar } from '../Sidebar'
14   -import { AdminBreadcrumb } from '../Breadcrumb'
15 13 import { UploadCsv } from './UploadCsv';
16 14 import { AddStudent } from './add/addStudent';
17 15 import { Students } from '/imports/collections/students/index';
... ... @@ -51,35 +49,17 @@ export class StudentView extends Component {
51 49 }
52 50 });
53 51 return (
54   - <div className="appLayout-box">
55   - <div className="page-container">
56   - <div className="page-content">
57   - <AdminSidebar
58   - user = {this.props.data.user}
59   - org = {this.props.data.org}
60   - />
61   - {/*end sidebar*/}
62   - <div className="content-wrapper">
63   - <AdminBreadcrumb />
64   - {/*content*/}
65   -
66   - <div className="content has-detached-left">
67   - <div className="container-detached">
68   - <div className="">
69   - <Header/>
70   - <StudentTable
71   - data = {this.props.data}
72   - studentData = {studentData}
73   - />
74   - <AddStudent/>
75   - <UploadCsv />
76   - </div>
77   - </div>
78   - </div>
79   - </div>
80   - </div>
81   - </div>
82   - </div>
  52 + <div className="container-detached">
  53 + <div className="">
  54 + <Header/>
  55 + <StudentTable
  56 + data = {this.props.data}
  57 + studentData = {studentData}
  58 + />
  59 + <AddStudent/>
  60 + <UploadCsv />
  61 + </div>
  62 + </div>
83 63 );
84 64 };
85 65  
... ...
imports/client/views/org/app/module/AdminAppLayout.js
... ... @@ -0,0 +1,52 @@
  1 +import _ from 'lodash';
  2 +import { Meteor } from 'meteor/meteor';
  3 +import React, { Component } from 'react';
  4 +import { Link } from 'react-router';
  5 +import { Avatar } from '/imports/client/components/Avatar';
  6 +import { Icon } from '/imports/client/components/Icon';
  7 +import classNames from 'classnames';
  8 +import { EnterModule } from '/imports/client/views/org/enter/module/index';
  9 +// import { VerifyModule } from '/imports/client/views/verify/module/index';
  10 +import { Navbar,Modal, Nav, NavItem,
  11 + Glyphicon, Collapse,
  12 + NavbarToggler, NavbarBrand,
  13 + NavLink, DropdownItem, DropdownToggle, DropdownMenu,
  14 + NavDropdown, MenuItem, Breadcrumb } from 'react-bootstrap';
  15 +import { VerifyModule } from '/imports/client/views/verify/module/index'
  16 +import { AdminModule } from '/imports/client/views/org/admin/app/Index'
  17 +
  18 +var Accordion = require('react-bootstrap').Accordion;
  19 +var Panel = require('react-bootstrap').Panel;
  20 +export class AdminAppLayout extends Component {
  21 +
  22 + render() {
  23 + const {user, org} = this.props.data;
  24 + if(!user) {
  25 + return (
  26 + <EnterModule
  27 + pane = {this.props.location.query.enter}
  28 + location = {this.props.location}
  29 + />
  30 + );
  31 + }else if(!user.isEmailVerified()) {
  32 + return (
  33 + <VerifyModule
  34 + pane = {this.props.location.query.verify}
  35 + location = {this.props.location}
  36 + />
  37 + );
  38 + }else if(user.role==='ADMIN'){
  39 + return(
  40 + <AdminModule
  41 + user = {user}
  42 + org = {org}
  43 + />
  44 + );
  45 + }else{
  46 + return (
  47 + null
  48 + );
  49 + }
  50 + };
  51 +
  52 +};
... ...
imports/client/views/org/app/module/AppLayout.js
... ... @@ -1,52 +0,0 @@
1   -import _ from 'lodash';
2   -import { Meteor } from 'meteor/meteor';
3   -import React, { Component } from 'react';
4   -import { Link } from 'react-router';
5   -import { Avatar } from '/imports/client/components/Avatar';
6   -import { Icon } from '/imports/client/components/Icon';
7   -import classNames from 'classnames';
8   -import { EnterModule } from '/imports/client/views/org/enter/module/index';
9   -// import { VerifyModule } from '/imports/client/views/verify/module/index';
10   -import { Navbar,Modal, Nav, NavItem,
11   - Glyphicon, Collapse,
12   - NavbarToggler, NavbarBrand,
13   - NavLink, DropdownItem, DropdownToggle, DropdownMenu,
14   - NavDropdown, MenuItem, Breadcrumb } from 'react-bootstrap';
15   -import { VerifyModule } from '/imports/client/views/verify/module/index'
16   -import { AdminAppLayout } from '/imports/client/views/org/admin/AdminLayout'
17   -
18   -var Accordion = require('react-bootstrap').Accordion;
19   -var Panel = require('react-bootstrap').Panel;
20   -export class AppLayout extends Component {
21   -
22   - render() {
23   - const {user, org} = this.props.data;
24   - if(!user) {
25   - return (
26   - <EnterModule
27   - pane = {this.props.location.query.enter}
28   - location = {this.props.location}
29   - />
30   - );
31   - }else if(!user.isEmailVerified()) {
32   - return (
33   - <VerifyModule
34   - pane = {this.props.location.query.verify}
35   - location = {this.props.location}
36   - />
37   - );
38   - }else if(user.role==='ADMIN'){
39   - return(
40   - <AdminAppLayout
41   - user = {user}
42   - org = {org}
43   - />
44   - );
45   - }else{
46   - return (
47   - null
48   - );
49   - }
50   - };
51   -
52   -};
imports/client/views/org/app/module/Index.js
... ... @@ -4,7 +4,7 @@ import {
4 4 compose,
5 5 composeAll
6 6 } from 'react-komposer';
7   -import { AppLayout } from './AppLayout';
  7 +import { AdminAppLayout } from './AdminAppLayout';
8 8 import { Loading } from '/imports/client/components/Loading';
9 9  
10 10 import { Users } from '/imports/collections/users/index';
... ... @@ -45,7 +45,7 @@ const reduxTick = (props, onData) =&gt; {
45 45 };
46 46  
47 47  
48   -export const AppModule = composeAll(
  48 +export const AdminAppModule = composeAll(
49 49 composeWithTracker(meteorTick, Loading),
50 50 compose(reduxTick, Loading),
51   -)(AppLayout);
  51 +)(AdminAppLayout);
... ...
imports/client/views/org/app/module/navigation/AppNavigation.js
... ... @@ -1,54 +0,0 @@
1   -import React, { Component } from 'react';
2   -import { Navbar } from 'react-bootstrap';
3   -import { Link } from 'react-router';
4   -import {PublicNavigation} from './PublicNavigation.js';
5   -import {AuthenticatedNavigation} from './AuthenticatedNavigation.js';
6   -// import '/imports/client/assets/css/icons/icomoon/styles.css';
7   -// import '/imports/client/assets/css/bootstrap.css';
8   -// import '/imports/client/assets/css/core.css';
9   -// import '/imports/client/assets/css/components.css';
10   -// import '/imports/client/assets/css/colors.css';
11   -// import '/imports/client/assets/css/colors.css';
12   -export class AppNavigation extends Component {
13   -
14   - constructor(props) {
15   - super(props);
16   - this.state = {
17   -
18   - };
19   - };
20   -
21   - onUpdate(key, value) {
22   - this.setState({[key]: value});
23   - };
24   - render() {
25   - const {user} = this.props.data;
26   - if(user){
27   - return(
28   - <AuthenticatedNavigation
29   - data = {this.props.data}
30   - />
31   - )
32   - }else{
33   - return(
34   - <Navbar>
35   - <Navbar.Header>
36   - <Navbar.Brand>
37   - <Link to="/">Application Name</Link>
38   - </Navbar.Brand>
39   - <Navbar.Toggle />
40   - </Navbar.Header>
41   - <Navbar.Collapse>
42   - <PublicNavigation />
43   - </Navbar.Collapse>
44   - </Navbar>
45   -
46   - )
47   - }
48   -
49   - return (
50   - <div></div>
51   - );
52   - };
53   -
54   -};
imports/client/views/org/app/module/navigation/AuthenticatedNavigation.js
... ... @@ -1,312 +0,0 @@
1   -import React, { Component } from 'react';
2   -import { browserHistory } from 'react-router';
3   -import { LinkContainer } from 'react-router-bootstrap';
4   -import { logout } from '/imports/client/app/utils/loginMethods';
5   -import { Navbar,Modal, Nav, NavItem,
6   - Glyphicon, Collapse,
7   - NavbarToggler, NavbarBrand,
8   - NavLink, DropdownItem, DropdownToggle, DropdownMenu,
9   - NavDropdown, MenuItem } from 'react-bootstrap';
10   -import { Meteor } from 'meteor/meteor';
11   -import $ from 'jquery';
12   -
13   -
14   -const handleLogout = () => Meteor.logout(() => browserHistory.push('/login'));
15   -
16   -export class AuthenticatedNavigation extends Component {
17   - constructor(props) {
18   - super(props);
19   - this.toggle = this.toggle.bind(this);
20   - this.changeBodyClass = this.changeBodyClass.bind(this);
21   - this.state = {
22   - dropdownOpen: false,
23   - burgerMenu: false
24   - };
25   - }
26   - toggle() {
27   - this.setState({
28   - dropdownOpen: !this.state.dropdownOpen
29   - });
30   - }
31   - changeBodyClass(){
32   - if(this.state.burgerMenu){
33   - $('body').addClass('sidebar-xs');
34   - this.setState({burgerMenu: false});
35   - }else{
36   - $('body').removeClass('sidebar-xs');
37   - this.setState({burgerMenu: true});
38   - }
39   - }
40   - render(){
41   - const {user, org} = this.props.data;
42   - return(
43   - <Navbar inverse collapseOnSelect className="bg-crimson">
44   - <Navbar.Header>
45   - <Navbar.Brand>
46   - <a href="#">
47   - <Glyphicon glyph="link" />
48   - &nbsp; YoungDesk
49   - </a>
50   - </Navbar.Brand>
51   - <ul className="nav navbar-nav visible-xs-block">
52   - <li><a href="#"><i className="icon-tree5"/></a></li>
53   - <li><a className="sidebar-mobile-main-toggle"><i className="icon-paragraph-justify3"/></a></li>
54   - </ul>
55   - <Navbar.Toggle />
56   - </Navbar.Header>
57   - <Navbar.Collapse id="navbar-mobile">
58   - <ul className="nav navbar-nav">
59   - <NavItem eventKey={1} href="#" className="sidebar-control sidebar-main-toggle hidden-xs">
60   - <i
61   - className="icon-paragraph-justify3 burgerMenu"
62   - onClick = {this.changeBodyClass}
63   - />
64   - </NavItem>
65   -
66   - <NavDropdown title="Dropdown" id="update">
67   - <div className="dropdown-content">
68   - <div className="dropdown-content-heading">
69   - Git updates
70   - <ul className="icons-list">
71   - <li><a href="#"><i className="icon-sync"></i></a></li>
72   - </ul>
73   -
74   - </div>
75   - <ul className="media-list dropdown-content-body width-350">
76   - <li className="media">
77   - <div className="media-left">
78   - <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a>
79   - </div>
80   -
81   - <div className="media-body">
82   - Drop the IE <a href="#">specific hacks</a> for temporal inputs
83   - <div className="media-annotation">4 minutes ago</div>
84   - </div>
85   - </li>
86   -
87   - <li className="media">
88   - <div className="media-left">
89   - <a href="#" className="btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-commit"></i></a>
90   - </div>
91   -
92   - <div className="media-body">
93   - Add full font overrides for popovers and tooltips
94   - <div className="media-annotation">36 minutes ago</div>
95   - </div>
96   - </li>
97   -
98   - <li className="media">
99   - <div className="media-left">
100   - <a href="#" className="btn border-info text-info btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-branch"></i></a>
101   - </div>
102   -
103   - <div className="media-body">
104   - <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch
105   - <div className="media-annotation">2 hours ago</div>
106   - </div>
107   - </li>
108   -
109   - <li className="media">
110   - <div className="media-left">
111   - <a href="#" className="btn border-success text-success btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-merge"></i></a>
112   - </div>
113   -
114   - <div className="media-body">
115   - <a href="#">Eugene Kopyov</a> merged <span className="text-semibold">Master</span> and <span className="text-semibold">Dev</span> branches
116   - <div className="media-annotation">Dec 18, 18:36</div>
117   - </div>
118   - </li>
119   -
120   - <li className="media">
121   - <div className="media-left">
122   - <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a>
123   - </div>
124   -
125   - <div className="media-body">
126   - Have Carousel ignore keyboard events
127   - <div className="media-annotation">Dec 12, 05:46</div>
128   - </div>
129   - </li>
130   - </ul>
131   - <div className="dropdown-content-footer">
132   - <a href="#" data-popup="tooltip" title="All activity"><i className="icon-menu display-block"></i></a>
133   - </div>
134   - </div>
135   - </NavDropdown>
136   - </ul>
137   - <div className="navbar-right">
138   - <p className="navbar-text">Hello {user.getFullName()}</p>
139   - <p className="navbar-text"
140   - onClick = {() => logout()}
141   - >
142   - <span className="label logout">logout</span>
143   - </p>
144   - <Nav>
145   - <NavDropdown title="Activity" id="activity">
146   - <div className="dropdown-content">
147   - <div className="dropdown-content-heading">
148   - Activity
149   - <ul className="icons-list">
150   - <li><a href="#"><i className="icon-menu7"></i></a></li>
151   - </ul>
152   - </div>
153   - <ul className="media-list dropdown-content-body width-350">
154   - <li className="media">
155   - <div className="media-left">
156   - <a href="#" className="btn bg-success-400 btn-rounded btn-icon btn-xs"><i className="icon-mention"></i></a>
157   - </div>
158   -
159   - <div className="media-body">
160   - <a href="#">Taylor Swift</a> mentioned you in a post "Angular JS. Tips and tricks"
161   - <div className="media-annotation">4 minutes ago</div>
162   - </div>
163   - </li>
164   - <li className="media">
165   - <div className="media-left">
166   - <a href="#" className="btn bg-pink-400 btn-rounded btn-icon btn-xs"><i className="icon-paperplane"></i></a>
167   - </div>
168   -
169   - <div className="media-body">
170   - Special offers have been sent to subscribed users by <a href="#">Donna Gordon</a>
171   - <div className="media-annotation">36 minutes ago</div>
172   - </div>
173   - </li>
174   - <li className="media">
175   - <div className="media-left">
176   - <a href="#" className="btn bg-blue btn-rounded btn-icon btn-xs"><i className="icon-plus3"></i></a>
177   - </div>
178   -
179   - <div className="media-body">
180   - <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch in <span className="text-semibold">Limitless</span> repository
181   - <div className="media-annotation">2 hours ago</div>
182   - </div>
183   - </li>
184   -
185   - <li className="media">
186   - <div className="media-left">
187   - <a href="#" className="btn bg-purple-300 btn-rounded btn-icon btn-xs"><i className="icon-truck"></i></a>
188   - </div>
189   -
190   - <div className="media-body">
191   - Shipping cost to the Netherlands has been reduced, database updated
192   - <div className="media-annotation">Feb 8, 11:30</div>
193   - </div>
194   - </li>
195   -
196   - <li className="media">
197   - <div className="media-left">
198   - <a href="#" className="btn bg-warning-400 btn-rounded btn-icon btn-xs"><i className="icon-bubble8"></i></a>
199   - </div>
200   -
201   - <div className="media-body">
202   - New review received on <a href="#">Server side integration</a> services
203   - <div className="media-annotation">Feb 2, 10:20</div>
204   - </div>
205   - </li>
206   -
207   - <li className="media">
208   - <div className="media-left">
209   - <a href="#" className="btn bg-teal-400 btn-rounded btn-icon btn-xs"><i className="icon-spinner11"></i></a>
210   - </div>
211   -
212   - <div className="media-body">
213   - <strong>January, 2016</strong> - 1320 new users, 3284 orders, $49,390 revenue
214   - <div className="media-annotation">Feb 1, 05:46</div>
215   - </div>
216   - </li>
217   - </ul>
218   - </div>
219   - </NavDropdown>
220   - <NavDropdown title="Messages" id="messages">
221   - <div className="dropdown-content width-350">
222   - <div className="dropdown-content-heading">
223   - Messages
224   - <ul className="icons-list">
225   - <li><a href="#"><i className="icon-compose"></i></a></li>
226   - </ul>
227   - </div>
228   -
229   - <ul className="media-list dropdown-content-body">
230   - <li className="media">
231   - <div className="media-left">
232   -
233   - <span className="badge bg-danger-400 media-badge">5</span>
234   - </div>
235   -
236   - <div className="media-body">
237   - <a href="#" className="media-heading">
238   - <span className="text-semibold">James Alexander</span>
239   - <span className="media-annotation pull-right">04:58</span>
240   - </a>
241   -
242   - <span className="text-muted">who knows, maybe that would be the best thing for me...</span>
243   - </div>
244   - </li>
245   -
246   - <li className="media">
247   - <div className="media-left">
248   -
249   - <span className="badge bg-danger-400 media-badge">4</span>
250   - </div>
251   -
252   - <div className="media-body">
253   - <a href="#" className="media-heading">
254   - <span className="text-semibold">Margo Baker</span>
255   - <span className="media-annotation pull-right">12:16</span>
256   - </a>
257   -
258   - <span className="text-muted">That was something he was unable to do because...</span>
259   - </div>
260   - </li>
261   -
262   - <li className="media">
263   - <div className="media-left"></div>
264   - <div className="media-body">
265   - <a href="#" className="media-heading">
266   - <span className="text-semibold">Jeremy Victorino</span>
267   - <span className="media-annotation pull-right">22:48</span>
268   - </a>
269   -
270   - <span className="text-muted">But that would be extremely strained and suspicious...</span>
271   - </div>
272   - </li>
273   -
274   - <li className="media">
275   - <div className="media-left"></div>
276   - <div className="media-body">
277   - <a href="#" className="media-heading">
278   - <span className="text-semibold">Beatrix Diaz</span>
279   - <span className="media-annotation pull-right">Tue</span>
280   - </a>
281   -
282   - <span className="text-muted">What a strenuous career it is that I have chosen...</span>
283   - </div>
284   - </li>
285   -
286   - <li className="media">
287   - <div className="media-left">
288   -
289   - </div>
290   - <div className="media-body">
291   - <a href="#" className="media-heading">
292   - <span className="text-semibold">Richard Vango</span>
293   - <span className="media-annotation pull-right">Mon</span>
294   - </a>
295   -
296   - <span className="text-muted">Other travelling salesmen live a life of luxury...</span>
297   - </div>
298   - </li>
299   - </ul>
300   -
301   - <div className="dropdown-content-footer">
302   - <a href="#" data-popup="tooltip" title="All messages"><i className="icon-menu display-block"></i></a>
303   - </div>
304   - </div>
305   - </NavDropdown>
306   - </Nav>
307   - </div>
308   - </Navbar.Collapse>
309   - </Navbar>
310   - );
311   - }
312   -}
imports/client/views/org/app/module/navigation/AuthenticatedNavigation0.js
... ... @@ -1,303 +0,0 @@
1   -import React, { Component } from 'react';
2   -import { browserHistory } from 'react-router';
3   -import { LinkContainer } from 'react-router-bootstrap';
4   -import { Nav, NavItem,
5   - NavDropdown, MenuItem } from 'react-bootstrap';
6   -import { Meteor } from 'meteor/meteor';
7   -
8   -const handleLogout = () => Meteor.logout(() => browserHistory.push('/login'));
9   -
10   -export class AuthenticatedNavigation extends Component {
11   - constructor(props) {
12   - super(props);
13   - this.state = {
14   -
15   - };
16   - };
17   -render(){
18   - const {user} = this.props.data;
19   - return(
20   - <div>
21   - <div className="navbar navbar-inverse bg-crimson">
22   - <div className="navbar-header">
23   - <a className="navbar-brand" href="index.html"><span className="glyphicon glyphicon-link"></span>
24   - <span> YOUNGDESK </span>
25   - </a>
26   -
27   - <ul className="nav navbar-nav visible-xs-block">
28   - <li><a data-toggle="collapse" data-target="#navbar-mobile"><i className="icon-tree5"></i></a></li>
29   - <li><a className="sidebar-mobile-main-toggle"><i className="icon-paragraph-justify3"></i></a></li>
30   - </ul>
31   - </div>
32   -
33   - <div className="navbar-collapse collapse" id="navbar-mobile">
34   - <ul className="nav navbar-nav">
35   - <li><a className="sidebar-control sidebar-main-toggle hidden-xs"><i className="icon-paragraph-justify3"></i></a></li>
36   -
37   - <li className="dropdown">
38   - <a href="#" className="dropdown-toggle" data-toggle="dropdown">
39   - <i className="icon-puzzle3"></i>
40   - <span className="visible-xs-inline-block position-right">Git updates</span>
41   - <span className="status-mark border-orange-400"></span>
42   - </a>
43   -
44   - <div className="dropdown-menu dropdown-content">
45   - <div className="dropdown-content-heading">
46   - Git updates
47   - <ul className="icons-list">
48   - <li><a href="#"><i className="icon-sync"></i></a></li>
49   - </ul>
50   - </div>
51   -
52   - <ul className="media-list dropdown-content-body width-350">
53   - <li className="media">
54   - <div className="media-left">
55   - <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a>
56   - </div>
57   -
58   - <div className="media-body">
59   - Drop the IE <a href="#">specific hacks</a> for temporal inputs
60   - <div className="media-annotation">4 minutes ago</div>
61   - </div>
62   - </li>
63   -
64   - <li className="media">
65   - <div className="media-left">
66   - <a href="#" className="btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-commit"></i></a>
67   - </div>
68   -
69   - <div className="media-body">
70   - Add full font overrides for popovers and tooltips
71   - <div className="media-annotation">36 minutes ago</div>
72   - </div>
73   - </li>
74   -
75   - <li className="media">
76   - <div className="media-left">
77   - <a href="#" className="btn border-info text-info btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-branch"></i></a>
78   - </div>
79   -
80   - <div className="media-body">
81   - <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch
82   - <div className="media-annotation">2 hours ago</div>
83   - </div>
84   - </li>
85   -
86   - <li className="media">
87   - <div className="media-left">
88   - <a href="#" className="btn border-success text-success btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-merge"></i></a>
89   - </div>
90   -
91   - <div className="media-body">
92   - <a href="#">Eugene Kopyov</a> merged <span className="text-semibold">Master</span> and <span className="text-semibold">Dev</span> branches
93   - <div className="media-annotation">Dec 18, 18:36</div>
94   - </div>
95   - </li>
96   -
97   - <li className="media">
98   - <div className="media-left">
99   - <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a>
100   - </div>
101   -
102   - <div className="media-body">
103   - Have Carousel ignore keyboard events
104   - <div className="media-annotation">Dec 12, 05:46</div>
105   - </div>
106   - </li>
107   - </ul>
108   -
109   - <div className="dropdown-content-footer">
110   - <a href="#" data-popup="tooltip" title="All activity"><i className="icon-menu display-block"></i></a>
111   - </div>
112   - </div>
113   - </li>
114   - </ul>
115   -
116   - <div className="navbar-right">
117   - <p className="navbar-text">Hello {`${user.firstName} ${user.lastName}`}!</p>
118   - <p className="navbar-text"><span className="label bg-success-400">Online</span></p>
119   -
120   - <ul className="nav navbar-nav">
121   - <li className="dropdown">
122   - <a href="#" className="dropdown-toggle" data-toggle="dropdown">
123   - <i className="icon-bell2"></i>
124   - <span className="visible-xs-inline-block position-right">Activity</span>
125   - <span className="status-mark border-orange-400"></span>
126   - </a>
127   -
128   - <div className="dropdown-menu dropdown-content">
129   - <div className="dropdown-content-heading">
130   - Activity
131   - <ul className="icons-list">
132   - <li><a href="#"><i className="icon-menu7"></i></a></li>
133   - </ul>
134   - </div>
135   -
136   - <ul className="media-list dropdown-content-body width-350">
137   - <li className="media">
138   - <div className="media-left">
139   - <a href="#" className="btn bg-success-400 btn-rounded btn-icon btn-xs"><i className="icon-mention"></i></a>
140   - </div>
141   -
142   - <div className="media-body">
143   - <a href="#">Taylor Swift</a> mentioned you in a post "Angular JS. Tips and tricks"
144   - <div className="media-annotation">4 minutes ago</div>
145   - </div>
146   - </li>
147   -
148   - <li className="media">
149   - <div className="media-left">
150   - <a href="#" className="btn bg-pink-400 btn-rounded btn-icon btn-xs"><i className="icon-paperplane"></i></a>
151   - </div>
152   -
153   - <div className="media-body">
154   - Special offers have been sent to subscribed users by <a href="#">Donna Gordon</a>
155   - <div className="media-annotation">36 minutes ago</div>
156   - </div>
157   - </li>
158   -
159   - <li className="media">
160   - <div className="media-left">
161   - <a href="#" className="btn bg-blue btn-rounded btn-icon btn-xs"><i className="icon-plus3"></i></a>
162   - </div>
163   -
164   - <div className="media-body">
165   - <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch in <span className="text-semibold">Limitless</span> repository
166   - <div className="media-annotation">2 hours ago</div>
167   - </div>
168   - </li>
169   -
170   - <li className="media">
171   - <div className="media-left">
172   - <a href="#" className="btn bg-purple-300 btn-rounded btn-icon btn-xs"><i className="icon-truck"></i></a>
173   - </div>
174   -
175   - <div className="media-body">
176   - Shipping cost to the Netherlands has been reduced, database updated
177   - <div className="media-annotation">Feb 8, 11:30</div>
178   - </div>
179   - </li>
180   -
181   - <li className="media">
182   - <div className="media-left">
183   - <a href="#" className="btn bg-warning-400 btn-rounded btn-icon btn-xs"><i className="icon-bubble8"></i></a>
184   - </div>
185   -
186   - <div className="media-body">
187   - New review received on <a href="#">Server side integration</a> services
188   - <div className="media-annotation">Feb 2, 10:20</div>
189   - </div>
190   - </li>
191   -
192   - <li className="media">
193   - <div className="media-left">
194   - <a href="#" className="btn bg-teal-400 btn-rounded btn-icon btn-xs"><i className="icon-spinner11"></i></a>
195   - </div>
196   -
197   - <div className="media-body">
198   - <strong>January, 2016</strong> - 1320 new users, 3284 orders, $49,390 revenue
199   - <div className="media-annotation">Feb 1, 05:46</div>
200   - </div>
201   - </li>
202   - </ul>
203   - </div>
204   - </li>
205   -
206   - <li className="dropdown">
207   - <a href="#" className="dropdown-toggle" data-toggle="dropdown">
208   - <i className="icon-bubble8"></i>
209   - <span className="visible-xs-inline-block position-right">Messages</span>
210   - <span className="status-mark border-orange-400"></span>
211   - </a>
212   -
213   - <div className="dropdown-menu dropdown-content width-350">
214   - <div className="dropdown-content-heading">
215   - Messages
216   - <ul className="icons-list">
217   - <li><a href="#"><i className="icon-compose"></i></a></li>
218   - </ul>
219   - </div>
220   -
221   - <ul className="media-list dropdown-content-body">
222   - <li className="media">
223   - <div className="media-left">
224   - <img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" />
225   - <span className="badge bg-danger-400 media-badge">5</span>
226   - </div>
227   -
228   - <div className="media-body">
229   - <a href="#" className="media-heading">
230   - <span className="text-semibold">James Alexander</span>
231   - <span className="media-annotation pull-right">04:58</span>
232   - </a>
233   -
234   - <span className="text-muted">who knows, maybe that would be the best thing for me...</span>
235   - </div>
236   - </li>
237   -
238   - <li className="media">
239   - <div className="media-left">
240   - <img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" />
241   - <span className="badge bg-danger-400 media-badge">4</span>
242   - </div>
243   -
244   - <div className="media-body">
245   - <a href="#" className="media-heading">
246   - <span className="text-semibold">Margo Baker</span>
247   - <span className="media-annotation pull-right">12:16</span>
248   - </a>
249   -
250   - <span className="text-muted">That was something he was unable to do because...</span>
251   - </div>
252   - </li>
253   -
254   - <li className="media">
255   - <div className="media-left"><img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" /></div>
256   - <div className="media-body">
257   - <a href="#" className="media-heading">
258   - <span className="text-semibold">Jeremy Victorino</span>
259   - <span className="media-annotation pull-right">22:48</span>
260   - </a>
261   -
262   - <span className="text-muted">But that would be extremely strained and suspicious...</span>
263   - </div>
264   - </li>
265   -
266   - <li className="media">
267   - <div className="media-left"><img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" /></div>
268   - <div className="media-body">
269   - <a href="#" className="media-heading">
270   - <span className="text-semibold">Beatrix Diaz</span>
271   - <span className="media-annotation pull-right">Tue</span>
272   - </a>
273   -
274   - <span className="text-muted">What a strenuous career it is that I have chosen...</span>
275   - </div>
276   - </li>
277   -
278   - <li className="media">
279   - <div className="media-left"><img src="assets/images/placeholder.jpg" className="img-circle img-sm" alt="" /></div>
280   - <div className="media-body">
281   - <a href="#" className="media-heading">
282   - <span className="text-semibold">Richard Vango</span>
283   - <span className="media-annotation pull-right">Mon</span>
284   - </a>
285   -
286   - <span className="text-muted">Other travelling salesmen live a life of luxury...</span>
287   - </div>
288   - </li>
289   - </ul>
290   -
291   - <div className="dropdown-content-footer">
292   - <a href="#" data-popup="tooltip" title="All messages"><i className="icon-menu display-block"></i></a>
293   - </div>
294   - </div>
295   - </li>
296   - </ul>
297   - </div>
298   - </div>
299   - </div>
300   - </div>
301   -);
302   -}
303   -}
imports/client/views/org/app/module/navigation/Loading.js
... ... @@ -1,30 +0,0 @@
1   -import React from 'react';
2   -
3   -const Loading = () => (
4   - <svg
5   - version="1.1"
6   - className="Loading"
7   - xmlns="http://www.w3.org/2000/svg"
8   - x="0px"
9   - y="0px"
10   - width="40px"
11   - height="40px"
12   - viewBox="0 0 40 40"
13   - enableBackground="new 0 0 40 40">
14   - <path
15   - opacity="1.0"
16   - fill="#eee"
17   - d="M20.201,5.169c-8.254,0-14.946,6.692-14.946,14.946c0,8.255,6.692,14.946,
18   - 14.946,14.946s14.946-6.691,14.946-14.946C35.146,11.861,28.455,5.169,20.201,
19   - 5.169z M20.201,31.749c-6.425,0-11.634-5.208-11.634-11.634c0-6.425,
20   - 5.209-11.634,11.634-11.634c6.425,0,11.633,5.209,11.633,11.634C31.834,
21   - 26.541,26.626,31.749,20.201,31.749z"/>
22   - <path
23   - fill="#da5347"
24   - d="M26.013,10.047l1.654-2.866c-2.198-1.272-4.743-2.012-7.466-2.012h0v3.312h0
25   - C22.32,8.481,24.301,9.057,26.013,10.047z">
26   - </path>
27   - </svg>
28   -);
29   -
30   -export default Loading;
imports/client/views/org/app/module/navigation/PublicNavigation.js
... ... @@ -1,27 +0,0 @@
1   -import React, { Component } from 'react';
2   -import { LinkContainer } from 'react-router-bootstrap';
3   -import { setQueryParam } from '/imports/client/app/utils/setQueryParam';
4   -import { browserHistory } from 'react-router';
5   -import { Nav, NavItem } from 'react-bootstrap';
6   -
7   -
8   -export class PublicNavigation extends Component {
9   - constructor(props) {
10   - super(props);
11   - this.state = {
12   -
13   - };
14   - };
15   -render(){
16   - console.log(this.props);
17   - var mainSite = document.location.hostname.split( "." )[1];
18   - var signup = `http://${mainSite}/signup`;
19   - return(
20   - <Nav pullRight>
21   - <LinkContainer to="login">
22   - <NavItem eventKey={ 2 } href="/login">Log In</NavItem>
23   - </LinkContainer>
24   - </Nav>
25   - )
26   -}
27   -}
imports/client/views/org/app/module/navigation/index.js
... ... @@ -1,49 +0,0 @@
1   -// import { InviteSignupController } from '/imports/client/views/invite/signup/index'
2   -import _ from 'lodash';
3   -import {
4   - composeWithTracker,
5   - compose,
6   - composeAll
7   - } from 'react-komposer';
8   -import { Loading } from '/imports/client/components/Loading';
9   -
10   -import { Orgs } from '/imports/collections/orgs/index';
11   -import { Users } from '/imports/collections/users/index';
12   -
13   -import { AppNavigation } from './AppNavigation';
14   -
15   -const meteorTick = (props, onData) => {
16   -
17   - const handles = [
18   - Meteor.subscribe('users.current'),
19   - Meteor.subscribe('orgs.current')
20   - ];
21   -
22   - if(_.every(handles, (handle) => (handle.ready()) )) {
23   - const user = Users.current();
24   - const org = Orgs.current();
25   - onData(null, {
26   - data: {
27   - user: user,
28   - org: org
29   - },
30   - });
31   - }
32   -
33   - return () => {
34   - _.each(handles, (handle) => handle.stop() );
35   - };
36   -};
37   -
38   -
39   -const reduxTick = (props, onData) => {
40   - onData(null, {
41   - data: {}
42   - });
43   -};
44   -
45   -
46   -export const AppNavigationController = composeAll(
47   - composeWithTracker(meteorTick, Loading),
48   - compose(reduxTick, Loading),
49   -)(AppNavigation);
imports/collections/users/index.js
... ... @@ -27,6 +27,7 @@ class User {
27 27 };
28 28  
29 29 getRole() {
  30 + return (this._id);
30 31 const org = Orgs.findOne({_id: this.orgId});
31 32 if(!org) return null;
32 33 const connection = _.find(org.users, {userId: this._id});
... ...