Commit 52c4c75dfbf5337f0524c892eec8ca6d63abe352
1 parent
dbafa68d2a
Exists in
master
fixed admin components
Showing
6 changed files
with
102 additions
and
138 deletions
Show diff stats
imports/client/views/org/admin/AdminLayout.js
File was created | 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="/teachers" > | ||
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 | |||
61 | </div> | ||
62 | </div> | ||
63 | </div> | ||
64 | </div> | ||
65 | </div> | ||
66 | |||
67 | <div className = "appLayout-wrapOuter"> | ||
68 | <div className = "appLayout-wrapInner"> | ||
69 | <div className = "appLayout-menuWrap"> | ||
70 | |||
71 | </div> | ||
72 | <div className = "appLayout-contentWrap"> | ||
73 | <div className = "appLayout-content"> | ||
74 | |||
75 | </div> | ||
76 | </div> | ||
77 | </div> | ||
78 | </div> | ||
79 | </div> | ||
80 | ); | ||
81 | }; | ||
82 | |||
83 | }; | ||
84 |
imports/client/views/org/admin/teachers/TeacherView.js
1 | import _ from 'lodash'; | 1 | import _ from 'lodash'; |
2 | import { Meteor } from 'meteor/meteor'; | 2 | import { Meteor } from 'meteor/meteor'; |
3 | 3 | ||
4 | import React, { Component } from 'react'; | 4 | import React, { Component } from 'react'; |
5 | import { Link,browserHistory } from 'react-router'; | 5 | import { Link,browserHistory } from 'react-router'; |
6 | import { FormGroup, | 6 | import { FormGroup, |
7 | FormControl,Glyphicon,Button } from 'react-bootstrap'; | 7 | FormControl,Glyphicon,Button } from 'react-bootstrap'; |
8 | import { Header } from '../Header'; | 8 | import { Header } from '../Header'; |
9 | import { AdminSidebar } from '../Sidebar' | 9 | import { AdminSidebar } from '../Sidebar' |
10 | import { AdminBreadcrumb } from '../Breadcrumb' | 10 | import { AdminBreadcrumb } from '../Breadcrumb' |
11 | import { TeachersTable } from './view/TeachersTable' | 11 | import { TeachersTable } from './view/TeachersTable' |
12 | import { AddTeacher } from './add/addTeacher' | 12 | import { AddTeacher } from './add/addTeacher' |
13 | import { UploadCsvTeacher } from './UploadCsvTeacher' | 13 | import { UploadCsvTeacher } from './UploadCsvTeacher' |
14 | 14 | ||
15 | export class TeachersView extends Component { | 15 | export class TeachersView extends Component { |
16 | constructor(props) { | 16 | constructor(props) { |
17 | super(props); | 17 | super(props); |
18 | this.state = { | 18 | this.state = { |
19 | 19 | ||
20 | }; | 20 | }; |
21 | this.onUpdate = this.onUpdate.bind(this); | 21 | this.onUpdate = this.onUpdate.bind(this); |
22 | }; | 22 | }; |
23 | 23 | ||
24 | onUpdate(key, value) { | 24 | onUpdate(key, value) { |
25 | this.setState({[key]: value}); | 25 | this.setState({[key]: value}); |
26 | }; | 26 | }; |
27 | 27 | ||
28 | render() { | 28 | render() { |
29 | const {user, org, teachers, teachersData} = this.props.data; | 29 | const {user, org, teachers, teachersData} = this.props.data; |
30 | return ( | 30 | return ( |
31 | <div className="appLayout-box"> | 31 | <div className="appLayout-box"> |
32 | <div className="page-container"> | 32 | <div className="page-container"> |
33 | <div className="page-content"> | 33 | <div className="page-content"> |
34 | <AdminSidebar | 34 | <AdminSidebar |
35 | user = {user} | 35 | user = {user} |
36 | org = {org} | 36 | org = {org} |
37 | /> | 37 | /> |
38 | {/*end sidebar*/} | ||
39 | <div className="content-wrapper"> | 38 | <div className="content-wrapper"> |
40 | <AdminBreadcrumb /> | 39 | <AdminBreadcrumb /> |
41 | {/*content*/} | ||
42 | 40 | ||
43 | <div className="content has-detached-left"> | 41 | <div className="content has-detached-left"> |
44 | <div className="container-detached"> | 42 | <div className="container-detached"> |
45 | <div className="content-detached"> | 43 | <div className="content-detached"> |
46 | <Header | 44 | <Header |
47 | user = {user} | 45 | user = {user} |
48 | org = {org} | 46 | org = {org} |
49 | /> | 47 | /> |
50 | <TeachersTable | 48 | <TeachersTable |
51 | data = {this.props.data} | 49 | data = {this.props.data} |
52 | teachers = {teachers} | 50 | teachers = {teachers} |
53 | /> | 51 | /> |
54 | <AddTeacher/> | 52 | <AddTeacher/> |
55 | <UploadCsvTeacher /> | 53 | <UploadCsvTeacher /> |
56 | </div> | 54 | </div> |
57 | </div> | 55 | </div> |
58 | <div className="sidebar-detached affix-top"> | 56 | <div className="sidebar-detached affix-top"> |
59 | <div className="sidebar sidebar-default"> | 57 | <div className="sidebar sidebar-default"> |
60 | <div className="sidebar-content"> | 58 | <div className="sidebar-content"> |
61 | 59 | ||
62 | <div className="sidebar-category"> | 60 | <div className="sidebar-category"> |
63 | <div className="category-title"> | 61 | <div className="category-title"> |
64 | <span>Advanced Search</span> | 62 | <span>Advanced Search</span> |
65 | <ul className="icons-list"> | 63 | <ul className="icons-list"> |
66 | <li><a href="#" data-action="collapse"></a></li> | 64 | <li><a href="#" data-action="collapse"></a></li> |
67 | </ul> | 65 | </ul> |
68 | </div> | 66 | </div> |
69 | 67 | ||
70 | <div className="category-content"> | 68 | <div className="category-content"> |
71 | <form action="#"> | 69 | <form action="#"> |
72 | <div className="has-feedback has-feedback-left"> | 70 | <div className="has-feedback has-feedback-left"> |
73 | <input type="search" className="form-control" | 71 | <input type="search" className="form-control" |
74 | value={this.state.firstNameSearch} | 72 | value={this.state.firstNameSearch} |
75 | onChange={e=>this.onUpdate('firstNameSearch',e.target.value)} | 73 | onChange={e=>this.onUpdate('firstNameSearch',e.target.value)} |
76 | placeholder="First Name" | 74 | placeholder="First Name" |
77 | /> | 75 | /> |
78 | <div className="form-control-feedback"> | 76 | <div className="form-control-feedback"> |
79 | <i className="icon-search4 text-size-base text-muted"></i> | 77 | <i className="icon-search4 text-size-base text-muted"></i> |
80 | </div> | 78 | </div> |
81 | </div> | 79 | </div> |
82 | </form> | 80 | </form> |
83 | </div> | 81 | </div> |
84 | <div className="category-content"> | 82 | <div className="category-content"> |
85 | <form action="#"> | 83 | <form action="#"> |
86 | <div className="has-feedback has-feedback-left"> | 84 | <div className="has-feedback has-feedback-left"> |
87 | <input type="search" className="form-control" | 85 | <input type="search" className="form-control" |
88 | value={this.state.lastNameSearch} | 86 | value={this.state.lastNameSearch} |
89 | onChange={e=>this.onUpdate('lastNameSearch',e.target.value)} | 87 | onChange={e=>this.onUpdate('lastNameSearch',e.target.value)} |
90 | placeholder="Last Name" /> | 88 | placeholder="Last Name" /> |
91 | <div className="form-control-feedback"> | 89 | <div className="form-control-feedback"> |
92 | <i className="icon-search4 text-size-base text-muted"></i> | 90 | <i className="icon-search4 text-size-base text-muted"></i> |
93 | </div> | 91 | </div> |
94 | </div> | 92 | </div> |
95 | </form> | 93 | </form> |
96 | </div> | 94 | </div> |
97 | </div> | 95 | </div> |
98 | </div> | 96 | </div> |
99 | </div> | 97 | </div> |
100 | </div> | 98 | </div> |
101 | </div> | 99 | </div> |
102 | </div> | 100 | </div> |
103 | </div> | 101 | </div> |
104 | </div> | 102 | </div> |
105 | </div> | 103 | </div> |
106 | ); | 104 | ); |
107 | }; | 105 | }; |
108 | 106 | ||
109 | }; | 107 | }; |
110 | 108 |
imports/client/views/org/app/module/AppLayout.js
1 | import _ from 'lodash'; | 1 | import _ from 'lodash'; |
2 | import { Meteor } from 'meteor/meteor'; | 2 | import { Meteor } from 'meteor/meteor'; |
3 | import React, { Component } from 'react'; | 3 | import React, { Component } from 'react'; |
4 | import { Link } from 'react-router'; | 4 | import { Link } from 'react-router'; |
5 | import { Avatar } from '/imports/client/components/Avatar'; | 5 | import { Avatar } from '/imports/client/components/Avatar'; |
6 | import { Icon } from '/imports/client/components/Icon'; | 6 | import { Icon } from '/imports/client/components/Icon'; |
7 | import classNames from 'classnames'; | 7 | import classNames from 'classnames'; |
8 | import { EnterModule } from '/imports/client/views/org/enter/module/index'; | 8 | import { EnterModule } from '/imports/client/views/org/enter/module/index'; |
9 | // import { VerifyModule } from '/imports/client/views/verify/module/index'; | 9 | // import { VerifyModule } from '/imports/client/views/verify/module/index'; |
10 | import { Navbar,Modal, Nav, NavItem, | 10 | import { Navbar,Modal, Nav, NavItem, |
11 | Glyphicon, Collapse, | 11 | Glyphicon, Collapse, |
12 | NavbarToggler, NavbarBrand, | 12 | NavbarToggler, NavbarBrand, |
13 | NavLink, DropdownItem, DropdownToggle, DropdownMenu, | 13 | NavLink, DropdownItem, DropdownToggle, DropdownMenu, |
14 | NavDropdown, MenuItem, Breadcrumb } from 'react-bootstrap'; | 14 | NavDropdown, MenuItem, Breadcrumb } from 'react-bootstrap'; |
15 | import { VerifyModule } from '/imports/client/views/verify/module/index' | 15 | import { VerifyModule } from '/imports/client/views/verify/module/index' |
16 | import { AdminAppLayout } from '/imports/client/views/org/admin/AdminLayout' | ||
16 | 17 | ||
17 | var Accordion = require('react-bootstrap').Accordion; | 18 | var Accordion = require('react-bootstrap').Accordion; |
18 | var Panel = require('react-bootstrap').Panel; | 19 | var Panel = require('react-bootstrap').Panel; |
19 | export class AppLayout extends Component { | 20 | export class AppLayout extends Component { |
20 | 21 | ||
21 | render() { | 22 | render() { |
22 | console.log(this.props); | 23 | const {user, org} = this.props.data; |
23 | const {user} = this.props.data; | ||
24 | 24 | ||
25 | if(!user) { | 25 | if(!user) { |
26 | return ( | 26 | return ( |
27 | <EnterModule | 27 | <EnterModule |
28 | pane = {this.props.location.query.enter} | 28 | pane = {this.props.location.query.enter} |
29 | location = {this.props.location} | 29 | location = {this.props.location} |
30 | /> | 30 | /> |
31 | ); | 31 | ); |
32 | } | 32 | } |
33 | if(!user.isEmailVerified()) { | 33 | if(!user.isEmailVerified()) { |
34 | return ( | 34 | return ( |
35 | <VerifyModule | 35 | <VerifyModule |
36 | pane = {this.props.location.query.verify} | 36 | pane = {this.props.location.query.verify} |
37 | location = {this.props.location} | 37 | location = {this.props.location} |
38 | /> | 38 | /> |
39 | ); | 39 | ); |
40 | } | 40 | } |
41 | return ( | 41 | if(user.role==='ADMIN'){ |
42 | 42 | return( | |
43 | <div className = "appLayout-box"> | 43 | <AdminAppLayout |
44 | <div className="page-container"> | 44 | user = {user} |
45 | <div className="page-content"> | 45 | org = {org} |
46 | <div className="sidebar sidebar-main sidebar-default"> | 46 | /> |
47 | <div className="sidebar-content"> | 47 | ); |
48 | 48 | } | |
49 | <div className="sidebar-category sidebar-category-visible"> | ||
50 | <div className="category-content no-padding"> | ||
51 | <Nav className="navigation navigation-main navigation-accordion"> | ||
52 | <NavItem className="navigation-header"><span>#schoolname</span> <i className="icon-menu" title="Main pages"></i></NavItem> | ||
53 | <NavItem className="active" eventKey={1} href="#"><i className="icon-home4"></i> <span>Dashboard</span></NavItem> | ||
54 | |||
55 | <NavDropdown eventKey={2} title="Settings" name="Settings" id="setting"> | ||
56 | <MenuItem eventKey={2.1}>Information</MenuItem> | ||
57 | <MenuItem eventKey={2.2}>Infrastructure</MenuItem> | ||
58 | <MenuItem eventKey={2.3}>Users</MenuItem> | ||
59 | <MenuItem eventKey={2.4}>Academic Settings</MenuItem> | ||
60 | <MenuItem eventKey={2.5}>Account Configuration</MenuItem> | ||
61 | </NavDropdown> | ||
62 | <NavDropdown eventKey={3} title="Academic" name="Academic" id="academic"> | ||
63 | <MenuItem eventKey={3.1}>Layout 1</MenuItem> | ||
64 | <MenuItem eventKey={3.2}>Layout 2</MenuItem> | ||
65 | <MenuItem eventKey={3.3}>Layout 3</MenuItem> | ||
66 | <MenuItem eventKey={3.4}>Layout 4</MenuItem> | ||
67 | <MenuItem eventKey={3.5}>Layout 5</MenuItem> | ||
68 | </NavDropdown> | ||
69 | <NavDropdown eventKey={4} title="Communication" name="Communication" id="communication"> | ||
70 | <MenuItem eventKey={4.1}>Primary palett</MenuItem> | ||
71 | <MenuItem eventKey={4.2}>Danger palett</MenuItem> | ||
72 | <MenuItem eventKey={4.3}>Success palett</MenuItem> | ||
73 | <MenuItem eventKey={4.4}>Warning palett</MenuItem> | ||
74 | <MenuItem divider /> | ||
75 | <MenuItem eventKey={4.5}>Info palett</MenuItem> | ||
76 | <MenuItem eventKey={4.6}>Info palett</MenuItem> | ||
77 | <MenuItem eventKey={4.7}>Info palett</MenuItem> | ||
78 | <MenuItem eventKey={4.8}>Info palett</MenuItem> | ||
79 | </NavDropdown> | ||
80 | <NavDropdown eventKey={5} title="Finance" name="Finance" id="finance"> | ||
81 | <MenuItem eventKey={5.1}>Primary palett</MenuItem> | ||
82 | <MenuItem eventKey={5.2}>Danger palett</MenuItem> | ||
83 | <MenuItem eventKey={5.3}>Success palett</MenuItem> | ||
84 | <MenuItem eventKey={5.4}>Warning palett</MenuItem> | ||
85 | <NavDropdown eventKey={5.5} title="Calumns" id="calumns"> | ||
86 | <MenuItem>Success palett</MenuItem> | ||
87 | <MenuItem>Warning palett</MenuItem> | ||
88 | </NavDropdown> | ||
89 | </NavDropdown> | ||
90 | |||
91 | <NavItem eventKey={6} href="#"><i className="icon-file-stats"></i><span> Reports </span></NavItem> | ||
92 | <NavItem eventKey={7} href="#"><i className="icon-design"></i> <span>Examinations</span></NavItem> | ||
93 | |||
94 | </Nav> | ||
95 | </div> | ||
96 | </div> | ||
97 | </div> | ||
98 | </div> | ||
99 | {/*end sidebar*/} | ||
100 | <div className="content-wrapper"> | ||
101 | <div className="page-header page-header-default"> | ||
102 | <div className="breadcrumb-line"> | ||
103 | <Breadcrumb> | ||
104 | <Breadcrumb.Item href="#"> | ||
105 | <i className="icon-home2 position-left"></i> Users | ||
106 | </Breadcrumb.Item> | ||
107 | <Breadcrumb.Item active href="#"> | ||
108 | Setup | ||
109 | </Breadcrumb.Item> | ||
110 | </Breadcrumb> | ||
111 | |||
112 | <ul className="breadcrumb-elements"> | ||
113 | <NavItem href="#"><i className="icon-comment-discussion position-left"></i> Support</NavItem> | ||
114 | <NavDropdown title="Settings" id="setting"> | ||
115 | <MenuItem><i className="icon-user-lock"></i> Account security</MenuItem> | ||
116 | <MenuItem><i className="icon-statistics"></i> Analytics</MenuItem> | ||
117 | <MenuItem><i className="icon-accessibility"></i> Accessibility</MenuItem> | ||
118 | <MenuItem divider/> | ||
119 | <MenuItem><i className="icon-gear"></i> All settings</MenuItem> | ||
120 | </NavDropdown> | ||
121 | |||
122 | </ul> | ||
123 | </div> | ||
124 | </div> | ||
125 | <div className="content"> | ||
126 | <div className="row"> | ||
127 | <div className="col-lg-3 col-md-6"> | ||
128 | <div className="thumbnail"> | ||
129 | <Link to="/students" > | ||
130 | <div className="thumb thumb-rounded"> | ||
131 | <img src="assets/images/download2.png" alt="" /> | ||
132 | </div> | ||
133 | <div className="caption text-center"> | ||
134 | <h6 className="text-semibold no-margin">Students <small className="display-block">Click to view</small></h6> | ||
135 | </div> | ||
136 | </Link> | ||
137 | </div> | ||
138 | </div> | ||
139 | <div className="col-lg-3 col-md-6"> | ||
140 | <div className="thumbnail"> | ||
141 | <Link to="/teachers" > | ||
142 | <div className="thumb thumb-rounded"> | ||
143 | <img src="assets/images/download3.png" alt=""/> | ||
144 | </div> | ||
145 | <div className="caption text-center"> | ||
146 | <h6 className="text-semibold no-margin">Teachers <small className="display-block">Click to view</small></h6> | ||
147 | </div> | ||
148 | </Link> | ||
149 | </div> | ||
150 | </div> | ||
151 | |||
152 | </div> | ||
153 | </div> | ||
154 | </div> | ||
155 | </div> | ||
156 | </div> | ||
157 | |||
158 | <div className = "appLayout-wrapOuter"> | ||
159 | <div className = "appLayout-wrapInner"> | ||
160 | <div className = "appLayout-menuWrap"> | ||
161 | |||
162 | </div> | ||
163 | <div className = "appLayout-contentWrap"> | ||
164 | <div className = "appLayout-content"> | ||
165 | 49 | ||
166 | </div> | 50 | return ( |
167 | </div> | 51 | null |
168 | </div> | ||
169 | </div> | ||
170 | </div> | ||
171 | ); | 52 | ); |
172 | }; | 53 | }; |
173 | 54 | ||
174 | }; | 55 | }; |
imports/client/views/org/app/module/Index.js
1 | // import { AppModule } from '/imports/client/views/app/module/index' | 1 | // import { AppModule } from '/imports/client/views/app/module/index' |
2 | import { | 2 | import { |
3 | composeWithTracker, | 3 | composeWithTracker, |
4 | compose, | 4 | compose, |
5 | composeAll | 5 | composeAll |
6 | } from 'react-komposer'; | 6 | } from 'react-komposer'; |
7 | import { AppLayout } from './AppLayout'; | 7 | import { AppLayout } from './AppLayout'; |
8 | import { Loading } from '/imports/client/components/Loading'; | 8 | import { Loading } from '/imports/client/components/Loading'; |
9 | 9 | ||
10 | import { Users } from '/imports/collections/users/index'; | 10 | import { Users } from '/imports/collections/users/index'; |
11 | import { Orgs } from '/imports/collections/orgs/index'; | 11 | import { Orgs } from '/imports/collections/orgs/index'; |
12 | 12 | ||
13 | 13 | ||
14 | const meteorTick = (props, onData) => { | 14 | const meteorTick = (props, onData) => { |
15 | 15 | ||
16 | const handles = [ | 16 | const handles = [ |
17 | Meteor.subscribe('users.current'), | 17 | Meteor.subscribe('users.current'), |
18 | Meteor.subscribe('orgs.current'), | 18 | Meteor.subscribe('orgs.current'), |
19 | Meteor.subscribe('users.forMyOrg'), | 19 | Meteor.subscribe('users.forMyOrg'), |
20 | Meteor.subscribe('student.forMyOrg'), | 20 | Meteor.subscribe('student.forMyOrg'), |
21 | ]; | 21 | ]; |
22 | 22 | ||
23 | if(_.every(handles, (handle) => (handle.ready()) )) { | 23 | if(_.every(handles, (handle) => (handle.ready()) )) { |
24 | const user = Users.current(); | 24 | const user = Users.current(); |
25 | const org = Orgs.current(); | ||
25 | onData(null, { | 26 | onData(null, { |
26 | data: { | 27 | data: { |
27 | user: user, | 28 | user: user, |
29 | org: org, | ||
28 | }, | 30 | }, |
29 | }); | 31 | }); |
30 | } | 32 | } |
31 | 33 | ||
32 | return () => { | 34 | return () => { |
33 | _.each(handles, (handle) => handle.stop() ); | 35 | _.each(handles, (handle) => handle.stop() ); |
34 | }; | 36 | }; |
35 | }; | 37 | }; |
36 | 38 | ||
37 | 39 | ||
38 | const reduxTick = (props, onData) => { | 40 | const reduxTick = (props, onData) => { |
39 | onData(null, { | 41 | onData(null, { |
40 | location: props.location, | 42 | location: props.location, |
41 | data: {} | 43 | data: {} |
42 | }); | 44 | }); |
43 | }; | 45 | }; |
44 | 46 | ||
45 | 47 | ||
46 | export const AppModule = composeAll( | 48 | export const AppModule = composeAll( |
47 | composeWithTracker(meteorTick, Loading), | 49 | composeWithTracker(meteorTick, Loading), |
48 | compose(reduxTick, Loading), | 50 | compose(reduxTick, Loading), |
49 | )(AppLayout); | 51 | )(AppLayout); |
50 | 52 |
imports/client/views/org/app/module/navigation/AuthenticatedNavigation.js
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import { browserHistory } from 'react-router'; | 2 | import { browserHistory } from 'react-router'; |
3 | import { LinkContainer } from 'react-router-bootstrap'; | 3 | import { LinkContainer } from 'react-router-bootstrap'; |
4 | import { logout } from '/imports/client/app/utils/loginMethods'; | 4 | import { logout } from '/imports/client/app/utils/loginMethods'; |
5 | import { Navbar,Modal, Nav, NavItem, | 5 | import { Navbar,Modal, Nav, NavItem, |
6 | Glyphicon, Collapse, | 6 | Glyphicon, Collapse, |
7 | NavbarToggler, NavbarBrand, | 7 | NavbarToggler, NavbarBrand, |
8 | NavLink, DropdownItem, DropdownToggle, DropdownMenu, | 8 | NavLink, DropdownItem, DropdownToggle, DropdownMenu, |
9 | NavDropdown, MenuItem } from 'react-bootstrap'; | 9 | NavDropdown, MenuItem } from 'react-bootstrap'; |
10 | import { Meteor } from 'meteor/meteor'; | 10 | import { Meteor } from 'meteor/meteor'; |
11 | import $ from 'jquery'; | 11 | import $ from 'jquery'; |
12 | 12 | ||
13 | 13 | ||
14 | const handleLogout = () => Meteor.logout(() => browserHistory.push('/login')); | 14 | const handleLogout = () => Meteor.logout(() => browserHistory.push('/login')); |
15 | 15 | ||
16 | export class AuthenticatedNavigation extends Component { | 16 | export class AuthenticatedNavigation extends Component { |
17 | constructor(props) { | 17 | constructor(props) { |
18 | super(props); | 18 | super(props); |
19 | this.toggle = this.toggle.bind(this); | 19 | this.toggle = this.toggle.bind(this); |
20 | this.changeBodyClass = this.changeBodyClass.bind(this); | 20 | this.changeBodyClass = this.changeBodyClass.bind(this); |
21 | this.state = { | 21 | this.state = { |
22 | dropdownOpen: false, | 22 | dropdownOpen: false, |
23 | burgerMenu: false | 23 | burgerMenu: false |
24 | }; | 24 | }; |
25 | } | 25 | } |
26 | toggle() { | 26 | toggle() { |
27 | this.setState({ | 27 | this.setState({ |
28 | dropdownOpen: !this.state.dropdownOpen | 28 | dropdownOpen: !this.state.dropdownOpen |
29 | }); | 29 | }); |
30 | } | 30 | } |
31 | changeBodyClass(){ | 31 | changeBodyClass(){ |
32 | if(this.state.burgerMenu){ | 32 | if(this.state.burgerMenu){ |
33 | $('body').addClass('sidebar-xs'); | 33 | $('body').addClass('sidebar-xs'); |
34 | this.setState({burgerMenu: false}); | 34 | this.setState({burgerMenu: false}); |
35 | }else{ | 35 | }else{ |
36 | $('body').removeClass('sidebar-xs'); | 36 | $('body').removeClass('sidebar-xs'); |
37 | this.setState({burgerMenu: true}); | 37 | this.setState({burgerMenu: true}); |
38 | } | 38 | } |
39 | } | 39 | } |
40 | render(){ | 40 | render(){ |
41 | const {user, org} = this.props.data; | 41 | const {user, org} = this.props.data; |
42 | return( | 42 | return( |
43 | <Navbar inverse collapseOnSelect className="bg-crimson"> | 43 | <Navbar inverse collapseOnSelect className="bg-crimson"> |
44 | <Navbar.Header> | 44 | <Navbar.Header> |
45 | <Navbar.Brand> | 45 | <Navbar.Brand> |
46 | <a href="#"><Glyphicon glyph="link" /> | 46 | <a href="#"> |
47 | {org.name} </a> | 47 | <Glyphicon glyph="link" /> |
48 | YoungDesk | ||
49 | </a> | ||
48 | </Navbar.Brand> | 50 | </Navbar.Brand> |
49 | <ul className="nav navbar-nav visible-xs-block"> | 51 | <ul className="nav navbar-nav visible-xs-block"> |
50 | <li><a href="#"><i className="icon-tree5"/></a></li> | 52 | <li><a href="#"><i className="icon-tree5"/></a></li> |
51 | <li><a className="sidebar-mobile-main-toggle"><i className="icon-paragraph-justify3"/></a></li> | 53 | <li><a className="sidebar-mobile-main-toggle"><i className="icon-paragraph-justify3"/></a></li> |
52 | </ul> | 54 | </ul> |
53 | <Navbar.Toggle /> | 55 | <Navbar.Toggle /> |
54 | </Navbar.Header> | 56 | </Navbar.Header> |
55 | <Navbar.Collapse id="navbar-mobile"> | 57 | <Navbar.Collapse id="navbar-mobile"> |
56 | <ul className="nav navbar-nav"> | 58 | <ul className="nav navbar-nav"> |
57 | <NavItem eventKey={1} href="#" className="sidebar-control sidebar-main-toggle hidden-xs"> | 59 | <NavItem eventKey={1} href="#" className="sidebar-control sidebar-main-toggle hidden-xs"> |
58 | <i | 60 | <i |
59 | className="icon-paragraph-justify3 burgerMenu" | 61 | className="icon-paragraph-justify3 burgerMenu" |
60 | onClick = {this.changeBodyClass} | 62 | onClick = {this.changeBodyClass} |
61 | /> | 63 | /> |
62 | </NavItem> | 64 | </NavItem> |
63 | 65 | ||
64 | <NavDropdown title="Dropdown" id="update"> | 66 | <NavDropdown title="Dropdown" id="update"> |
65 | <div className="dropdown-content"> | 67 | <div className="dropdown-content"> |
66 | <div className="dropdown-content-heading"> | 68 | <div className="dropdown-content-heading"> |
67 | Git updates | 69 | Git updates |
68 | <ul className="icons-list"> | 70 | <ul className="icons-list"> |
69 | <li><a href="#"><i className="icon-sync"></i></a></li> | 71 | <li><a href="#"><i className="icon-sync"></i></a></li> |
70 | </ul> | 72 | </ul> |
71 | 73 | ||
72 | </div> | 74 | </div> |
73 | <ul className="media-list dropdown-content-body width-350"> | 75 | <ul className="media-list dropdown-content-body width-350"> |
74 | <li className="media"> | 76 | <li className="media"> |
75 | <div className="media-left"> | 77 | <div className="media-left"> |
76 | <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a> | 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> |
77 | </div> | 79 | </div> |
78 | 80 | ||
79 | <div className="media-body"> | 81 | <div className="media-body"> |
80 | Drop the IE <a href="#">specific hacks</a> for temporal inputs | 82 | Drop the IE <a href="#">specific hacks</a> for temporal inputs |
81 | <div className="media-annotation">4 minutes ago</div> | 83 | <div className="media-annotation">4 minutes ago</div> |
82 | </div> | 84 | </div> |
83 | </li> | 85 | </li> |
84 | 86 | ||
85 | <li className="media"> | 87 | <li className="media"> |
86 | <div className="media-left"> | 88 | <div className="media-left"> |
87 | <a href="#" className="btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-commit"></i></a> | 89 | <a href="#" className="btn border-warning text-warning btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-commit"></i></a> |
88 | </div> | 90 | </div> |
89 | 91 | ||
90 | <div className="media-body"> | 92 | <div className="media-body"> |
91 | Add full font overrides for popovers and tooltips | 93 | Add full font overrides for popovers and tooltips |
92 | <div className="media-annotation">36 minutes ago</div> | 94 | <div className="media-annotation">36 minutes ago</div> |
93 | </div> | 95 | </div> |
94 | </li> | 96 | </li> |
95 | 97 | ||
96 | <li className="media"> | 98 | <li className="media"> |
97 | <div className="media-left"> | 99 | <div className="media-left"> |
98 | <a href="#" className="btn border-info text-info btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-branch"></i></a> | 100 | <a href="#" className="btn border-info text-info btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-branch"></i></a> |
99 | </div> | 101 | </div> |
100 | 102 | ||
101 | <div className="media-body"> | 103 | <div className="media-body"> |
102 | <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch | 104 | <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch |
103 | <div className="media-annotation">2 hours ago</div> | 105 | <div className="media-annotation">2 hours ago</div> |
104 | </div> | 106 | </div> |
105 | </li> | 107 | </li> |
106 | 108 | ||
107 | <li className="media"> | 109 | <li className="media"> |
108 | <div className="media-left"> | 110 | <div className="media-left"> |
109 | <a href="#" className="btn border-success text-success btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-merge"></i></a> | 111 | <a href="#" className="btn border-success text-success btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-merge"></i></a> |
110 | </div> | 112 | </div> |
111 | 113 | ||
112 | <div className="media-body"> | 114 | <div className="media-body"> |
113 | <a href="#">Eugene Kopyov</a> merged <span className="text-semibold">Master</span> and <span className="text-semibold">Dev</span> branches | 115 | <a href="#">Eugene Kopyov</a> merged <span className="text-semibold">Master</span> and <span className="text-semibold">Dev</span> branches |
114 | <div className="media-annotation">Dec 18, 18:36</div> | 116 | <div className="media-annotation">Dec 18, 18:36</div> |
115 | </div> | 117 | </div> |
116 | </li> | 118 | </li> |
117 | 119 | ||
118 | <li className="media"> | 120 | <li className="media"> |
119 | <div className="media-left"> | 121 | <div className="media-left"> |
120 | <a href="#" className="btn border-primary text-primary btn-flat btn-rounded btn-icon btn-sm"><i className="icon-git-pull-request"></i></a> | 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> |
121 | </div> | 123 | </div> |
122 | 124 | ||
123 | <div className="media-body"> | 125 | <div className="media-body"> |
124 | Have Carousel ignore keyboard events | 126 | Have Carousel ignore keyboard events |
125 | <div className="media-annotation">Dec 12, 05:46</div> | 127 | <div className="media-annotation">Dec 12, 05:46</div> |
126 | </div> | 128 | </div> |
127 | </li> | 129 | </li> |
128 | </ul> | 130 | </ul> |
129 | <div className="dropdown-content-footer"> | 131 | <div className="dropdown-content-footer"> |
130 | <a href="#" data-popup="tooltip" title="All activity"><i className="icon-menu display-block"></i></a> | 132 | <a href="#" data-popup="tooltip" title="All activity"><i className="icon-menu display-block"></i></a> |
131 | </div> | 133 | </div> |
132 | </div> | 134 | </div> |
133 | </NavDropdown> | 135 | </NavDropdown> |
134 | </ul> | 136 | </ul> |
135 | <div className="navbar-right"> | 137 | <div className="navbar-right"> |
136 | <p className="navbar-text">Hello {user.getFullName()}</p> | 138 | <p className="navbar-text">Hello {user.getFullName()}</p> |
137 | <p className="navbar-text"><span className="label bg-success-400">Online</span></p> | 139 | <p className="navbar-text"><span className="label bg-success-400">Online</span></p> |
138 | <Nav> | 140 | <Nav> |
139 | <NavDropdown title="Activity" id="activity"> | 141 | <NavDropdown title="Activity" id="activity"> |
140 | <div className="dropdown-content"> | 142 | <div className="dropdown-content"> |
141 | <div className="dropdown-content-heading"> | 143 | <div className="dropdown-content-heading"> |
142 | Activity | 144 | Activity |
143 | <ul className="icons-list"> | 145 | <ul className="icons-list"> |
144 | <li><a href="#"><i className="icon-menu7"></i></a></li> | 146 | <li><a href="#"><i className="icon-menu7"></i></a></li> |
145 | </ul> | 147 | </ul> |
146 | </div> | 148 | </div> |
147 | <ul className="media-list dropdown-content-body width-350"> | 149 | <ul className="media-list dropdown-content-body width-350"> |
148 | <li className="media"> | 150 | <li className="media"> |
149 | <div className="media-left"> | 151 | <div className="media-left"> |
150 | <a href="#" className="btn bg-success-400 btn-rounded btn-icon btn-xs"><i className="icon-mention"></i></a> | 152 | <a href="#" className="btn bg-success-400 btn-rounded btn-icon btn-xs"><i className="icon-mention"></i></a> |
151 | </div> | 153 | </div> |
152 | 154 | ||
153 | <div className="media-body"> | 155 | <div className="media-body"> |
154 | <a href="#">Taylor Swift</a> mentioned you in a post "Angular JS. Tips and tricks" | 156 | <a href="#">Taylor Swift</a> mentioned you in a post "Angular JS. Tips and tricks" |
155 | <div className="media-annotation">4 minutes ago</div> | 157 | <div className="media-annotation">4 minutes ago</div> |
156 | </div> | 158 | </div> |
157 | </li> | 159 | </li> |
158 | <li className="media"> | 160 | <li className="media"> |
159 | <div className="media-left"> | 161 | <div className="media-left"> |
160 | <a href="#" className="btn bg-pink-400 btn-rounded btn-icon btn-xs"><i className="icon-paperplane"></i></a> | 162 | <a href="#" className="btn bg-pink-400 btn-rounded btn-icon btn-xs"><i className="icon-paperplane"></i></a> |
161 | </div> | 163 | </div> |
162 | 164 | ||
163 | <div className="media-body"> | 165 | <div className="media-body"> |
164 | Special offers have been sent to subscribed users by <a href="#">Donna Gordon</a> | 166 | Special offers have been sent to subscribed users by <a href="#">Donna Gordon</a> |
165 | <div className="media-annotation">36 minutes ago</div> | 167 | <div className="media-annotation">36 minutes ago</div> |
166 | </div> | 168 | </div> |
167 | </li> | 169 | </li> |
168 | <li className="media"> | 170 | <li className="media"> |
169 | <div className="media-left"> | 171 | <div className="media-left"> |
170 | <a href="#" className="btn bg-blue btn-rounded btn-icon btn-xs"><i className="icon-plus3"></i></a> | 172 | <a href="#" className="btn bg-blue btn-rounded btn-icon btn-xs"><i className="icon-plus3"></i></a> |
171 | </div> | 173 | </div> |
172 | 174 | ||
173 | <div className="media-body"> | 175 | <div className="media-body"> |
174 | <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch in <span className="text-semibold">Limitless</span> repository | 176 | <a href="#">Chris Arney</a> created a new <span className="text-semibold">Design</span> branch in <span className="text-semibold">Limitless</span> repository |
175 | <div className="media-annotation">2 hours ago</div> | 177 | <div className="media-annotation">2 hours ago</div> |
176 | </div> | 178 | </div> |
177 | </li> | 179 | </li> |
178 | 180 | ||
179 | <li className="media"> | 181 | <li className="media"> |
180 | <div className="media-left"> | 182 | <div className="media-left"> |
181 | <a href="#" className="btn bg-purple-300 btn-rounded btn-icon btn-xs"><i className="icon-truck"></i></a> | 183 | <a href="#" className="btn bg-purple-300 btn-rounded btn-icon btn-xs"><i className="icon-truck"></i></a> |
182 | </div> | 184 | </div> |
183 | 185 | ||
184 | <div className="media-body"> | 186 | <div className="media-body"> |
185 | Shipping cost to the Netherlands has been reduced, database updated | 187 | Shipping cost to the Netherlands has been reduced, database updated |
186 | <div className="media-annotation">Feb 8, 11:30</div> | 188 | <div className="media-annotation">Feb 8, 11:30</div> |
187 | </div> | 189 | </div> |
188 | </li> | 190 | </li> |
189 | 191 | ||
190 | <li className="media"> | 192 | <li className="media"> |
191 | <div className="media-left"> | 193 | <div className="media-left"> |
192 | <a href="#" className="btn bg-warning-400 btn-rounded btn-icon btn-xs"><i className="icon-bubble8"></i></a> | 194 | <a href="#" className="btn bg-warning-400 btn-rounded btn-icon btn-xs"><i className="icon-bubble8"></i></a> |
193 | </div> | 195 | </div> |
194 | 196 | ||
195 | <div className="media-body"> | 197 | <div className="media-body"> |
196 | New review received on <a href="#">Server side integration</a> services | 198 | New review received on <a href="#">Server side integration</a> services |
197 | <div className="media-annotation">Feb 2, 10:20</div> | 199 | <div className="media-annotation">Feb 2, 10:20</div> |
198 | </div> | 200 | </div> |
199 | </li> | 201 | </li> |
200 | 202 | ||
201 | <li className="media"> | 203 | <li className="media"> |
202 | <div className="media-left"> | 204 | <div className="media-left"> |
203 | <a href="#" className="btn bg-teal-400 btn-rounded btn-icon btn-xs"><i className="icon-spinner11"></i></a> | 205 | <a href="#" className="btn bg-teal-400 btn-rounded btn-icon btn-xs"><i className="icon-spinner11"></i></a> |
204 | </div> | 206 | </div> |
205 | 207 | ||
206 | <div className="media-body"> | 208 | <div className="media-body"> |
207 | <strong>January, 2016</strong> - 1320 new users, 3284 orders, $49,390 revenue | 209 | <strong>January, 2016</strong> - 1320 new users, 3284 orders, $49,390 revenue |
208 | <div className="media-annotation">Feb 1, 05:46</div> | 210 | <div className="media-annotation">Feb 1, 05:46</div> |
209 | </div> | 211 | </div> |
210 | </li> | 212 | </li> |
211 | </ul> | 213 | </ul> |
212 | </div> | 214 | </div> |
213 | </NavDropdown> | 215 | </NavDropdown> |
214 | <NavDropdown title="Messages" id="messages"> | 216 | <NavDropdown title="Messages" id="messages"> |
215 | <div className="dropdown-content width-350"> | 217 | <div className="dropdown-content width-350"> |
216 | <div className="dropdown-content-heading"> | 218 | <div className="dropdown-content-heading"> |
217 | Messages | 219 | Messages |
218 | <ul className="icons-list"> | 220 | <ul className="icons-list"> |
219 | <li><a href="#"><i className="icon-compose"></i></a></li> | 221 | <li><a href="#"><i className="icon-compose"></i></a></li> |
220 | </ul> | 222 | </ul> |
221 | </div> | 223 | </div> |
222 | 224 | ||
223 | <ul className="media-list dropdown-content-body"> | 225 | <ul className="media-list dropdown-content-body"> |
224 | <li className="media"> | 226 | <li className="media"> |
225 | <div className="media-left"> | 227 | <div className="media-left"> |
226 | 228 | ||
227 | <span className="badge bg-danger-400 media-badge">5</span> | 229 | <span className="badge bg-danger-400 media-badge">5</span> |
228 | </div> | 230 | </div> |
229 | 231 | ||
230 | <div className="media-body"> | 232 | <div className="media-body"> |
231 | <a href="#" className="media-heading"> | 233 | <a href="#" className="media-heading"> |
232 | <span className="text-semibold">James Alexander</span> | 234 | <span className="text-semibold">James Alexander</span> |
233 | <span className="media-annotation pull-right">04:58</span> | 235 | <span className="media-annotation pull-right">04:58</span> |
234 | </a> | 236 | </a> |
235 | 237 | ||
236 | <span className="text-muted">who knows, maybe that would be the best thing for me...</span> | 238 | <span className="text-muted">who knows, maybe that would be the best thing for me...</span> |
237 | </div> | 239 | </div> |
238 | </li> | 240 | </li> |
239 | 241 | ||
240 | <li className="media"> | 242 | <li className="media"> |
241 | <div className="media-left"> | 243 | <div className="media-left"> |
242 | 244 | ||
243 | <span className="badge bg-danger-400 media-badge">4</span> | 245 | <span className="badge bg-danger-400 media-badge">4</span> |
244 | </div> | 246 | </div> |
245 | 247 | ||
246 | <div className="media-body"> | 248 | <div className="media-body"> |
247 | <a href="#" className="media-heading"> | 249 | <a href="#" className="media-heading"> |
248 | <span className="text-semibold">Margo Baker</span> | 250 | <span className="text-semibold">Margo Baker</span> |
249 | <span className="media-annotation pull-right">12:16</span> | 251 | <span className="media-annotation pull-right">12:16</span> |
250 | </a> | 252 | </a> |
251 | 253 | ||
252 | <span className="text-muted">That was something he was unable to do because...</span> | 254 | <span className="text-muted">That was something he was unable to do because...</span> |
253 | </div> | 255 | </div> |
254 | </li> | 256 | </li> |
255 | 257 | ||
256 | <li className="media"> | 258 | <li className="media"> |
257 | <div className="media-left"></div> | 259 | <div className="media-left"></div> |
258 | <div className="media-body"> | 260 | <div className="media-body"> |
259 | <a href="#" className="media-heading"> | 261 | <a href="#" className="media-heading"> |
260 | <span className="text-semibold">Jeremy Victorino</span> | 262 | <span className="text-semibold">Jeremy Victorino</span> |
261 | <span className="media-annotation pull-right">22:48</span> | 263 | <span className="media-annotation pull-right">22:48</span> |
262 | </a> | 264 | </a> |
263 | 265 | ||
264 | <span className="text-muted">But that would be extremely strained and suspicious...</span> | 266 | <span className="text-muted">But that would be extremely strained and suspicious...</span> |
265 | </div> | 267 | </div> |
266 | </li> | 268 | </li> |
267 | 269 | ||
268 | <li className="media"> | 270 | <li className="media"> |
269 | <div className="media-left"></div> | 271 | <div className="media-left"></div> |
270 | <div className="media-body"> | 272 | <div className="media-body"> |
271 | <a href="#" className="media-heading"> | 273 | <a href="#" className="media-heading"> |
272 | <span className="text-semibold">Beatrix Diaz</span> | 274 | <span className="text-semibold">Beatrix Diaz</span> |
273 | <span className="media-annotation pull-right">Tue</span> | 275 | <span className="media-annotation pull-right">Tue</span> |
274 | </a> | 276 | </a> |
275 | 277 | ||
276 | <span className="text-muted">What a strenuous career it is that I have chosen...</span> | 278 | <span className="text-muted">What a strenuous career it is that I have chosen...</span> |
277 | </div> | 279 | </div> |
278 | </li> | 280 | </li> |
279 | 281 | ||
280 | <li className="media"> | 282 | <li className="media"> |
281 | <div className="media-left"> | 283 | <div className="media-left"> |
282 | 284 | ||
283 | </div> | 285 | </div> |
284 | <div className="media-body"> | 286 | <div className="media-body"> |
285 | <a href="#" className="media-heading"> | 287 | <a href="#" className="media-heading"> |
286 | <span className="text-semibold">Richard Vango</span> | 288 | <span className="text-semibold">Richard Vango</span> |
287 | <span className="media-annotation pull-right">Mon</span> | 289 | <span className="media-annotation pull-right">Mon</span> |
288 | </a> | 290 | </a> |
289 | 291 | ||
290 | <span className="text-muted">Other travelling salesmen live a life of luxury...</span> | 292 | <span className="text-muted">Other travelling salesmen live a life of luxury...</span> |
291 | </div> | 293 | </div> |
292 | </li> | 294 | </li> |
293 | </ul> | 295 | </ul> |
294 | 296 | ||
295 | <div className="dropdown-content-footer"> | 297 | <div className="dropdown-content-footer"> |
296 | <a href="#" data-popup="tooltip" title="All messages"><i className="icon-menu display-block"></i></a> | 298 | <a href="#" data-popup="tooltip" title="All messages"><i className="icon-menu display-block"></i></a> |
297 | </div> | 299 | </div> |
298 | </div> | 300 | </div> |
299 | </NavDropdown> | 301 | </NavDropdown> |
300 | </Nav> | 302 | </Nav> |
301 | </div> | 303 | </div> |
302 | </Navbar.Collapse> | 304 | </Navbar.Collapse> |
303 | </Navbar> | 305 | </Navbar> |
304 | ); | 306 | ); |
305 | } | 307 | } |
306 | } | 308 | } |
307 | 309 |
imports/collections/users/publications.js
1 | import { Meteor } from 'meteor/meteor'; | 1 | import { Meteor } from 'meteor/meteor'; |
2 | import { check, Match } from 'meteor/check' | 2 | import { check, Match } from 'meteor/check' |
3 | import { Users } from '/imports/collections/users/index'; | 3 | import { Users } from '/imports/collections/users/index'; |
4 | import { Orgs } from '/imports/collections/orgs/index'; | 4 | import { Orgs } from '/imports/collections/orgs/index'; |
5 | 5 | ||
6 | 6 | ||
7 | 7 | ||
8 | Meteor.publish('users.current', function() { | 8 | Meteor.publish('users.current', function() { |
9 | return Users.find({ | 9 | return Users.find({ |
10 | _id: this.userId, | 10 | _id: this.userId, |
11 | }, { | ||
12 | fields: Users.privateFields, | ||
13 | }); | 11 | }); |
14 | }); | 12 | }); |
15 | Meteor.publish('users.forMyOrg', function() { | 13 | Meteor.publish('users.forMyOrg', function() { |
16 | const user = Users.findOne({_id: this.userId}); | 14 | const user = Users.findOne({_id: this.userId}); |
17 | if(!user) return []; | 15 | if(!user) return []; |
18 | const org = Orgs.findOne({_id: user.orgId}); | 16 | const org = Orgs.findOne({_id: user.orgId}); |
19 | if(!org) return []; | 17 | if(!org) return []; |
20 | 18 | ||
21 | return Users.find({ | 19 | return Users.find({ |
22 | orgId: user.orgId,role:"STUDENT" | 20 | orgId: user.orgId,role:"STUDENT" |
23 | }); | 21 | }); |
24 | }); | 22 | }); |
25 | 23 |