Many changes aded to system.
This commit is contained in:
parent
e0571d14b7
commit
5ba618f471
22 changed files with 640 additions and 57 deletions
|
|
@ -1,37 +1,48 @@
|
|||
<template name="systemAdmin">
|
||||
<h2>System Administration</h2>
|
||||
<div class="grid">
|
||||
<article>
|
||||
<h4>Registration Settings</h4>
|
||||
<div class="grid">
|
||||
<div class="">
|
||||
<label for="allowAdmReg">
|
||||
<input type="checkbox" class="currConfigs" id="allowAdmReg" role="switch">
|
||||
Allow Admin Registration
|
||||
</label>
|
||||
<article>
|
||||
<h4>Registration Settings</h4>
|
||||
<div class="grid">
|
||||
<div class="">
|
||||
<label for="allowAdmReg">
|
||||
<input type="checkbox" class="currConfigs" id="allowAdmReg" role="switch">
|
||||
Allow Admin Registration
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div>
|
||||
<label for="allowGenReg">
|
||||
<input type="checkbox" class="currConfigs" id="allowGenReg" role="switch">
|
||||
Allow Registration
|
||||
</label>
|
||||
<div class="grid">
|
||||
<div>
|
||||
<label for="allowGenReg">
|
||||
<input type="checkbox" class="currConfigs" id="allowGenReg" role="switch">
|
||||
Allow Registration
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<article>
|
||||
<h4>Update Notifications</h4>
|
||||
<p>This option requires the seerver to have an internet connection.</p>
|
||||
<div class="grid">
|
||||
<div>
|
||||
<label for="recvUpdateMsgs">
|
||||
<input type="checkbox" class="currConfigs" id="recvUpdateMsgs" role="switch">
|
||||
System Admin will receive information on updates and new featres
|
||||
</label>
|
||||
</article>
|
||||
<article>
|
||||
<h4>Update Notifications</h4>
|
||||
<p>This option requires the seerver to have an internet connection.</p>
|
||||
<div class="grid">
|
||||
<div>
|
||||
<label for="recvUpdateMsgs">
|
||||
<input type="checkbox" class="currConfigs" id="recvUpdateMsgs" role="switch">
|
||||
System Admin will receive information on updates and new featres
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</article>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<article>
|
||||
<h4>Code Setup</h4>
|
||||
<p>Setup Code Tables (pre-defined values)</p>
|
||||
<div class="grid">
|
||||
<div>
|
||||
<button class="locationTypes navSetup" id="locationTypes">Location Types</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
{{> snackbar}}
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Roles } from 'meteor/roles';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { SysConfig } from "../../../imports/api/systemConfig";
|
||||
|
||||
|
||||
Template.systemAdmin.onCreated(function() {
|
||||
this.subscribe("SystemConfig");
|
||||
this.subscribe("rolesAvailable");
|
||||
|
|
@ -59,4 +60,8 @@ Template.systemAdmin.events({
|
|||
|
||||
updateInfo();
|
||||
},
|
||||
'click .navSetup' (event) {
|
||||
let target = event.target.id;
|
||||
FlowRouter.go('/' + target);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template name="home">
|
||||
{{#if currentUser}}
|
||||
<h1>This is Home.</h1>
|
||||
<h1>Dashboard</h1>
|
||||
{{else}}
|
||||
{{#if $eq loginOrReg 'login'}}
|
||||
{{> login}}
|
||||
|
|
|
|||
62
client/General/headerbar.css
Normal file
62
client/General/headerbar.css
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/* Basic styling for the navigation panel */
|
||||
.sidenav {
|
||||
height: 100%;
|
||||
width: 250px;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
top: 0;
|
||||
left: -250px;
|
||||
background-color: #333;
|
||||
overflow-x: hidden;
|
||||
transition: 0.5s;
|
||||
}
|
||||
|
||||
.sidenav a {
|
||||
padding: 16px 8px 16px 32px;
|
||||
text-decoration: none;
|
||||
font-size: 20px;
|
||||
color: #f1f1f1;
|
||||
display: block;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.sidenav a:hover {
|
||||
background-color: #555;
|
||||
}
|
||||
|
||||
/* Button to toggle the sidenav */
|
||||
.openbtn {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.openbtn:hover {
|
||||
background-color: #444;
|
||||
}
|
||||
|
||||
.closeBtn {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 25px;
|
||||
font-size: 24px !important;
|
||||
margin-left: 50px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.closeBtn:hover {
|
||||
background-color: #444;
|
||||
}
|
||||
|
||||
/* Top section for title and other information */
|
||||
.top-section {
|
||||
padding: 30px;
|
||||
text-align: center;
|
||||
background-color: #555;
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
/* On smaller screens, reduce the size of the sidenav button */
|
||||
@media screen and (max-height: 450px) {
|
||||
.sidenav {padding-top: 15px;}
|
||||
.sidenav a {font-size: 18px;}
|
||||
}
|
||||
|
|
@ -1,24 +1,35 @@
|
|||
<template name="headerBar">
|
||||
<nav>
|
||||
<ul>
|
||||
<li><h2>[Project Name]</h2></li>
|
||||
</ul>
|
||||
<ul>
|
||||
{{#if currentUser}}
|
||||
{{#if isInRole "systemadmin"}}
|
||||
<li><a href="#" id="manage" class="navBtn">Manage</a></li>
|
||||
{{/if}}
|
||||
<li class="signOut"><a href="#" class="signOut">Log Out</a></li>
|
||||
{{#if $eq updateExists true}}
|
||||
<li><a href="#!"><i class="material-icons" id='dashboard'>notifications</i></a></li>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{#if $eq loginOrReg 'login'}}
|
||||
<li><a href="#!" id="reg" class="navBtn">Register</a></li>
|
||||
{{else}}
|
||||
<li><a href="#!" id="login" class="navBtn">Sign In</a></li>
|
||||
{{/if}}
|
||||
<nav>
|
||||
<ul>
|
||||
<li><i class="material-icons openbtn" id="openNav">menu</i></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><h1>Open Asset</h1></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
<div id="mySidenav" class="sidenav">
|
||||
<div class="top-section">Menu<i class="material-icons closeBtn" id="closeNav">close</i></div>
|
||||
{{#if currentUser}}
|
||||
<a href="#" class="navBtn" id="home">Home</a>
|
||||
{{#if isInRole "systemadmin"}}
|
||||
<a href="#" id="manage" class="navBtn">Manage</a>
|
||||
{{/if}}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<a href="#">Clients</a>
|
||||
<hr>
|
||||
<a href="#" class="signOut">Sign Out</a>
|
||||
{{else}}
|
||||
{{#if $eq loginOrReg 'login'}}
|
||||
<a href="#!" id="reg" class="navBtn">Register</a>
|
||||
{{else}}
|
||||
<a href="#!" id="login" class="navBtn">Sign In</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -32,7 +32,7 @@ Template.headerBar.helpers({
|
|||
});
|
||||
|
||||
Template.headerBar.events({
|
||||
'click .navBtn' (event) {
|
||||
'click .navBtn' (event) {
|
||||
event.preventDefault();
|
||||
var clickedTarget = event.target.id;
|
||||
console.log("clicked " + clickedTarget);
|
||||
|
|
@ -56,5 +56,13 @@ Template.headerBar.events({
|
|||
'click #brandLogo' (event) {
|
||||
event.preventDefault();
|
||||
// FlowRouter.go('/dashboard');
|
||||
}
|
||||
},
|
||||
'click #openNav' (event) {
|
||||
let mySidenav = document.getElementById("mySidenav");
|
||||
mySidenav.style.left = "0";
|
||||
},
|
||||
'click #closeNav' (event) {
|
||||
let mySidenav = document.getElementById("mySidenav");
|
||||
mySidenav.style.left = "-250px";
|
||||
},
|
||||
});
|
||||
|
|
|
|||
23
client/LocationTypes/locationTypeTbl.html
Normal file
23
client/LocationTypes/locationTypeTbl.html
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<template name="locationTypeTbl">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each types}}
|
||||
<tr>
|
||||
<td>{{locationTypeName}}</td>
|
||||
<td>{{locationTypeDesc}}</td>
|
||||
<td>
|
||||
<i class="material-icons">edit</i>
|
||||
<i class="material-icons">delete</i>
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
</template>
|
||||
21
client/LocationTypes/locationTypeTbl.js
Normal file
21
client/LocationTypes/locationTypeTbl.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { Roles } from 'meteor/roles';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { LocationTypes } from '../../imports/api/locationTypes.js';
|
||||
|
||||
Template.locationTypeTbl.onCreated(function() {
|
||||
this.subscribe("LocationTypes");
|
||||
});
|
||||
|
||||
Template.locationTypeTbl.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.locationTypeTbl.helpers({
|
||||
types: function() {
|
||||
return LocationTypes.find({});
|
||||
},
|
||||
});
|
||||
|
||||
Template.locationTypeTbl.events({
|
||||
|
||||
});
|
||||
21
client/LocationTypes/locationTypes.html
Normal file
21
client/LocationTypes/locationTypes.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<template name="locationTypes">
|
||||
<h1>Location Type Setup</h1>
|
||||
<div class="grid">
|
||||
<div>
|
||||
<label for="typeName">Location Type Name *</label>
|
||||
<input type="text" class="typeName" id="typeName" required />
|
||||
</div>
|
||||
<div>
|
||||
<label for="typeDesc">Location Type Description</label>
|
||||
<input type="text" class="typeDesc" id="typeDesc" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid">
|
||||
<div>
|
||||
<button class="primary right" id="saveLocationType">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
{{> locationTypeTbl}}
|
||||
{{> snackbar}}
|
||||
</template>
|
||||
38
client/LocationTypes/locationTypes.js
Normal file
38
client/LocationTypes/locationTypes.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { Roles } from 'meteor/roles';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
import { LocationTypes } from '../../imports/api/locationTypes.js';
|
||||
|
||||
Template.locationTypes.onCreated(function() {
|
||||
this.subscribe("LocationTypes");
|
||||
});
|
||||
|
||||
Template.locationTypes.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.locationTypes.helpers({
|
||||
|
||||
});
|
||||
|
||||
Template.locationTypes.events({
|
||||
'click #saveLocationType' (event) {
|
||||
event.preventDefault();
|
||||
|
||||
let typeName = $("#typeName").val();
|
||||
let typeDesc = $("#typeDesc").val();
|
||||
|
||||
if (typeName == null || typeName == "") {
|
||||
return;
|
||||
} else {
|
||||
const addLocation = async() => {
|
||||
const result = await Meteor.callAsync("add.locationType", typeName, typeDesc);
|
||||
if (!result) {
|
||||
showSnackbar("Location Type Failed!", "red");
|
||||
} else {
|
||||
showSnackbar("Location Type Added!", "green");
|
||||
}
|
||||
}
|
||||
addLocation();
|
||||
}
|
||||
}
|
||||
});
|
||||
4
client/Locations/locations.html
Normal file
4
client/Locations/locations.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<template name="locations">
|
||||
<h1>Locations</h1>
|
||||
|
||||
</template>
|
||||
19
client/Locations/locations.js
Normal file
19
client/Locations/locations.js
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { Roles } from 'meteor/roles';
|
||||
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
||||
// import { Locations } from '../../imports/api/locations.js';
|
||||
|
||||
Template.locations.onCreated(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.locations.onRendered(function() {
|
||||
|
||||
});
|
||||
|
||||
Template.locations.helpers({
|
||||
|
||||
});
|
||||
|
||||
Template.locations.events({
|
||||
|
||||
});
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
<div class="container">
|
||||
{{> headerBar}}
|
||||
{{> Template.dynamic template=main}}
|
||||
|
||||
</div>
|
||||
{{/if}}
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue