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
... | ... | @@ -0,0 +1,83 @@ |
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 | +}; | ... | ... |
imports/client/views/org/admin/teachers/TeacherView.js
... | ... | @@ -35,10 +35,8 @@ export class TeachersView extends Component { |
35 | 35 | user = {user} |
36 | 36 | org = {org} |
37 | 37 | /> |
38 | - {/*end sidebar*/} | |
39 | 38 | <div className="content-wrapper"> |
40 | 39 | <AdminBreadcrumb /> |
41 | - {/*content*/} | |
42 | 40 | |
43 | 41 | <div className="content has-detached-left"> |
44 | 42 | <div className="container-detached"> | ... | ... |
imports/client/views/org/app/module/AppLayout.js
... | ... | @@ -12,15 +12,15 @@ import { Navbar,Modal, Nav, NavItem, |
12 | 12 | NavbarToggler, NavbarBrand, |
13 | 13 | NavLink, DropdownItem, DropdownToggle, DropdownMenu, |
14 | 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 | 18 | var Accordion = require('react-bootstrap').Accordion; |
18 | 19 | var Panel = require('react-bootstrap').Panel; |
19 | 20 | export class AppLayout extends Component { |
20 | 21 | |
21 | 22 | render() { |
22 | - console.log(this.props); | |
23 | - const {user} = this.props.data; | |
23 | + const {user, org} = this.props.data; | |
24 | 24 | |
25 | 25 | if(!user) { |
26 | 26 | return ( |
... | ... | @@ -38,136 +38,17 @@ export class AppLayout extends Component { |
38 | 38 | /> |
39 | 39 | ); |
40 | 40 | } |
41 | - return ( | |
42 | - | |
43 | - <div className = "appLayout-box"> | |
44 | - <div className="page-container"> | |
45 | - <div className="page-content"> | |
46 | - <div className="sidebar sidebar-main sidebar-default"> | |
47 | - <div className="sidebar-content"> | |
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"> | |
41 | + if(user.role==='ADMIN'){ | |
42 | + return( | |
43 | + <AdminAppLayout | |
44 | + user = {user} | |
45 | + org = {org} | |
46 | + /> | |
47 | + ); | |
48 | + } | |
165 | 49 | |
166 | - </div> | |
167 | - </div> | |
168 | - </div> | |
169 | - </div> | |
170 | - </div> | |
50 | + return ( | |
51 | + null | |
171 | 52 | ); |
172 | 53 | }; |
173 | 54 | ... | ... |
imports/client/views/org/app/module/Index.js
... | ... | @@ -22,9 +22,11 @@ const meteorTick = (props, onData) => { |
22 | 22 | |
23 | 23 | if(_.every(handles, (handle) => (handle.ready()) )) { |
24 | 24 | const user = Users.current(); |
25 | + const org = Orgs.current(); | |
25 | 26 | onData(null, { |
26 | 27 | data: { |
27 | 28 | user: user, |
29 | + org: org, | |
28 | 30 | }, |
29 | 31 | }); |
30 | 32 | } | ... | ... |
imports/client/views/org/app/module/navigation/AuthenticatedNavigation.js
... | ... | @@ -43,8 +43,10 @@ export class AuthenticatedNavigation extends Component { |
43 | 43 | <Navbar inverse collapseOnSelect className="bg-crimson"> |
44 | 44 | <Navbar.Header> |
45 | 45 | <Navbar.Brand> |
46 | - <a href="#"><Glyphicon glyph="link" /> | |
47 | - {org.name} </a> | |
46 | + <a href="#"> | |
47 | + <Glyphicon glyph="link" /> | |
48 | + YoungDesk | |
49 | + </a> | |
48 | 50 | </Navbar.Brand> |
49 | 51 | <ul className="nav navbar-nav visible-xs-block"> |
50 | 52 | <li><a href="#"><i className="icon-tree5"/></a></li> | ... | ... |
imports/collections/users/publications.js
... | ... | @@ -8,8 +8,6 @@ import { Orgs } from '/imports/collections/orgs/index' |
8 | 8 | Meteor.publish('users.current', function() { |
9 | 9 | return Users.find({ |
10 | 10 | _id: this.userId, |
11 | - }, { | |
12 | - fields: Users.privateFields, | |
13 | 11 | }); |
14 | 12 | }); |
15 | 13 | Meteor.publish('users.forMyOrg', function() { | ... | ... |