├── .meteor ├── .finished-upgraders ├── .gitignore ├── .id ├── packages ├── platforms ├── release └── versions ├── README.md ├── client ├── main.coffee ├── main.jade ├── stylesheets │ └── app.styl └── templates │ ├── aConfig │ └── autoform.coffee │ ├── application │ ├── assets │ │ ├── assets │ │ │ ├── createAsset.coffee │ │ │ ├── createAsset.jade │ │ │ ├── createLocation.coffee │ │ │ ├── createLocation.jade │ │ │ ├── editAsset.coffee │ │ │ ├── editAsset.jade │ │ │ ├── editLocation.coffee │ │ │ ├── editLocation.jade │ │ │ ├── viewAsset.coffee │ │ │ ├── viewAsset.jade │ │ │ ├── viewLocation.coffee │ │ │ ├── viewLocation.jade │ │ │ ├── viewLocations.coffee │ │ │ └── viewLocations.jade │ │ ├── classifications │ │ │ ├── createAssetClass.coffee │ │ │ ├── createAssetClass.jade │ │ │ ├── deleteAssetClass.coffee │ │ │ ├── deleteAssetClass.jade │ │ │ ├── editAssetClass.coffee │ │ │ ├── editAssetClass.jade │ │ │ ├── viewAssetClass.coffee │ │ │ ├── viewAssetClass.jade │ │ │ ├── viewAssetClasses.coffee │ │ │ └── viewAssetClasses.jade │ │ └── meters │ │ │ ├── createMeter.coffee │ │ │ ├── createMeter.jade │ │ │ ├── viewMeters.coffee │ │ │ └── viewMeters.jade │ ├── custom │ │ ├── aConfig │ │ │ └── index.coffee │ │ ├── assets │ │ │ └── assets.jade │ │ └── readme.txt │ ├── help │ │ ├── help.coffee │ │ └── help.jade │ ├── inventory │ │ ├── equipment │ │ │ ├── createEquipment.coffee │ │ │ ├── createEquipment.jade │ │ │ ├── createEquipmentClass.coffee │ │ │ ├── createEquipmentClass.jade │ │ │ ├── deleteEquipmentClass.coffee │ │ │ ├── deleteEquipmentClass.jade │ │ │ ├── editEquipment.coffee │ │ │ ├── editEquipment.jade │ │ │ ├── editEquipmentClass.coffee │ │ │ ├── editEquipmentClass.jade │ │ │ ├── viewEquipment.coffee │ │ │ ├── viewEquipment.jade │ │ │ ├── viewEquipmentClass.coffee │ │ │ ├── viewEquipmentClass.jade │ │ │ ├── viewEquipmentClasses.coffee │ │ │ ├── viewEquipmentClasses.jade │ │ │ ├── viewEquipments.coffee │ │ │ └── viewEquipments.jade │ │ ├── inventory.coffee │ │ ├── inventory.jade │ │ ├── item │ │ │ ├── createItem.coffee │ │ │ ├── createItem.jade │ │ │ ├── createItemClass.coffee │ │ │ ├── createItemClass.jade │ │ │ ├── deleteItemClass.coffee │ │ │ ├── deleteItemClass.jade │ │ │ ├── editItem.coffee │ │ │ ├── editItem.jade │ │ │ ├── editItemClass.coffee │ │ │ ├── editItemClass.jade │ │ │ ├── viewItem.coffee │ │ │ ├── viewItem.jade │ │ │ ├── viewItemClass.coffee │ │ │ ├── viewItemClass.jade │ │ │ ├── viewItemClasses.coffee │ │ │ ├── viewItemClasses.jade │ │ │ ├── viewItems.coffee │ │ │ └── viewItems.jade │ │ └── locations │ │ │ ├── createInvLoc.coffee │ │ │ ├── createInvLoc.jade │ │ │ ├── createInvLocClass.coffee │ │ │ ├── createInvLocClass.jade │ │ │ ├── deleteInvLocClass.coffee │ │ │ ├── deleteInvLocClass.jade │ │ │ ├── editInvLoc.coffee │ │ │ ├── editInvLoc.jade │ │ │ ├── editInvLocClass.coffee │ │ │ ├── editInvLocClass.jade │ │ │ ├── stockLevels.coffee │ │ │ ├── stockLevels.jade │ │ │ ├── viewInvLoc.coffee │ │ │ ├── viewInvLoc.jade │ │ │ ├── viewInvLocClass.coffee │ │ │ ├── viewInvLocClass.jade │ │ │ ├── viewInvLocClasses.coffee │ │ │ ├── viewInvLocClasses.jade │ │ │ ├── viewInvLocs.coffee │ │ │ └── viewInvLocs.jade │ ├── pm │ │ ├── activatePM.coffee │ │ ├── activatePm.jade │ │ ├── assetGroups.coffee │ │ ├── assetGroups.jade │ │ ├── createAssetGroup.coffee │ │ ├── createAssetGroup.jade │ │ ├── createPM.coffee │ │ ├── createPM.jade │ │ ├── editAssetGroup.coffee │ │ ├── editAssetGroup.jade │ │ ├── editPM.coffee │ │ ├── editPM.jade │ │ ├── pm.coffee │ │ ├── pm.jade │ │ ├── viewAssetGroup.coffee │ │ ├── viewAssetGroup.jade │ │ ├── viewPM.coffee │ │ ├── viewPM.jade │ │ ├── viewPMs.coffee │ │ └── viewPMs.jade │ ├── procurement │ │ ├── companies │ │ │ ├── createCompany.coffee │ │ │ ├── createCompany.jade │ │ │ ├── createCompanyClass.coffee │ │ │ ├── createCompanyClass.jade │ │ │ ├── deleteCompany.coffee │ │ │ ├── deleteCompany.jade │ │ │ ├── deleteCompanyClass.coffee │ │ │ ├── deleteCompanyClass.jade │ │ │ ├── editCompany.coffee │ │ │ ├── editCompany.jade │ │ │ ├── editCompanyClass.coffee │ │ │ ├── editCompanyClass.jade │ │ │ ├── viewCompanies.coffee │ │ │ ├── viewCompanies.jade │ │ │ ├── viewCompany.coffee │ │ │ ├── viewCompany.jade │ │ │ ├── viewCompanyClass.coffee │ │ │ ├── viewCompanyClass.jade │ │ │ ├── viewCompanyClasses.coffee │ │ │ └── viewCompanyClasses.jade │ │ ├── procurement.coffee │ │ ├── procurement.jade │ │ └── purchasing │ │ │ ├── createPurchase.coffee │ │ │ ├── createPurchase.jade │ │ │ ├── editPurchase.coffee │ │ │ ├── editPurchase.jade │ │ │ ├── receiveGoods.coffee │ │ │ ├── receiveGoods.jade │ │ │ ├── viewPurchase.coffee │ │ │ ├── viewPurchase.jade │ │ │ ├── viewPurchases.coffee │ │ │ └── viewPurchases.jade │ ├── reports │ │ ├── reports.coffee │ │ └── reports.jade │ ├── resources │ │ ├── credentials.coffee │ │ ├── credentials.jade │ │ ├── editPeople.coffee │ │ ├── editPeople.jade │ │ ├── viewPeople.coffee │ │ └── viewPeople.jade │ └── work │ │ ├── createSafetyTemplate.coffee │ │ ├── createSafetyTemplate.jade │ │ ├── createWork.coffee │ │ ├── createWork.jade │ │ ├── createWorkTemplate.coffee │ │ ├── createWorkTemplate.jade │ │ ├── editSafetyTemplate.coffee │ │ ├── editSafetyTemplate.jade │ │ ├── editWorkTemplate.coffee │ │ ├── editWorkTemplate.jade │ │ ├── editWorkorder.coffee │ │ ├── editWorkorder.jade │ │ ├── myWorkorder.coffee │ │ ├── myWorkorder.jade │ │ ├── myWorkorders.coffee │ │ ├── myWorkorders.jade │ │ ├── query.coffee │ │ ├── query.jade │ │ ├── safetyTemplates.coffee │ │ ├── safetyTemplates.jade │ │ ├── viewSafetyTemplate.coffee │ │ ├── viewSafetyTemplate.jade │ │ ├── viewWork.coffee │ │ ├── viewWork.jade │ │ ├── viewWorkTemplate.coffee │ │ ├── viewWorkTemplate.jade │ │ ├── viewWorkorder.coffee │ │ ├── viewWorkorder.jade │ │ ├── work.coffee │ │ ├── work.jade │ │ ├── workTemplates.coffee │ │ └── workTemplates.jade │ ├── includes │ ├── access_denied.html │ ├── loading.html │ └── signin.html │ └── layouts │ ├── about.coffee │ ├── about.jade │ ├── classification │ ├── createClassification.coffee │ ├── createClassification.jade │ ├── editClassification.coffee │ ├── editClassification.jade │ ├── viewClassification.coffee │ ├── viewClassification.jade │ ├── viewClassifications.coffee │ └── viewClassifications.jade │ ├── forms │ ├── autoform.coffee │ ├── autoform.jade │ ├── forms.coffee │ ├── forms.jade │ ├── reactive-table.coffee │ ├── reactive-table.jade │ ├── treeview.coffee │ └── treeview.jade │ ├── layout.coffee │ ├── layout.jade │ ├── notFound.jade │ ├── toast.coffee │ ├── welcome.coffee │ └── welcome.jade ├── lib ├── collections │ ├── 0Global.coffee │ ├── Collections.coffee │ ├── schema0General.coffee │ ├── schema1Locations.coffee │ ├── schema2Resources.coffee │ ├── schema3Work.coffee │ ├── schema4PM.coffee │ ├── schema5Inventory.coffee │ └── schema6Procurement.coffee ├── config │ ├── accounts_t9n.js │ ├── at_config.js │ └── configLists.coffee ├── custom │ ├── inventoryLists.coffee │ ├── locationsLists.coffee │ ├── procurementLists.coffee │ ├── readme.txt │ ├── resourcesLists.coffee │ └── workorderLists.coffee ├── functions │ └── general.coffee ├── i18n │ ├── en.i18n.json │ └── i18n.xlsx ├── permissions.js └── router │ ├── aRouter.coffee │ ├── assets.coffee │ ├── inventory.coffee │ ├── pm.coffee │ ├── procurement.coffee │ ├── resources.coffee │ └── work.coffee ├── public ├── Birt-logo.png ├── Logo_D3.png ├── flowchart.png ├── front.jpg └── laterText.html ├── server ├── 0Startup.coffee ├── methods │ ├── general.coffee │ ├── inventory.coffee │ ├── locations.coffee │ ├── pm.coffee │ ├── procurement.coffee │ ├── resources.coffee │ └── work.coffee └── publications.coffee └── video.png /.meteor/.finished-upgraders: -------------------------------------------------------------------------------- 1 | # This file contains information which helps Meteor properly upgrade your 2 | # app when you run 'meteor update'. You should check it into version control 3 | # with your project. 4 | 5 | notices-for-0.9.0 6 | notices-for-0.9.1 7 | 0.9.4-platform-file 8 | notices-for-facebook-graph-api-2 9 | 1.2.0-standard-minifiers-package 10 | 1.2.0-meteor-platform-split 11 | 1.2.0-cordova-changes 12 | 1.2.0-breaking-changes 13 | -------------------------------------------------------------------------------- /.meteor/.gitignore: -------------------------------------------------------------------------------- 1 | local 2 | -------------------------------------------------------------------------------- /.meteor/.id: -------------------------------------------------------------------------------- 1 | # This file contains a token that is unique to your project. 2 | # Check it into your repository along with the rest of this directory. 3 | # It can be used for purposes such as: 4 | # - ensuring you don't accidentally deploy one app on top of another 5 | # - providing package authors with aggregated statistics 6 | 7 | 8 | umj90hp14ty51r50pke 9 | 10 | 1wijmtu1rsh0jueu4540 11 | 12 | -------------------------------------------------------------------------------- /.meteor/packages: -------------------------------------------------------------------------------- 1 | # Meteor packages used by this project, one per line. 2 | # Check this file (and the other files in this directory) into your repository. 3 | # 4 | # 'meteor add' and 'meteor remove' will edit this file for you, 5 | # but you can also edit it by hand. 6 | 7 | meteor-base # Packages every Meteor app needs to have 8 | mobile-experience # Packages for a great mobile UX 9 | mongo # The database Meteor supports right now 10 | blaze-html-templates # Compile .html files into Meteor Blaze views 11 | session # Client-side reactive dictionary for your app 12 | jquery # Helpful client-side library 13 | tracker # Meteor's client-side reactive programming library 14 | 15 | standard-minifiers # JS/CSS minifiers run for production mode 16 | es5-shim # ECMAScript 5 compatibility for older browsers. 17 | ecmascript # Enable ECMAScript2015+ syntax in app code 18 | 19 | kadira:flow-router 20 | kadira:blaze-layout 21 | useraccounts:flow-routing 22 | arillo:flow-router-helpers 23 | aldeed:autoform 24 | aldeed:collection2 25 | sujith3g:jstree 26 | fortawesome:fontawesome 27 | reactive-var 28 | email 29 | aslagle:reactive-table 30 | aldeed:delete-button 31 | meteorstuff:materialize-modal 32 | coffeescript 33 | mquandalle:jade 34 | stylus 35 | accounts-base 36 | accounts-password 37 | useraccounts:core 38 | useraccounts:materialize 39 | less 40 | hitchcott:qr-scanner 41 | ground:db 42 | tmeasday:publish-counts 43 | momentjs:moment 44 | gildaspk:autoform-materialize 45 | tap:i18n 46 | msavin:mongol 47 | modweb:flipclock 48 | materialize:materialize 49 | voidale:later-js-tz 50 | percolate:synced-cron 51 | -------------------------------------------------------------------------------- /.meteor/platforms: -------------------------------------------------------------------------------- 1 | server 2 | browser 3 | -------------------------------------------------------------------------------- /.meteor/release: -------------------------------------------------------------------------------- 1 | METEOR@1.2.1 2 | -------------------------------------------------------------------------------- /client/main.coffee: -------------------------------------------------------------------------------- 1 | # Subscribe to a subset of the data on the client 2 | Meteor.subscribe 'locations' 3 | Meteor.subscribe 'classification' 4 | # Subscribe to subset persisted in GroundDB 5 | Ground.Collection Workorders 6 | 7 | Meteor.startup -> 8 | # Initialise Autoform 9 | hooksObject = { 10 | # Called when any submit operation succeeds 11 | onSuccess: (formType, result) -> toast 'success', 'Database operation completed.' 12 | # Called when any submit operation fails 13 | onError: (formType, error) -> 14 | if (formType == "method") 15 | toast 'error', error.details 16 | else 17 | toast 'error', error 18 | } 19 | AutoForm.addHooks(null, hooksObject); 20 | 21 | # Initialise Navbar dropdown 22 | $('.dropdown-button').dropdown {hover:false} 23 | 24 | #Initialise sessions 25 | Session.set 'currentDoc', {} 26 | Session.set 'currentID', '#' 27 | -------------------------------------------------------------------------------- /client/main.jade: -------------------------------------------------------------------------------- 1 | head 2 | title Lightning EAM 3 | meta(name='viewport', content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no') 4 | link(rel='icon', sizes='16x16 32x32', href='/favicon.ico?v=2') 5 | link(href='https://fonts.googleapis.com/icon?family=Material+Icons', rel='stylesheet') 6 | body 7 | +layout 8 | -------------------------------------------------------------------------------- /client/stylesheets/app.styl: -------------------------------------------------------------------------------- 1 | @media only screen and (min-width: 0) 2 | table 3 | font-size 12px !important 4 | 5 | @media only screen and (min-width: 992px) 6 | table 7 | font-size 14px !important 8 | 9 | @media only screen and (min-width: 1200px) 10 | table 11 | font-size 16px !important 12 | 13 | .backdrop 14 | background-color teal 15 | 16 | .container2 17 | margin 0 auto 18 | width 95% 19 | 20 | .big-icon 21 | font-size 160px !important 22 | 23 | .icon-page 24 | color #263238 !important 25 | 26 | .treeview 27 | margin-top 1em 28 | min-height 200px 29 | 30 | .toast-success 31 | background-color #2BBBAD !important 32 | 33 | .button-fa 34 | padding-bottom 2px 35 | 36 | .navbar-icon 37 | padding 0 12px 0 12px 38 | 39 | .collection 40 | overflow-y scroll !important 41 | 42 | select 43 | height auto !important 44 | 45 | [type="radio"] + label 46 | padding-right 35px 47 | 48 | .flipClock 49 | position: fixed 50 | bottom: 0 51 | right: 0 52 | opacity: 0.5 53 | padding-left: 2% 54 | // Scale 55 | transform-origin: 0 0 56 | transform: scale(.75) 57 | -ms-transform: scale(.75) 58 | -webkit-transform-origin: 0 0 59 | -webkit-transform: scale(.75) 60 | -o-transform-origin: 0 0 61 | -o-transform: scale(.75) 62 | -moz-transform-origin: 0 0 63 | -moz-transform: scale(.75) 64 | 65 | .field-border 66 | border:1px solid teal 67 | border-radius: 10px 68 | padding: 1% 69 | margin: 1% 70 | 71 | .margin-bottom-420 72 | margin-bottom: 420px 73 | 74 | .row-borders tr 75 | border:1px solid teal 76 | -------------------------------------------------------------------------------- /client/templates/aConfig/autoform.coffee: -------------------------------------------------------------------------------- 1 | AutoForm.setDefaultTemplate 'materialize' 2 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/createAsset.coffee: -------------------------------------------------------------------------------- 1 | Template.createAssetPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.createAssetPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.createAssetPage.helpers 9 | parentID: -> Session.get('currentID').toString() 10 | children: -> [] 11 | locationFormSchema: -> Schema.locations 12 | customTemplate: -> Customisations.createAsset 13 | assetClassID: -> Session.get 'currentClassID' 14 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 15 | 16 | Template.createAssetPage.events 17 | 'click .firstRow .btnAdd': (event, template) -> 18 | MaterializeModal.confirm 19 | title: 'Select Asset Classification' 20 | bodyTemplate: "createAssetAddAssetClass" 21 | 22 | Template.createAssetAddAssetClass.onRendered -> 23 | tempData = Classification.find(type: 'asset-classification').fetch() 24 | dataTree(tempData, 'classification') 25 | 26 | Template.createAssetAddAssetClass.helpers 27 | classificationDetails: -> Classification.findOne(_id: Session.get('currentClassID').toString()) 28 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/createLocation.coffee: -------------------------------------------------------------------------------- 1 | Template.createLocationPage.helpers 2 | customTemplate: -> Customisations.createLocation 3 | parentID: -> Session.get('currentID').toString() 4 | children: -> [] 5 | locationFormSchema: -> Schema.locations 6 | locationType: -> 7 | if (Session.get 'currentID') == '#' 8 | type = 'database' 9 | else 10 | type = 'location' 11 | return type 12 | 13 | Template.createLocationPage.onRendered -> 14 | $(".dropdown-button").dropdown() 15 | $('.tooltipped').tooltip {delay: 50} 16 | 17 | Template.createLocationPage.onDestroyed -> 18 | $('.tooltipped').tooltip 'remove' 19 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/createLocation.jade: -------------------------------------------------------------------------------- 1 | template(name='createLocationPage') 2 | if customTemplate 3 | +createLocationPageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=locationFormSchema id='createLocationPage' type='method' meteormethod='createLoc' 8 | fieldset 9 | legend New Location 10 | .row 11 | +afQuickField name='id' type='hidden' 12 | +afQuickField name='type' value=locationType type='hidden' 13 | +afQuickField name='parent' value=parentID defaultValue='#' type='hidden' 14 | .col.s12.m6.l3 15 | +afQuickField name='assetID' 16 | .col.s12.m6.l3 17 | +afQuickField name='criticality' label='*Criticality' 18 | div 19 | +afQuickField name='text' label='*Title' 20 | div 21 | +afQuickField name='description' 22 | div 23 | +afQuickField name='safety' 24 | .row 25 | .divider.teal 26 | .section 27 | h6.teal-text Geolocation Information 28 | .col.s12.m6.l3 29 | +afQuickField name='lat1' 30 | .col.s12.m6.l3 31 | +afQuickField name='long1' 32 | .row 33 | .divider.teal 34 | .section 35 | h6.teal-text Address Information 36 | div 37 | +afQuickField name='address' 38 | .col.s12.m6.l3 39 | +afQuickField name='state' 40 | .col.s12.m6.l3 41 | +afQuickField name='zip' 42 | .col.s12.m6.l3 43 | +afQuickField name='country' 44 | .row 45 | .divider.teal 46 | .section 47 | h6.teal-text Additional Information 48 | .col.s12.m6.l3 49 | +afQuickField name='urlTechData' 50 | .col.s12.m6.l3 51 | +afQuickField name='urlOpData' 52 | .col.s12.m6.l3 53 | +afQuickField name='urlPhoto' 54 | +fabBackResetSubmit 55 | br 56 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/editAsset.coffee: -------------------------------------------------------------------------------- 1 | Template.editAssetPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editAssetPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editAssetPage.onCreated -> 9 | self = this 10 | self.autorun -> 11 | self.subscribe 'singleLocation', Session.get('currentID').toString() 12 | 13 | Template.editAssetPage.helpers 14 | customTemplate: -> Customisations.editAsset # user customised template if applicable 15 | currentDoc: -> 16 | Collections.Locations.Current = Locations.findOne {'_id':Session.get('currentID').toString()} 17 | return Collections.Locations.Current 18 | asset: -> (Collections.Locations.Current.type == 'asset') 19 | locationFormSchema: -> Schema.locations 20 | assetClassID: -> Session.get 'currentClassID' 21 | txtClassificationID: -> Classification.findOne({_id: Session.get('currentClassID').toString()}).text 22 | 23 | Template.editAssetPage.events 24 | 'click .firstRow .btnAdd': (event, template) -> 25 | MaterializeModal.confirm 26 | title: 'Select Asset Classification' 27 | bodyTemplate: "modalEditAssetPage" 28 | 29 | #------------------- Modal ------------------------------------- 30 | 31 | Template.modalEditAssetPage.onRendered -> 32 | tempData = Classification.find(type: 'asset-classification').fetch() 33 | dataTree(tempData, 'classification') 34 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/editLocation.coffee: -------------------------------------------------------------------------------- 1 | Template.editLocationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editLocationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editLocationPage.onCreated -> 9 | self = this 10 | self.autorun -> 11 | self.subscribe 'singleLocation', (Session.get('currentID').toString()) 12 | 13 | Template.editLocationPage.helpers 14 | customTemplate: -> Customisations.editLoaction 15 | currentDoc: -> 16 | Collections.Locations.Current = Locations.findOne {'id':Session.get('currentID').toString()} 17 | return Collections.Locations.Current 18 | asset: -> (Collections.Locations.Current.type == 'asset') 19 | locationFormSchema: -> Schema.locations 20 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/editLocation.jade: -------------------------------------------------------------------------------- 1 | template(name='editLocationPage') 2 | if customTemplate 3 | +editLocationPageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=locationFormSchema id='editLocationPage' type='update' collection='Locations' doc=currentDoc 8 | fieldset.active 9 | legend Edit Location 10 | if Template.subscriptionsReady 11 | br 12 | .row 13 | +afQuickField name="parent" type="hidden" 14 | +afQuickField name="treePath" type="hidden" 15 | .col.s12.m6.l3 16 | +afQuickField name="assetID" 17 | .col.s12.m6.l3 18 | +afQuickField name='criticality' 19 | div 20 | +afQuickField name='text' 21 | div 22 | +afQuickField name='description' 23 | div 24 | +afQuickField name='safety' 25 | .row 26 | .divider.teal 27 | .section 28 | h6.teal-text Geolocation Information 29 | .col.s12.m6.l3 30 | +afQuickField name='lat1' 31 | .col.s12.m6.l3 32 | +afQuickField name='long1' 33 | .row 34 | .divider.teal 35 | .section 36 | h6.teal-text Address Information 37 | div 38 | +afQuickField name='address' 39 | .col.s12.m6.l3 40 | +afQuickField name='state' 41 | .col.s12.m6.l3 42 | +afQuickField name='zip' 43 | .col.s12.m6.l3 44 | +afQuickField name='country' 45 | .row 46 | .divider.teal 47 | .section 48 | h6.teal-text Additional Information 49 | .col.s12.m6.l3 50 | +afQuickField name='urlTechData' 51 | .col.s12.m6.l3 52 | +afQuickField name='urlOpData' 53 | .col.s12.m6.l3 54 | +afQuickField name='urlPhoto' 55 | else 56 | +spinner 57 | +fabBackResetSubmit 58 | br 59 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/viewAsset.coffee: -------------------------------------------------------------------------------- 1 | Template.viewAssetPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewAssetPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewAssetPage.onCreated -> 9 | self = this 10 | self.autorun -> 11 | self.subscribe 'singleLocation', (Session.get('currentID').toString()) 12 | 13 | Template.viewAssetPage.helpers 14 | customTemplate: -> Customisations.viewAsset 15 | viewDoc: -> 16 | console.log 'currentID: '+Session.get('currentID') 17 | Collections.Locations.Current = Locations.findOne {'id':Session.get('currentID').toString()} 18 | console.log 'Collections.Locations.Current: '+ JSON.stringify Collections.Locations.Current 19 | Collections.Locations.Current 20 | locationsFormSchema: -> Schema.locations 21 | assetClassification: -> Collections.Locations.Current.assetClassification.text 22 | 23 | Template.viewAssetPage.events 24 | 'click .viewAsset .btnEdit': -> 25 | if (Session.get('currentID').toString() == '#') 26 | alert 'No location or asset selected!' 27 | else 28 | if (Collections.Locations.Current.type == 'asset') 29 | FlowRouter.go '/assets/edit-asset' 30 | else 31 | FlowRouter.go '/assets/edit-location' 32 | 'click .viewAsset .btnCopy': -> 33 | if (Session.get('currentID').toString() == '#') 34 | alert 'No location or asset selected!' 35 | else 36 | if (Collections.Locations.Current.type == 'asset') 37 | FlowRouter.go '/assets/duplicate-asset' 38 | else 39 | FlowRouter.go '/assets/duplicate-location' 40 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/viewLocation.coffee: -------------------------------------------------------------------------------- 1 | Template.viewLocationPage.onCreated -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singleLocation', (Session.get('currentID').toString()) 5 | 6 | Template.viewLocationPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.viewLocationPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.viewLocationPage.helpers 14 | customTemplate: -> Customisations.viewLocation 15 | locationsFormSchema: -> Schema.locations 16 | viewDoc: -> 17 | Collections.Locations.Current = Locations.findOne {'id':Session.get('currentID').toString()} 18 | return Collections.Locations.Current 19 | 20 | Template.viewLocationPage.events 21 | 'click .viewLocation .btnEdit': -> 22 | if (Session.get('currentID').toString()== '#') 23 | alert 'No location or asset selected!' 24 | else 25 | if (Collections.Locations.Current.type == 'asset') 26 | FlowRouter.go '/assets/edit-asset' 27 | else 28 | FlowRouter.go '/assets/edit-location' 29 | 'click .viewLocation .btnCopy': -> 30 | if (Session.get('currentID').toString()== '#') 31 | alert 'No location or asset selected!' 32 | else 33 | if (Collections.Locations.Current.type == 'asset') 34 | FlowRouter.go '/assets/duplicate-asset' 35 | else 36 | FlowRouter.go '/assets/duplicate-location' 37 | -------------------------------------------------------------------------------- /client/templates/application/assets/assets/viewLocation.jade: -------------------------------------------------------------------------------- 1 | template(name='viewLocationPage') 2 | if customTemplate 3 | +viewLocationPageCustom 4 | else 5 | .flow-text.container2.viewLocation 6 | +fabBackCopyEdit 7 | br 8 | fieldset 9 | legend View Location 10 | +autoForm schema=locationsFormSchema id="viewLocationPage" type="readonly" collection="Locations" doc=viewDoc 11 | if Template.subscriptionsReady 12 | .row 13 | h6.teal-text Asset Details 14 | .col.s12.m6.l3 15 | +afQuickField name="id" 16 | .col.s12.m6.l3 17 | +afQuickField name="criticality" 18 | div 19 | +afQuickField name="text" 20 | div 21 | +afQuickField name="description" 22 | div 23 | +afQuickField name="safety" 24 | .row 25 | .divider.teal 26 | .section 27 | h6.teal-text Geolocation Information 28 | .col.s12.m6.l3 29 | +afQuickField name="lat1" 30 | .col.s12.m6.l3 31 | +afQuickField name="long1" 32 | // Other info 33 | .row 34 | .divider.teal 35 | .section 36 | h6.teal-text Address Information 37 | .col.s12.m6.l3 38 | +afQuickField name="address" 39 | .col.s12.m6.l3 40 | +afQuickField name="state" 41 | .col.s12.m6.l3 42 | +afQuickField name="zip" 43 | .col.s12.m6.l3 44 | +afQuickField name="country" 45 | .row 46 | .divider.teal 47 | .section 48 | h6.teal-text Additional Information 49 | .col.s12.m6.l3 50 | +afQuickField name="urlTechData" 51 | .col.s12.m6.l3 52 | +afQuickField name="urlOpData" 53 | .col.s12.m6.l3 54 | +afQuickField name="urlPhoto" 55 | else 56 | +spinner 57 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/createAssetClass.coffee: -------------------------------------------------------------------------------- 1 | Template.createAssetClassificationPage.helpers 2 | customTemplate: -> Customisations.createAssetClassification 3 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/createAssetClass.jade: -------------------------------------------------------------------------------- 1 | template(name='createAssetClassificationPage') 2 | if customTemplate 3 | +createAssetClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +createClassificationPage classificationType='asset-classification' 7 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/deleteAssetClass.coffee: -------------------------------------------------------------------------------- 1 | Template.deleteAssetClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.deleteAssetClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.deleteAssetClassificationPage.helpers 9 | customTemplate: -> Customisations.deleteAssetClassification 10 | textDoc: -> Classification.findOne({'id':Session.get('currentClassID').toString()}).text 11 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/deleteAssetClass.jade: -------------------------------------------------------------------------------- 1 | template(name='deleteAssetClassificationPage') 2 | if customTemplate 3 | +deleteAssetClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +deleteClassificationPage doc=textDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/editAssetClass.coffee: -------------------------------------------------------------------------------- 1 | Template.editAssetClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editAssetClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editAssetClassificationPage.helpers 9 | customTemplate: -> Customisations.editAssetClassification # user customised template if applicable 10 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/editAssetClass.jade: -------------------------------------------------------------------------------- 1 | template(name='editAssetClassificationPage') 2 | if customTemplate 3 | +editAssetClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +editClassificationPage 7 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/viewAssetClass.coffee: -------------------------------------------------------------------------------- 1 | Template.viewAssetClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewAssetClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewAssetClassificationPage.helpers 9 | customTemplate: -> Customisations.viewAssetClassification 10 | viewDoc: -> 11 | Collections.Classification.Current = Classification.findOne {'id':Session.get('currentClassID').toString()} 12 | return Collections.Classification.Current 13 | 14 | Template.viewAssetClassificationPage.events 15 | 'click .viewAssetClassification .btnEdit': -> 16 | if (Session.get('currentClassID').toString() == '#') 17 | alert 'No classification selected!' 18 | else 19 | FlowRouter.go '/assets/edit-classification' 20 | 'click .viewAssetClassification .btnCopy': -> 21 | if (Session.get('currentClassID').toString() == '#') 22 | alert 'No classification selected!' 23 | else 24 | FlowRouter.go '/assets/duplicate-classification' 25 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/viewAssetClass.jade: -------------------------------------------------------------------------------- 1 | template(name='viewAssetClassificationPage') 2 | if customTemplate 3 | +viewAssetClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +viewClassificationPage classDoc=viewDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/viewAssetClasses.coffee: -------------------------------------------------------------------------------- 1 | Template.viewAssetClassificationsPage.onCreated -> 2 | # Set Navbar so Assets highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(0).addClass 'active' 5 | Session.set 'treeviewData', 'asset-classification' 6 | 7 | Template.viewAssetClassificationsPage.onRendered -> 8 | $(".dropdown-button").dropdown() 9 | $('.tooltipped').tooltip {delay: 50} 10 | 11 | Template.viewAssetClassificationsPage.onDestroyed -> 12 | $('.tooltipped').tooltip 'remove' 13 | 14 | Template.viewAssetClassificationsPage.helpers 15 | customTemplate: -> Customisations.viewAssetClassifications 16 | classificationDetails: -> Classification.findOne {_id: Session.get('currentClassID').toString() } 17 | -------------------------------------------------------------------------------- /client/templates/application/assets/classifications/viewAssetClasses.jade: -------------------------------------------------------------------------------- 1 | template(name='viewAssetClassificationsPage') 2 | if customTemplate 3 | +viewAssetClassificationsPageCustom 4 | else 5 | .container 6 | .row 7 | div.viewClassifications 8 | // template located in layouts folder 9 | +viewClassificationsPage type='assets' 10 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 11 | -------------------------------------------------------------------------------- /client/templates/application/assets/meters/createMeter.coffee: -------------------------------------------------------------------------------- 1 | Template.createMeterPage.onCreated -> 2 | self = this 3 | self.autorun -> self.subscribe 'singleLocation', (Session.get('currentID').toString()) 4 | 5 | Template.createMeterPage.onRendered -> 6 | $(".dropdown-button").dropdown() 7 | $('.tooltipped').tooltip {delay: 50} 8 | 9 | Template.createMeterPage.onDestroyed -> 10 | $('.tooltipped').tooltip 'remove' 11 | 12 | Template.createMeterPage.helpers 13 | customTemplate: -> Customisations.createMeter 14 | currentDoc: -> 15 | Collections.Locations.Current = Locations.findOne {'id':Session.get('currentID').toString()} 16 | return Collections.Locations.Current 17 | 18 | Template.createMeterPage.events 19 | 'click .createMeter .btnSubmit': -> 20 | doc = Collections.Locations.Current 21 | meter = 22 | text: $('#inpCreateMeterPageTitle').val() 23 | id: $('#inpCreateMeterPageID').val() 24 | units: $('#inpCreateMeterPageUnits').val() 25 | reading: $('#inpCreateMeterPageReading').val() 26 | Meteor.call 'createMeter', doc, meter, (error, result) -> 27 | if error 28 | toast 'error', error 29 | else 30 | toast 'success', result 31 | return 32 | FlowRouter.go history.back() 33 | -------------------------------------------------------------------------------- /client/templates/application/assets/meters/createMeter.jade: -------------------------------------------------------------------------------- 1 | template(name='createMeterPage') 2 | if customTemplate 3 | +createMeterPageCustom 4 | else 5 | .flow-text 6 | if Template.subscriptionsReady 7 | br 8 | fieldset.createMeter 9 | legend Create Meter for 10 | =currentDoc.text 11 | | (id: 12 | =currentDoc.id 13 | |) 14 | form.new-record 15 | br 16 | .row 17 | .input-field.col.s12.m6.l3 18 | input#inpCreateMeterPageTitle.validate(placeholder='Give your meter a name', type='text', required='') 19 | label.active(for='inpCreateMeterPageTitle') Title 20 | .input-field.col.s12.m6.l3 21 | input#inpCreateMeterPageID.validate(placeholder='Give your meter an ID', type='text', required='') 22 | label.active(for='inpCreateMeterPageID') Meter ID 23 | .input-field.col.s12.m6.l3 24 | input#inpCreateMeterPageReading.validate(placeholder='Current meter value', type='number', value='0', required='') 25 | label.active(for='inpCreateMeterPageReading') Meter Reading 26 | .input-field.col.s12.m6.l3 27 | input#inpCreateMeterPageUnits.validate(placeholder='Measurement units', type='text', required='') 28 | label.active(for='inpCreateMeterPageUnits') Units 29 | br 30 | .row 31 | button.btn.waves-effect.waves-light.btnSubmit(type='button') 32 | i.fa.fa-tachometer 33 | | Create 34 | a(href="{{pathFor '../assets/view-locations'}}") 35 | button.btn.waves-effect.waves-light.tooltipped.red(type='button', data-delay='50', data-position='left', data-tooltip='Go back') 36 | i.material-icons skip_previous 37 | | Cancel 38 | else 39 | +spinner 40 | br 41 | -------------------------------------------------------------------------------- /client/templates/application/assets/meters/viewMeters.coffee: -------------------------------------------------------------------------------- 1 | Template.viewMetersPage.onCreated -> 2 | self = this; 3 | self.autorun -> 4 | self.subscribe 'singleLocation', (Session.get('currentID').toString()) 5 | 6 | Template.viewMetersPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.viewMetersPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.viewMetersPage.helpers 14 | customTemplate: -> Customisations.viewMeters 15 | currentDoc: -> 16 | Collections.Locations.Current = Locations.findOne {'id':Session.get('currentID').toString()} 17 | return Collections.Locations.Current 18 | 19 | Template.viewMetersPage.events 20 | 'click .btnEach': (event) -> 21 | Collections.Locations.Current.meter = this 22 | $('#viewMetersPageModal1').openModal() 23 | 24 | 'click .btnEach2': (event) -> 25 | Collections.Locations.Current.meter = this 26 | $('#viewMetersPageModal2').openModal() 27 | 28 | 'click #viewMetersPageModal1 button': (event) -> 29 | doc = Collections.Locations.Current 30 | temp = $('#viewMetersPageModal1 input').val() 31 | TempArray = [] 32 | tempArray = doc.meters 33 | Collections.Locations.Current.meter.reading = temp 34 | # find index of meter in array 35 | for a in [0...doc.meters.length] 36 | if (doc.meters[a].id == Collections.Locations.Current.meter.id) 37 | meterIndex = a 38 | break 39 | Meteor.call 'updateMeter', doc._id, meterIndex, temp, (error, result) -> 40 | if error 41 | toast 'error', error 42 | else 43 | toast 'success', result 44 | return 45 | 46 | 'click #viewMetersPageModal2 button': (event) -> 47 | doc = Collections.Locations.Current 48 | # find index of meter in array 49 | for a in [0...doc.meters.length] 50 | if (doc.meters[a].id == Collections.Locations.Current.meter.id) 51 | meterIndex = a 52 | break 53 | Meteor.call 'deleteMeter', doc._id, meterIndex, (error, result) -> 54 | if error 55 | toast 'error', error 56 | else 57 | toast 'success', result 58 | return 59 | -------------------------------------------------------------------------------- /client/templates/application/custom/aConfig/index.coffee: -------------------------------------------------------------------------------- 1 | Customisations = { 2 | # This is where you tell the application you will using a custom template 3 | # Create the template in templates/application/custom/ 4 | # Then set the Customisations object key to true 5 | # 6 | #eg for a custom createAsset template set: 7 | #createAsset: true 8 | } 9 | -------------------------------------------------------------------------------- /client/templates/application/custom/assets/assets.jade: -------------------------------------------------------------------------------- 1 | // Example custom template 2 | template(name='assetsPageCustom') 3 | .container 4 | h1.icon-page.hide-on-small-only Custom Assets Page 5 | br 6 | .row.center-align 7 | .col.s6.m4.l3 8 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "assets/view-locations"}}') 9 | i.fa-5x.fa.fa-gears 10 | br 11 | br 12 | | Assets & Locations 13 | br 14 | br 15 | -------------------------------------------------------------------------------- /client/templates/application/custom/readme.txt: -------------------------------------------------------------------------------- 1 | User customized templates. 2 | -------------------------------------------------------------------------------- /client/templates/application/help/help.coffee: -------------------------------------------------------------------------------- 1 | Template.helpPage.onCreated -> 2 | # Set Navbar so Help highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(7).addClass 'active' 5 | 6 | Template.helpPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.helpPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.helpPage.helpers 14 | customTemplate: -> Customisations.help 15 | -------------------------------------------------------------------------------- /client/templates/application/help/help.jade: -------------------------------------------------------------------------------- 1 | template(name='helpPage') 2 | if customTemplate 3 | +helpPageCustom 4 | else 5 | .container 6 | h1 Help 7 | br 8 | br 9 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/createEquipment.coffee: -------------------------------------------------------------------------------- 1 | Template.createEquipmentPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.createEquipmentPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.createEquipmentPage.helpers 9 | parentID: -> Session.get('currentID').toString() 10 | children: -> [] 11 | equipmentFormSchema: -> Schema.equipment 12 | customTemplate: -> Customisations.createEquipment 13 | ClassID: -> Session.get 'currentClassID' 14 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 15 | 16 | Template.createEquipmentPage.events 17 | 'click .firstRow .btnAdd': (event, template) -> 18 | MaterializeModal.confirm 19 | title: 'Select Equipment Classification' 20 | bodyTemplate: "createEquipmentAddEquipmentClass" 21 | 22 | Template.createEquipmentAddEquipmentClass.onRendered -> 23 | tempData = Classification.find(type: 'equipment-classification').fetch() 24 | dataTree(tempData, 'classification') 25 | 26 | Template.createEquipmentAddEquipmentClass.helpers 27 | classificationDetails: -> Classification.findOne(_id: Session.get('currentClassID').toString()) 28 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/createEquipment.jade: -------------------------------------------------------------------------------- 1 | template(name='createEquipmentPage') 2 | if customTemplate 3 | +createEquipmentPageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=equipmentFormSchema id='createEquipmentPage' type='method' meteormethod='createEquipment' 8 | fieldset 9 | legend New Equipment 10 | .row.firstRow 11 | +afQuickField name='id' type='hidden' 12 | +afQuickField name='parent' value=parentID defaultValue='#' type='hidden' 13 | .col.s12.m6.l3 14 | +afQuickField name='referenceID' 15 | .col.s12.m6.l3 16 | +afQuickField name='stockUnits' 17 | +smlField item=txtClassificationID label='Equipment Classification' 18 | +afQuickField name='classificationID' value=equipmentClassID type='hidden' 19 | +frmBtnAdd label='Add' 20 | .col.s12.m6.l3 21 | +afQuickField name='status' 22 | .row 23 | div 24 | +afQuickField name='text' 25 | div 26 | +afQuickField name='description' 27 | +fabBackResetSubmit 28 | br 29 | 30 | template(name='createEquipmentAddEquipmentClass') 31 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 32 | 33 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/createEquipmentClass.coffee: -------------------------------------------------------------------------------- 1 | Template.createEquipmentClassificationPage.helpers 2 | customTemplate: -> Customisations.createEquipmentClassification 3 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/createEquipmentClass.jade: -------------------------------------------------------------------------------- 1 | template(name='createEquipmentClassificationPage') 2 | if customTemplate 3 | +createEquipmentClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +createClassificationPage classificationType='equipment-classification' 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/deleteEquipmentClass.coffee: -------------------------------------------------------------------------------- 1 | Template.deleteEquipmentClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.deleteEquipmentClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.deleteEquipmentClassificationPage.helpers 9 | customTemplate: -> Customisations.deleteEquipmentClassification 10 | textDoc: -> Classification.findOne({'id':Session.get('currentClassID').toString()}).text 11 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/deleteEquipmentClass.jade: -------------------------------------------------------------------------------- 1 | template(name='deleteEquipmentClassificationPage') 2 | if customTemplate 3 | +deleteEquipmentClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +deleteClassificationPage doc=textDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/editEquipment.coffee: -------------------------------------------------------------------------------- 1 | Template.editEquipmentPage.onCreated -> 2 | this.assetClassID = new ReactiveVar 3 | 4 | Template.editEquipmentPage.onRendered -> 5 | $(".dropdown-button").dropdown() 6 | $('.tooltipped').tooltip {delay: 50} 7 | 8 | Template.editEquipmentPage.onDestroyed -> 9 | $('.tooltipped').tooltip 'remove' 10 | 11 | Template.editEquipmentPage.helpers 12 | parentID: -> Collections.Equipment.Current.parent 13 | equipmentFormSchema: -> Schema.equipment 14 | customTemplate: -> Customisations.editEquipment 15 | currentDoc: -> Session.get 'currentDoc' 16 | equipmentClassID: -> Session.get 'currentClassID' 17 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 18 | 19 | Template.editEquipmentPage.events 20 | 'click .firstRow .btnAdd': (event, template) -> 21 | MaterializeModal.confirm 22 | title: 'Select Asset Classification' 23 | bodyTemplate: "modaleditEquipmentPage" 24 | 25 | #------------------- Modal ------------------------------------- 26 | 27 | Template.modaleditEquipmentPage.onRendered -> 28 | tempData = Classification.find(type: 'equipment-classification').fetch() 29 | dataTree(tempData, 'classification') 30 | 31 | Template.modaleditEquipmentPage.helpers 32 | classificationDetails: -> Classification.findOne {_id:Session.get 'currentClassID'} 33 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/editEquipment.jade: -------------------------------------------------------------------------------- 1 | template(name='editEquipmentPage') 2 | if customTemplate 3 | +editEquipmentPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset.active 8 | legend Edit Equipment 9 | +autoForm schema=equipmentFormSchema id="editEquipmentPage" type="update" collection="Equipment" doc=currentDoc 10 | if Template.subscriptionsReady 11 | .row.firstRow 12 | .col.s12.m6.l3 13 | +afQuickField name='referenceID' 14 | .col.s12.m6.l3 15 | +afQuickField name='stockUnits' 16 | +smlField item=txtClassificationID label='Equipment Classification' 17 | +afQuickField name='classificationID' value=equipmentClassID type='hidden' 18 | +frmBtnAdd label='Add' 19 | .col.s12.m6.l3 20 | +afQuickField name='status' 21 | .row 22 | div 23 | +afQuickField name='text' 24 | div 25 | +afQuickField name='description' 26 | else 27 | +spinner 28 | +fabBackResetSubmit 29 | 30 | template(name='modaleditEquipmentPage') 31 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 32 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/editEquipmentClass.coffee: -------------------------------------------------------------------------------- 1 | Template.editEquipmentClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editEquipmentClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editEquipmentClassificationPage.helpers 9 | customTemplate: -> Customisations.editEquipmentClassification # user customised template if applicable 10 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/editEquipmentClass.jade: -------------------------------------------------------------------------------- 1 | template(name='editEquipmentClassificationPage') 2 | if customTemplate 3 | +editEquipmentClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +editClassificationPage 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/viewEquipment.coffee: -------------------------------------------------------------------------------- 1 | Template.viewEquipmentPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewEquipmentPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewEquipmentPage.helpers 9 | customTemplate: -> Customisations.viewEquipment 10 | currentDoc: -> Session.get 'currentDoc' 11 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 12 | 13 | Template.viewEquipmentPage.events 14 | 'click .viewEquipment .btnEdit': -> 15 | if (Session.get('currentID').toString() == '#') 16 | alert 'No item selected!' 17 | else 18 | FlowRouter.go '/items/edit-equipment' 19 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/viewEquipment.jade: -------------------------------------------------------------------------------- 1 | template(name='viewEquipmentPage') 2 | if customTemplate 3 | +viewEquipmentPageCustom 4 | else 5 | .flow-text.container2.viewEquipment 6 | +fabBackCopyEdit 7 | br 8 | fieldset 9 | legend View Equipment 10 | if Template.subscriptionsReady 11 | .row 12 | +smlField item=currentDoc._id label='System ID' 13 | +smlField item=currentDoc.referenceID label='Reference ID' 14 | +smlField item=currentDoc.stockUnits label='Units' 15 | +smlField item=currentDoc.status label='Status' 16 | +smlField item=txtClassificationID label='Equipment Classification' 17 | +lgeField item=currentDoc.text label='Title' 18 | +lgeField item=currentDoc.description label='Description' 19 | else 20 | +spinner 21 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/viewEquipmentClass.coffee: -------------------------------------------------------------------------------- 1 | Template.viewEquipmentClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewEquipmentClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewEquipmentClassificationPage.helpers 9 | customTemplate: -> Customisations.viewEquipmentClassification 10 | viewDoc: -> 11 | Collections.Classification.Current = Classification.findOne {'id':Session.get('currentClassID').toString()} 12 | return Collections.Classification.Current 13 | 14 | Template.viewEquipmentClassificationPage.events 15 | 'click .viewEquipmentClassification .btnEdit': -> 16 | if (Session.get('currentClassID').toString() == '#') 17 | alert 'No classification selected!' 18 | else 19 | FlowRouter.go '/inventory/equipment/edit-classification' 20 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/viewEquipmentClass.jade: -------------------------------------------------------------------------------- 1 | template(name='viewEquipmentClassificationPage') 2 | if customTemplate 3 | +viewEquipmentClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +viewClassificationPage classDoc=viewDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/viewEquipmentClasses.coffee: -------------------------------------------------------------------------------- 1 | Template.viewEquipmentClassificationsPage.onCreated -> 2 | # Set Navbar so Resources highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(0).addClass 'active' 5 | Session.set 'treeviewData', 'equipment-classification' 6 | 7 | Template.viewEquipmentClassificationsPage.onRendered -> 8 | $(".dropdown-button").dropdown() 9 | $('.tooltipped').tooltip {delay: 50} 10 | 11 | Template.viewEquipmentClassificationsPage.onDestroyed -> 12 | $('.tooltipped').tooltip 'remove' 13 | 14 | Template.viewEquipmentClassificationsPage.helpers 15 | customTemplate: -> Customisations.viewEquipmentClassifications 16 | classificationDetails: -> Classification.findOne {_id: Session.get('currentClassID').toString() } 17 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/viewEquipmentClasses.jade: -------------------------------------------------------------------------------- 1 | template(name='viewEquipmentClassificationsPage') 2 | if customTemplate 3 | +viewEquipmentClassificationsPageCustom 4 | else 5 | .container 6 | .row 7 | div.viewClassifications 8 | // template located in layouts folder 9 | +viewClassificationsPage type='inventory/equipment' 10 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 11 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/viewEquipments.coffee: -------------------------------------------------------------------------------- 1 | Template.viewEquipmentsPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewEquipmentsPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewEquipmentsPage.helpers 9 | customTemplate: -> Customisations.viewEquipments 10 | rtCollection: -> Equipment 11 | settings: -> { 12 | rowsPerPage: 10 13 | showFilter: true 14 | fields: [ 15 | { key: '_id', label: ' System ID' } 16 | { key: 'supplier_id', label: ' Supplier ID' } 17 | { key: 'equipmentID', label: ' Equipment ID' } 18 | { key: 'type', label: ' Type' } 19 | { key: 'referenceID', label: ' Reference ID' } 20 | { key: 'text', label: ' Title' } 21 | { key: 'description', label: ' Description' } 22 | { key: '', label: 'View/Edit/Delete', tmpl: Template.rtViewEditDelete } 23 | ] 24 | } 25 | 26 | Template.viewEquipmentsPage.events 27 | 'click .viewEquipments .btnView': (event) -> 28 | Session.set 'currentDoc', Equipment.findOne {_id: this._id} 29 | Session.set 'currentClassID', '' 30 | FlowRouter.go '/inventory/Equipment/view-equipment' 31 | 32 | 'click .viewEquipments .btnEdit': (event) -> 33 | Session.set 'currentDoc', Equipment.findOne {_id: this._id} 34 | Session.set 'currentClassID', '' 35 | FlowRouter.go '/inventory/equipment/edit-equipment' 36 | 37 | 'click .viewEquipments .btnDelete': (event) -> 38 | Collections.Equipment.CurrentID = this._id 39 | MaterializeModal.display 40 | bodyTemplate: 'viewEquipmentsDelete' 41 | title: 'Delete equipment!' 42 | submitLabel: 'Delete' 43 | closeLabel: 'Cancel' 44 | callback: (error, response) -> 45 | if error 46 | console.error error 47 | else 48 | if response.submit 49 | Meteor.call 'deleteEquipment', Collections.Equipment.CurrentID, (error, result) -> 50 | if error 51 | toast 'error', error 52 | else 53 | toast 'success', result 54 | return 55 | return 56 | -------------------------------------------------------------------------------- /client/templates/application/inventory/equipment/viewEquipments.jade: -------------------------------------------------------------------------------- 1 | template(name='viewEquipmentsPage') 2 | if customTemplate 3 | +viewEquipmentsPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset.viewEquipments 8 | legend View Equipment 9 | a(href='{{pathFor "create-equipment"}}') 10 | button.btn-floating.waves-effect.waves-light.tooltipped(type='button', data-delay='50', data-position='bottom', data-tooltip='Create Equipment') 11 | i.fa.fa-plus 12 | .row 13 | if Template.subscriptionsReady 14 | +reactiveTable collection=rtCollection settings=settings class='table striped' 15 | else 16 | +spinner 17 | +fabBack 18 | 19 | template(name='viewEquipmentsDelete') 20 | h5.red-text Warning this will permanently delete the equipment! 21 | | This process cannot be undone. 22 | -------------------------------------------------------------------------------- /client/templates/application/inventory/inventory.coffee: -------------------------------------------------------------------------------- 1 | Template.inventoryPage.onCreated -> 2 | # Set Navbar so Inventory highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(4).addClass 'active' 5 | 6 | Template.inventoryPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.inventoryPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.inventoryPage.helpers 14 | customTemplate: -> Customisations.inventory 15 | 16 | Template.inventoryPage.events 17 | 'click .btnViewItemsClassifications': (event) -> 18 | FlowRouter.go '/inventory/item/view-classifications' 19 | 'click .btnViewEquipmentClassifications': (event) -> 20 | FlowRouter.go '/inventory/equipment/view-classifications' 21 | 'click .btnViewLocationClassifications': (event) -> 22 | FlowRouter.go '/inventory/locations/view-classifications' 23 | 'click .btnViewItems': (event) -> 24 | FlowRouter.go '/inventory/items/view-items' 25 | 'click .btnViewEquipment': (event) -> 26 | FlowRouter.go '/inventory/equipment/view-equipments' 27 | 'click .btnViewLocations': (event) -> 28 | FlowRouter.go '/inventory/locations/view-locations' 29 | -------------------------------------------------------------------------------- /client/templates/application/inventory/inventory.jade: -------------------------------------------------------------------------------- 1 | template(name='inventoryPage') 2 | if customTemplate 3 | +inventoryPageCustom 4 | else 5 | .container 6 | h1.icon-page Inventory 7 | .row.flow-text.center-align 8 | .col.s12.m6.l3 9 | a.btnViewItems.waves-effect.waves-dark.icon-page 10 | i.fa-5x.fa.fa-cube 11 | br 12 | br 13 | | Items 14 | br 15 | br 16 | .col.s12.m6.l3 17 | a.btnViewItemsClassifications.waves-effect.waves-dark.icon-page 18 | i.fa-5x.fa.fa-file-o 19 | br 20 | br 21 | | Item Classification 22 | br 23 | br 24 | .col.s12.m6.l3 25 | a.btnViewEquipment.waves-effect.waves-dark.icon-page 26 | i.fa-5x.fa.fa-wrench 27 | br 28 | br 29 | | Equipment 30 | br 31 | br 32 | .col.s12.m6.l3 33 | a.btnViewEquipmentClassifications.waves-effect.waves-dark.icon-page 34 | i.fa-5x.fa.fa-file-o 35 | br 36 | br 37 | | Equipment Classification 38 | br 39 | br 40 | .col.s12.m6.l3 41 | a.btnViewLocations.waves-effect.waves-dark.icon-page 42 | i.fa-5x.fa.fa-cubes 43 | br 44 | br 45 | | Inventory Locations 46 | br 47 | br 48 | .col.s12.m6.l3 49 | a.btnViewLocationClassifications.waves-effect.waves-dark.icon-page 50 | i.fa-5x.fa.fa-file-o 51 | br 52 | br 53 | | Inventory Location Classification 54 | br 55 | br 56 | .col.s12.m6.l3 57 | a.btnViewBOM.waves-effect.waves-dark.icon-page 58 | i.fa-5x.fa.fa-list-ul 59 | br 60 | br 61 | | Bill of Materials 62 | br 63 | br 64 | .col.s12.m6.l3 65 | a.btnViewSettings.waves-effect.waves-dark.icon-page 66 | i.fa-5x.fa.fa-calculator 67 | br 68 | br 69 | | Settings 70 | br 71 | br 72 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/createItem.coffee: -------------------------------------------------------------------------------- 1 | Template.createItemPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.createItemPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.createItemPage.helpers 9 | parentID: -> Session.get('currentID').toString() 10 | children: -> [] 11 | itemFormSchema: -> Schema.items 12 | customTemplate: -> Customisations.createItem 13 | itemClassID: -> Session.get 'currentClassID' 14 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 15 | 16 | Template.createItemPage.events 17 | 'click .firstRow .btnAdd': (event, template) -> 18 | MaterializeModal.confirm 19 | title: 'Select Item Classification' 20 | bodyTemplate: "createItemAddItemClass" 21 | 22 | Template.createItemAddItemClass.onRendered -> 23 | tempData = Classification.find(type: 'item-classification').fetch() 24 | dataTree(tempData, 'classification') 25 | 26 | Template.createItemAddItemClass.helpers 27 | classificationDetails: -> Classification.findOne(_id: Session.get('currentClassID').toString()) 28 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/createItem.jade: -------------------------------------------------------------------------------- 1 | template(name='createItemPage') 2 | if customTemplate 3 | +createItemPageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=itemFormSchema id='createItemPage' type='method' meteormethod='createItem' 8 | fieldset 9 | legend New Item 10 | .row.firstRow 11 | +afQuickField name='id' type='hidden' 12 | +afQuickField name='parent' value=parentID defaultValue='#' type='hidden' 13 | .col.s12.m6.l3 14 | +afQuickField name='referenceID' 15 | .col.s12.m6.l3 16 | +afQuickField name='stockUnits' 17 | +smlField item=txtClassificationID label='Item Classification' 18 | +afQuickField name='classificationID' value=itemClassID type='hidden' 19 | +frmBtnAdd label='Add' 20 | .col.s12.m6.l3 21 | +afQuickField name='status' 22 | .row 23 | div 24 | +afQuickField name='text' 25 | div 26 | +afQuickField name='description' 27 | +fabBackResetSubmit 28 | br 29 | 30 | template(name='createItemAddItemClass') 31 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 32 | 33 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/createItemClass.coffee: -------------------------------------------------------------------------------- 1 | Template.createItemClassificationPage.helpers 2 | customTemplate: -> Customisations.createItemClassification 3 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/createItemClass.jade: -------------------------------------------------------------------------------- 1 | template(name='createItemClassificationPage') 2 | if customTemplate 3 | +createItemClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +createClassificationPage classificationType='item-classification' 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/deleteItemClass.coffee: -------------------------------------------------------------------------------- 1 | Template.deleteItemClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.deleteItemClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.deleteItemClassificationPage.helpers 9 | customTemplate: -> Customisations.deleteItemClassification 10 | textDoc: -> Classification.findOne({'id':Session.get('currentClassID').toString()}).text 11 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/deleteItemClass.jade: -------------------------------------------------------------------------------- 1 | template(name='deleteItemClassificationPage') 2 | if customTemplate 3 | +deleteItemClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +deleteClassificationPage doc=textDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/editItem.coffee: -------------------------------------------------------------------------------- 1 | Template.editItemPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editItemPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editItemPage.helpers 9 | parentID: -> Collections.Items.Current.parent 10 | itemFormSchema: -> Schema.items 11 | customTemplate: -> Customisations.editItem 12 | currentDoc: -> Session.get 'currentDoc' 13 | itemClassID: -> Session.get 'currentClassID' 14 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 15 | 16 | Template.editItemPage.events 17 | 'click .firstRow .btnAdd': (event, template) -> 18 | MaterializeModal.confirm 19 | title: 'Select Asset Classification' 20 | bodyTemplate: "modaleditItemPage" 21 | 22 | #------------------- Modal ------------------------------------- 23 | 24 | Template.modaleditItemPage.onRendered -> 25 | tempData = Classification.find(type: 'item-classification').fetch() 26 | dataTree(tempData, 'classification') 27 | 28 | Template.modaleditItemPage.helpers 29 | classificationDetails: -> Classification.findOne {_id:Session.get 'currentClassID'} 30 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/editItem.jade: -------------------------------------------------------------------------------- 1 | template(name='editItemPage') 2 | if customTemplate 3 | +editItemPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset.active 8 | legend Edit Item 9 | +autoForm schema=itemFormSchema id="editItemPage" type="update" collection="Items" doc=currentDoc 10 | if Template.subscriptionsReady 11 | .row.firstRow 12 | .col.s12.m6.l3 13 | +afQuickField name='referenceID' 14 | .col.s12.m6.l3 15 | +afQuickField name='stockUnits' 16 | +smlField item=txtClassificationID label='Item Classification' 17 | +afQuickField name='classificationID' value=itemClassID type='hidden' 18 | +frmBtnAdd label='Add' 19 | .col.s12.m6.l3 20 | +afQuickField name='status' 21 | .row 22 | div 23 | +afQuickField name='text' 24 | div 25 | +afQuickField name='description' 26 | else 27 | +spinner 28 | +fabBackResetSubmit 29 | 30 | template(name='modaleditItemPage') 31 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 32 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/editItemClass.coffee: -------------------------------------------------------------------------------- 1 | Template.editItemClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editItemClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editItemClassificationPage.helpers 9 | customTemplate: -> Customisations.editItemClassification # user customised template if applicable 10 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/editItemClass.jade: -------------------------------------------------------------------------------- 1 | template(name='editItemClassificationPage') 2 | if customTemplate 3 | +editItemClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +editClassificationPage 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/viewItem.coffee: -------------------------------------------------------------------------------- 1 | Template.viewItemPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewItemPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewItemPage.helpers 9 | customTemplate: -> Customisations.viewItem 10 | currentDoc: -> Session.get 'currentDoc' 11 | txtClassificationID: -> Classification.findOne(_id: Session.get('currentDoc').classificationID ).text 12 | 13 | Template.viewItemPage.events 14 | 'click .viewItem .btnEdit': -> 15 | if (Session.get('currentID').toString() == '#') 16 | alert 'No item selected!' 17 | else 18 | FlowRouter.go '/items/edit-item' 19 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/viewItem.jade: -------------------------------------------------------------------------------- 1 | template(name='viewItemPage') 2 | if customTemplate 3 | +viewItemPageCustom 4 | else 5 | .flow-text.container2.viewItem 6 | +fabBackCopyEdit 7 | br 8 | fieldset 9 | legend View Item 10 | if Template.subscriptionsReady 11 | .row 12 | +smlField item=currentDoc._id label='System ID' 13 | +smlField item=currentDoc.referenceID label='Reference ID' 14 | +smlField item=currentDoc.stockUnits label='Units' 15 | +smlField item=currentDoc.status label='Status' 16 | +smlField item=txtClassificationID label='Item Classification' 17 | +lgeField item=currentDoc.text label='Title' 18 | +lgeField item=currentDoc.description label='Description' 19 | else 20 | +spinner 21 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/viewItemClass.coffee: -------------------------------------------------------------------------------- 1 | Template.viewItemClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewItemClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewItemClassificationPage.helpers 9 | customTemplate: -> Customisations.viewItemClassification 10 | viewDoc: -> 11 | Collections.Classification.Current = Classification.findOne {'id':Session.get('currentClassID').toString()} 12 | return Collections.Classification.Current 13 | 14 | Template.viewItemClassificationPage.events 15 | 'click .viewItemClassification .btnEdit': -> 16 | if (Session.get('currentClassID').toString() == '#') 17 | alert 'No classification selected!' 18 | else 19 | FlowRouter.go '/inventory/item/edit-classification' 20 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/viewItemClass.jade: -------------------------------------------------------------------------------- 1 | template(name='viewItemClassificationPage') 2 | if customTemplate 3 | +viewItemClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +viewClassificationPage classDoc=viewDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/viewItemClasses.coffee: -------------------------------------------------------------------------------- 1 | Template.viewItemClassificationsPage.onCreated -> 2 | # Set Navbar so Resources highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(0).addClass 'active' 5 | Session.set 'treeviewData', 'item-classification' 6 | 7 | Template.viewItemClassificationsPage.onRendered -> 8 | $(".dropdown-button").dropdown() 9 | $('.tooltipped').tooltip {delay: 50} 10 | 11 | Template.viewItemClassificationsPage.onDestroyed -> 12 | $('.tooltipped').tooltip 'remove' 13 | 14 | Template.viewItemClassificationsPage.helpers 15 | customTemplate: -> Customisations.viewItemClassifications 16 | classificationDetails: -> Classification.findOne {_id: Session.get('currentClassID').toString() } 17 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/viewItemClasses.jade: -------------------------------------------------------------------------------- 1 | template(name='viewItemClassificationsPage') 2 | if customTemplate 3 | +viewItemClassificationsPageCustom 4 | else 5 | .container 6 | .row 7 | div.viewClassifications 8 | // template located in layouts folder 9 | +viewClassificationsPage type='inventory/item' 10 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 11 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/viewItems.coffee: -------------------------------------------------------------------------------- 1 | Template.viewItemsPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewItemsPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewItemsPage.helpers 9 | customTemplate: -> Customisations.viewItems 10 | rtCollection: -> Items 11 | settings: -> { 12 | rowsPerPage: 10 13 | showFilter: true 14 | fields: [ 15 | { key: '_id', label: ' System ID' } 16 | { key: 'supplier_id', label: ' Supplier ID' } 17 | { key: 'itemID', label: ' Item ID' } 18 | { key: 'type', label: ' Type' } 19 | { key: 'referenceID', label: ' Reference ID' } 20 | { key: 'text', label: ' Title' } 21 | { key: 'description', label: ' Description' } 22 | { key: '', label: 'View/Edit/Delete', tmpl: Template.rtViewEditDelete } 23 | ] 24 | } 25 | 26 | Template.viewItemsPage.events 27 | 'click .viewItems .btnView': (event) -> 28 | Session.set 'currentDoc', Items.findOne {_id: this._id} 29 | Session.set 'currentClassID', '' 30 | FlowRouter.go '/inventory/items/view-item' 31 | 32 | 'click .viewItems .btnEdit': (event) -> 33 | Session.set 'currentDoc', Items.findOne {_id: this._id} 34 | Session.set 'currentClassID', '' 35 | FlowRouter.go '/inventory/items/edit-item' 36 | 37 | 'click .viewItems .btnDelete': (event) -> 38 | Collections.Items.CurrentID = this._id 39 | MaterializeModal.display 40 | bodyTemplate: 'viewItemsDelete' 41 | title: 'Delete Item!' 42 | submitLabel: 'Delete' 43 | closeLabel: 'Cancel' 44 | callback: (error, response) -> 45 | if error 46 | console.error error 47 | else 48 | if response.submit 49 | Meteor.call 'deleteItem', Collections.Items.CurrentID, (error, result) -> 50 | if error 51 | toast 'error', error 52 | else 53 | toast 'success', result 54 | return 55 | return 56 | -------------------------------------------------------------------------------- /client/templates/application/inventory/item/viewItems.jade: -------------------------------------------------------------------------------- 1 | template(name='viewItemsPage') 2 | if customTemplate 3 | +viewItemsPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset.viewItems 8 | legend View Items 9 | a(href='{{pathFor "create-item"}}') 10 | button.btn-floating.waves-effect.waves-light.tooltipped(type='button', data-delay='50', data-position='bottom', data-tooltip='Create Item') 11 | i.fa.fa-plus 12 | .row 13 | if Template.subscriptionsReady 14 | +reactiveTable collection=rtCollection settings=settings class='table striped' 15 | else 16 | +spinner 17 | +fabBack 18 | 19 | template(name='viewItemsDelete') 20 | h5.red-text Warning this will permanently delete the item! 21 | | This process cannot be undone. 22 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/createInvLoc.coffee: -------------------------------------------------------------------------------- 1 | Template.createInvLocPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.createInvLocPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.createInvLocPage.helpers 9 | parentID: -> Session.get('currentID').toString() 10 | children: -> [] 11 | formSchema: -> Schema.bins 12 | customTemplate: -> Customisations.createInvLoc 13 | classID: -> Session.get 'currentClassID' 14 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 15 | 16 | Template.createInvLocPage.events 17 | 'click .firstRow .btnAdd': (event, template) -> 18 | MaterializeModal.confirm 19 | title: 'Select Inventory Location Classification' 20 | bodyTemplate: "createInvLocModal" 21 | 22 | Template.createInvLocModal.onRendered -> 23 | tempData = Classification.find(type: 'invloc-classification').fetch() 24 | dataTree(tempData, 'classification') 25 | 26 | Template.createInvLocModal.helpers 27 | classificationDetails: -> Classification.findOne(_id: Session.get('currentClassID').toString()) 28 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/createInvLoc.jade: -------------------------------------------------------------------------------- 1 | template(name='createInvLocPage') 2 | if customTemplate 3 | +createInvLocPageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=formSchema id='createInvLocPage' type='method' meteormethod='createInvLoc' 8 | fieldset 9 | legend New Inventory Location 10 | .row.firstRow 11 | +afQuickField name='id' type='hidden' 12 | +afQuickField name='parent' value=parentID defaultValue='#' type='hidden' 13 | .col.s12.m6.l3 14 | +afQuickField name='referenceID' 15 | .col.s12.m6.l3 16 | +afQuickField name='type' 17 | .col.s12.m6.l3 18 | +afQuickField name='status' 19 | +afQuickField name='classificationID' value=classID type='hidden' 20 | +smlField item=txtClassificationID label='Inventory Location Classification' 21 | +frmBtnAdd label='Add' 22 | .row 23 | div 24 | +afQuickField name='text' 25 | div 26 | +afQuickField name='description' 27 | +fabBackResetSubmit 28 | br 29 | 30 | template(name='createInvLocModal') 31 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 32 | 33 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/createInvLocClass.coffee: -------------------------------------------------------------------------------- 1 | Template.createInvLocClassificationPage.helpers 2 | customTemplate: -> Customisations.createInvLocClassification 3 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/createInvLocClass.jade: -------------------------------------------------------------------------------- 1 | template(name='createInvLocClassificationPage') 2 | if customTemplate 3 | +createInvLocClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +createClassificationPage classificationType='invloc-classification' 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/deleteInvLocClass.coffee: -------------------------------------------------------------------------------- 1 | Template.deleteInvLocClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.deleteInvLocClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.deleteInvLocClassificationPage.helpers 9 | customTemplate: -> Customisations.deleteInvLocClassification 10 | textDoc: -> Classification.findOne({'id':Session.get('currentClassID').toString()}).text 11 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/deleteInvLocClass.jade: -------------------------------------------------------------------------------- 1 | template(name='deleteInvLocClassificationPage') 2 | if customTemplate 3 | +deleteInvLocClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +deleteClassificationPage doc=textDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/editInvLoc.coffee: -------------------------------------------------------------------------------- 1 | Template.editInvLocPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | Session.set 'currentClassID', Collections.Bins.Current.classificationID 5 | 6 | Template.editInvLocPage.onDestroyed -> 7 | $('.tooltipped').tooltip 'remove' 8 | 9 | Template.editInvLocPage.helpers 10 | parentID: -> Session.get('currentID').toString() 11 | formSchema: -> Schema.bins 12 | customTemplate: -> Customisations.createInvLoc 13 | currentDoc: -> Collections.Bins.Current 14 | classID: -> Session.get 'currentClassID' 15 | txtClassificationID: -> Classification.findOne(_id: Session.get('currentClassID').toString()).text 16 | 17 | Template.editInvLocPage.events 18 | 'click .firstRow .btnAdd': (event, template) -> 19 | MaterializeModal.confirm 20 | title: 'Select Inventory Location Classification' 21 | bodyTemplate: "modaleditInvLocPage" 22 | 23 | #------------------- Modal ------------------------------------- 24 | 25 | Template.modaleditInvLocPage.onRendered -> 26 | tempData = Classification.find(type: 'invloc-classification').fetch() 27 | dataTree(tempData, 'classification') 28 | 29 | Template.modaleditInvLocPage.helpers 30 | classificationDetails: -> Classification.findOne {_id: Session.get('currentClassID').toString()} 31 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/editInvLoc.jade: -------------------------------------------------------------------------------- 1 | template(name='editInvLocPage') 2 | if customTemplate 3 | +editInvLocPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset.active 8 | legend Edit Inventory Location 9 | +autoForm schema=formSchema id="editInvLocPage" type="update" collection="Bins" doc=currentDoc 10 | if Template.subscriptionsReady 11 | .row.firstRow 12 | .col.s12.m6.l3 13 | +afQuickField name='referenceID' 14 | .col.s12.m6.l3 15 | +afQuickField name='status' 16 | .col.s12.m6.l3 17 | +afQuickField name='type' 18 | +smlField item=txtClassificationID label='Inventory Location Classification' 19 | +afQuickField name='classificationID' value=classID type='hidden' 20 | +frmBtnAdd label='Add' 21 | .row 22 | div 23 | +afQuickField name='text' 24 | div 25 | +afQuickField name='description' 26 | else 27 | +spinner 28 | +fabBackResetSubmit 29 | 30 | template(name='modaleditInvLocPage') 31 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 32 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/editInvLocClass.coffee: -------------------------------------------------------------------------------- 1 | Template.editInvLocClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editInvLocClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editInvLocClassificationPage.helpers 9 | customTemplate: -> Customisations.editInvLocClassification # user customised template if applicable 10 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/editInvLocClass.jade: -------------------------------------------------------------------------------- 1 | template(name='editInvLocClassificationPage') 2 | if customTemplate 3 | +editInvLocClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +editClassificationPage 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/stockLevels.jade: -------------------------------------------------------------------------------- 1 | template(name='stockLevelsPage') 2 | if customTemplate 3 | +stockLevelsPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset 8 | legend Inventory Levels 9 | .row 10 | .section.items 11 | if Template.subscriptionsReady 12 | +reactiveTable collection=inventoryItems settings=settings class='table striped' 13 | else 14 | +spinner 15 | +fabBackResetSubmit 16 | 17 | template(name='stockLevelsModal') 18 | .row 19 | .input-field.col.s12.m6.l3 20 | input#stockLevelsQty.validate(placeholder='Enter level', type='number' value=stockDetails.stockLevel) 21 | label.active(for='stockLevelsQty') New Stock Level 22 | .input-field.col.s12.m6.l3 23 | input#reorderLevelsQty.validate(placeholder='Enter level', type='number' value=stockDetails.reorderLevel) 24 | label.active(for='reorderLevelsQty') New Reorder Level 25 | .input-field.col.s12.m6.l3 26 | input#newOrderQty.validate(placeholder='Enter quantity', type='number' value=stockDetails.orderQuantity) 27 | label.active(for='newOrderQty') New Order Quantity 28 | 29 | template(name='stockMoveModal') 30 | .row 31 | .input-field.col.s12.m6.l3 32 | input#moveStockQty.validate(placeholder='Enter quantity to move', type='number' max=stockDetails.stockLevel min='0') 33 | label.active(for='moveStockQty') Qty Stock Moved 34 | .col.s12.m6.l9 35 | = invLocDetails.text 36 | +treeView nodeID=invLocDetails.invLocID nodeText=invLocDetails.text 37 | 38 | template(name='woIssueModal') 39 | .row 40 | .input-field.col.s12.m6.l3 41 | input#issueStockQty.validate(placeholder='Enter quantity to issue', type='number' max=stockDetails.stockLevel min='0') 42 | label.active(for='issueStockQty') Qty Stock Issued 43 | .col.s12.m6.l9 44 | = woDetails.text 45 | +reactiveTable collection='workorders-list' settings=settings class='table striped' 46 | 47 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/viewInvLoc.coffee: -------------------------------------------------------------------------------- 1 | Template.viewInvLocPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewInvLocPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewInvLocPage.helpers 9 | customTemplate: -> Customisations.viewInvLoc 10 | currentDoc: -> Collections.Bins.Current 11 | txtClassificationID: -> Classification.findOne(_id: Collections.Bins.Current.classificationID ).text 12 | 13 | Template.viewInvLocPage.events 14 | 'click .viewInvLoc .btnEdit': -> 15 | if (Session.get('currentID').toString() == '#') 16 | alert 'No item selected!' 17 | else 18 | FlowRouter.go '/inventory/locations/edit-location' 19 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/viewInvLoc.jade: -------------------------------------------------------------------------------- 1 | template(name='viewInvLocPage') 2 | if customTemplate 3 | +viewInvLocPageCustom 4 | else 5 | .flow-text.container2.viewInvLoc 6 | +fabBackCopyEdit 7 | br 8 | fieldset 9 | legend View Inventory Location 10 | if Template.subscriptionsReady 11 | .row 12 | +smlField item=currentDoc._id label='System ID' 13 | +smlField item=currentDoc.referenceID label='Reference ID' 14 | +smlField item=currentDoc.status label='Status' 15 | +smlField item=txtClassificationID label='Inventory Location Classification' 16 | +lgeField item=currentDoc.text label='Title' 17 | +lgeField item=currentDoc.description label='Description' 18 | else 19 | +spinner 20 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/viewInvLocClass.coffee: -------------------------------------------------------------------------------- 1 | Template.viewInvLocClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewInvLocClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewInvLocClassificationPage.helpers 9 | customTemplate: -> Customisations.viewInvLocClassification 10 | viewDoc: -> 11 | Collections.Classification.Current = Classification.findOne {'id':Session.get('currentClassID').toString()} 12 | return Collections.Classification.Current 13 | 14 | Template.viewInvLocClassificationPage.events 15 | 'click .viewInvLocClassification .btnEdit': -> 16 | if (Session.get('currentClassID').toString() == '#') 17 | alert 'No classification selected!' 18 | else 19 | FlowRouter.go '/inventory/locations/edit-classification' 20 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/viewInvLocClass.jade: -------------------------------------------------------------------------------- 1 | template(name='viewInvLocClassificationPage') 2 | if customTemplate 3 | +viewInvLocClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +viewClassificationPage classDoc=viewDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/viewInvLocClasses.coffee: -------------------------------------------------------------------------------- 1 | Template.viewInvLocClassificationsPage.onCreated -> 2 | # Set Navbar so Resources highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(0).addClass 'active' 5 | Session.set 'treeviewData', 'invloc-classification' 6 | 7 | Template.viewInvLocClassificationsPage.onRendered -> 8 | $(".dropdown-button").dropdown() 9 | $('.tooltipped').tooltip {delay: 50} 10 | 11 | Template.viewInvLocClassificationsPage.onDestroyed -> 12 | $('.tooltipped').tooltip 'remove' 13 | 14 | Template.viewInvLocClassificationsPage.helpers 15 | customTemplate: -> Customisations.viewInvLocClassifications 16 | classificationDetails: -> Classification.findOne {_id: Session.get('currentClassID').toString() } 17 | -------------------------------------------------------------------------------- /client/templates/application/inventory/locations/viewInvLocClasses.jade: -------------------------------------------------------------------------------- 1 | template(name='viewInvLocClassificationsPage') 2 | if customTemplate 3 | +viewInvLocClassificationsPageCustom 4 | else 5 | .container 6 | .row 7 | div.viewClassifications 8 | // template located in layouts folder 9 | +viewClassificationsPage type='inventory/locations' 10 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 11 | -------------------------------------------------------------------------------- /client/templates/application/pm/assetGroups.coffee: -------------------------------------------------------------------------------- 1 | Template.assetGroupsPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.assetGroupsPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.assetGroupsPage.helpers 9 | customTemplate: -> Customisations.assetGroups 10 | assetGroupsCollection: -> Assetgroups 11 | settings: -> 12 | return { 13 | rowsPerPage: 10 14 | showFilter: true 15 | fields: [ 16 | { key: '_id', label: ' System ID' } 17 | { key: 'groupCreatedBy', label: ' Created By' } 18 | { key: 'groupText', label: ' Title' } 19 | { key: '', label: 'View/Edit/Delete', tmpl: Template.rtViewEditDelete } 20 | ] 21 | } 22 | 23 | Template.assetGroupsPage.events 24 | 'click .assetGroups .btnView': (event) -> 25 | Collections.Assetgroups.Current = this 26 | Session.set 'currentDoc', this 27 | FlowRouter.go '/pm/view-group' 28 | 'click .assetGroups .btnEdit': (event) -> 29 | Collections.Assetgroups.Current = this 30 | Session.set 'currentDoc', this 31 | FlowRouter.go '/pm/edit-group' 32 | 'click .assetGroups .btnDelete': (event) -> 33 | Collections.Assetgroups.Current = this 34 | MaterializeModal.display 35 | bodyTemplate: 'assetGroupsDelete' 36 | title: 'Delete Asset Group!' 37 | submitLabel: 'Delete' 38 | closeLabel: 'Cancel' 39 | callback: (error, response) -> 40 | if error 41 | console.error error 42 | else 43 | if response.submit 44 | Meteor.call 'deleteAssetGroup', Collections.Assetgroups.Current._id, (error, result) -> 45 | if error 46 | toast 'error', error 47 | else 48 | toast 'success', result 49 | return 50 | return 51 | -------------------------------------------------------------------------------- /client/templates/application/pm/assetGroups.jade: -------------------------------------------------------------------------------- 1 | template(name='assetGroupsPage') 2 | if customTemplate 3 | +assetGroupsPageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.assetGroups 8 | legend Asset Groups 9 | a(href='{{pathFor "../pm/create-group"}}') 10 | button.btn-floating.btn-large.waves-effect.waves-light.tooltipped(type='button', data-position='bottom', data-delay='50', data-tooltip='Create new asset group') 11 | i.fa.fa-file-o 12 | if Template.subscriptionsReady 13 | +reactiveTable collection=assetGroupsCollection settings=settings class='table striped' 14 | +fabBack 15 | 16 | template(name='assetGroupsDelete') 17 | h5.red-text Warning this will permanently delete the Asset Group! 18 | | This process cannot be undone. 19 | -------------------------------------------------------------------------------- /client/templates/application/pm/createAssetGroup.coffee: -------------------------------------------------------------------------------- 1 | Template.createAssetGroupPage.onCreated -> 2 | this.assetArray = new ReactiveVar [] 3 | 4 | Template.createAssetGroupPage.onRendered -> 5 | $(".dropdown-button").dropdown() 6 | $('.tooltipped').tooltip {delay: 50} 7 | dataTree() 8 | 9 | Template.createAssetGroupPage.onDestroyed -> 10 | $('.tooltipped').tooltip 'remove' 11 | 12 | Template.createAssetGroupPage.helpers 13 | customTemplate: -> Customisations.createAssetGroup 14 | assetGroupSchema: -> Schema.assetGroup 15 | assetGroupCreatedBy: -> Meteor.userId() 16 | assetArray: -> Template.instance().assetArray.get() 17 | assetArrayDetails: -> 18 | tempArray=[] 19 | temp = Template.instance().assetArray.get() 20 | for a in [0...temp.length] 21 | tempArray[a] = Locations.findOne {'id':temp[a]} 22 | return tempArray 23 | assetDetails: -> Locations.findOne {'id':Session.get('currentID').toString()} 24 | settings: -> 25 | return { 26 | rowsPerPage: 10 27 | showFilter: true 28 | fields: [ 29 | { key: 'assetID', label: ' Asset ID' } 30 | { key: 'text', label: ' Asset Name' } 31 | { key: '', label: 'Delete', tmpl: Template.rtDelete } 32 | ] 33 | } 34 | 35 | Template.createAssetGroupPage.events 36 | 'click .createAssetGroup .btnAdd': (event, template) -> 37 | temp = template.assetArray.get() 38 | if temp.indexOf(Session.get('currentID').toString()) == -1 39 | temp.push Session.get('currentID').toString() 40 | template.assetArray.set temp 41 | toast 'success', 'Asset added' 42 | else 43 | toast 'error', 'Asset already added' 44 | 45 | 'click .createAssetGroup .btnDelete': (event, template) -> 46 | temp = template.assetArray.get() 47 | temp.splice(temp.indexOf(this._id), 1) 48 | template.assetArray.set temp 49 | toast 'success', 'Asset removed' 50 | -------------------------------------------------------------------------------- /client/templates/application/pm/createAssetGroup.jade: -------------------------------------------------------------------------------- 1 | template(name='createAssetGroupPage') 2 | if customTemplate 3 | +createAssetGroupPageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=assetGroupSchema id='createAssetGroupPage' type='method' meteormethod='createAssetGroup' 8 | fieldset.createAssetGroup 9 | legend New Asset Group 10 | .row 11 | +afQuickField name='groupText' 12 | .row 13 | .divider.teal 14 | .section 15 | h6.teal-text Asset 16 | .row 17 | +afQuickField name='asset_IDs' value=assetArray type='hidden' 18 | +afQuickField name='groupCreatedBy' value=assetGroupCreatedBy type='hidden' 19 | +reactiveTable collection=assetArrayDetails settings=settings class='table striped' 20 | +treeViewAdd treeData=assetDetails 21 | +fabBackResetSubmit 22 | -------------------------------------------------------------------------------- /client/templates/application/pm/editAssetGroup.coffee: -------------------------------------------------------------------------------- 1 | Template.editAssetGroupPage.onCreated -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singleAssetGroup', Session.get('currentDoc')._id.toString() 5 | this.assetArray = new ReactiveVar Assetgroups.findOne({_id: Session.get('currentDoc')._id.toString()}).asset_IDs 6 | 7 | Template.editAssetGroupPage.onRendered -> 8 | $(".dropdown-button").dropdown() 9 | dataTree() 10 | $('.tooltipped').tooltip {delay: 50} 11 | 12 | Template.editAssetGroupPage.onDestroyed -> 13 | $('.tooltipped').tooltip 'remove' 14 | 15 | Template.editAssetGroupPage.helpers 16 | customTemplate: -> Customisations.editAssetGroup 17 | assetGroupSchema: -> Schema.assetGroup 18 | viewDoc: -> Assetgroups.findOne({_id: Session.get('currentDoc')._id.toString()}) 19 | assetArray: -> Template.instance().assetArray.get() 20 | assetArrayDetails: -> 21 | tempArray=[] 22 | temp = Template.instance().assetArray.get() 23 | for a in [0...temp.length] 24 | tempArray[a] = Locations.findOne {'id':temp[a]} 25 | tempArray 26 | assetDetails: -> Locations.findOne {'id':Session.get('currentID').toString()} # ID of current asset/location not the current Asset Group 27 | settings: -> 28 | return { 29 | rowsPerPage: 10 30 | showFilter: true 31 | fields: [ 32 | { key: 'id', label: ' System ID' } 33 | { key: 'assetID', label: ' Asset ID' } 34 | { key: 'text', label: ' Asset Name' } 35 | { key: '', label: 'Delete', tmpl: Template.rtDelete } 36 | ] 37 | } 38 | 39 | Template.editAssetGroupPage.events 40 | # Click event from asset tree 41 | 'click .editAssetGroup .btnAdd': (event, template) -> 42 | temp = template.assetArray.get() 43 | if temp.indexOf(Session.get('currentID').toString()) == -1 44 | temp.push Session.get('currentID').toString() 45 | template.assetArray.set temp 46 | toast 'success', 'Asset added' 47 | else 48 | toast 'error', 'Asset already added' 49 | # Click event from reactive table 50 | 'click .editAssetGroup .btnDelete': (event, template) -> 51 | temp = template.assetArray.get() 52 | temp.splice(temp.indexOf(this._id), 1) 53 | template.assetArray.set temp 54 | toast 'success', 'Asset removed' 55 | -------------------------------------------------------------------------------- /client/templates/application/pm/editAssetGroup.jade: -------------------------------------------------------------------------------- 1 | template(name='editAssetGroupPage') 2 | if customTemplate 3 | +editAssetGroupPageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=assetGroupSchema collection='Assetgroups' id='editAssetGroupPage' type='update' doc=viewDoc 8 | fieldset.editAssetGroup.active 9 | legend Edit Asset Group 10 | if Template.subscriptionsReady 11 | .row.active 12 | +afQuickField name='groupText' 13 | .row 14 | .divider.teal 15 | .section 16 | h6.teal-text Asset 17 | .row 18 | +afQuickField name='asset_IDs' value=assetArray type='hidden' 19 | +afQuickField name='groupCreatedBy' value=assetGroupCreatedBy type='hidden' 20 | +reactiveTable collection=assetArrayDetails settings=settings class='table striped' 21 | else 22 | +spinner 23 | +treeViewAdd treeData=assetDetails 24 | +fabBackResetSubmit 25 | -------------------------------------------------------------------------------- /client/templates/application/pm/pm.coffee: -------------------------------------------------------------------------------- 1 | Template.pmPage.onCreated -> 2 | # Set Navbar so PM highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(2).addClass 'active' 5 | 6 | Template.pmPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.pmPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.pmPage.helpers 14 | customTemplate: -> Customisations.pm 15 | -------------------------------------------------------------------------------- /client/templates/application/pm/pm.jade: -------------------------------------------------------------------------------- 1 | template(name='pmPage') 2 | if customTemplate 3 | +pmPageCustom 4 | else 5 | .container 6 | h1.icon-page Planned Maintenance 7 | .row.flow-text.center-align 8 | .col.s12.m6.l3 9 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "pm/view-groups"}}') 10 | i.fa-5x.fa.fa-cogs 11 | br 12 | br 13 | | Asset Groups 14 | br 15 | br 16 | .col.s12.m6.l3 17 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "pm/view-pms"}}') 18 | i.fa-5x.fa.fa-calendar 19 | br 20 | br 21 | | PM Plans 22 | br 23 | br 24 | -------------------------------------------------------------------------------- /client/templates/application/pm/viewAssetGroup.coffee: -------------------------------------------------------------------------------- 1 | Template.viewAssetGroupPage.onCreated -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singleAssetGroup', Session.get('currentDoc')._id.toString() 5 | 6 | Template.viewAssetGroupPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.viewAssetGroupPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.viewAssetGroupPage.helpers 14 | customTemplate: -> Customisations.viewAssetGroup 15 | groupText: -> Assetgroups.findOne({_id: Session.get('currentDoc')._id.toString()}).groupText 16 | assetArray: -> 17 | temp = Assetgroups.findOne({_id: Session.get('currentDoc')._id.toString()}).asset_IDs 18 | tempArray=[] 19 | for a in [0...temp.length] 20 | tempArray[a] = Locations.findOne {'id':temp[a]} 21 | tempArray 22 | 23 | settings: -> 24 | return { 25 | rowsPerPage: 10 26 | showFilter: true 27 | fields: [ 28 | { key: 'assetID', label: ' Asset ID' } 29 | { key: 'text', label: ' Asset Name' } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /client/templates/application/pm/viewAssetGroup.jade: -------------------------------------------------------------------------------- 1 | template(name='viewAssetGroupPage') 2 | if customTemplate 3 | +viewAssetGroupPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset 8 | legend View Asset Group 9 | a(href='{{pathFor "edit-group"}}') 10 | button.btn-floating.waves-effect.waves-light.tooltipped(type='button', data-delay='50', data-position='bottom', data-tooltip='Edit Group') 11 | i.fa.fa-edit 12 | .row 13 | =groupText 14 | .row 15 | +reactiveTable collection=assetArray settings=settings class='table striped' 16 | +fabBack 17 | -------------------------------------------------------------------------------- /client/templates/application/pm/viewPM.coffee: -------------------------------------------------------------------------------- 1 | Template.viewPMPage.onCreated -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singlePM', Session.get('currentDoc')._id.toString() 5 | 6 | Template.viewPMPage.onRendered -> 7 | Session.set 'temp', true 8 | 9 | Template.viewPMPage.onRendered -> 10 | $(".dropdown-button").dropdown() 11 | $('.tooltipped').tooltip {delay: 50} 12 | 13 | Template.viewPMPage.onDestroyed -> 14 | $('.tooltipped').tooltip 'remove' 15 | 16 | Template.viewPMPage.helpers 17 | customTemplate: -> Customisations.viewPM 18 | pmSchema: -> Schema.pm 19 | viewDoc: -> 20 | Collections.PM.Current = PM.findOne ({ _id: Session.get('currentDoc')._id.toString() }) 21 | console.log JSON.stringify Collections.PM.Current 22 | Collections.PM.Current 23 | settings: -> { 24 | rowsPerPage: 10 25 | showFilter: true 26 | fields: [ 27 | { key: '_id', label: ' System ID' } 28 | { key: 'pmDescription', label: ' Title' } 29 | ] 30 | } 31 | assetGrpDetails: -> Collections.PM.Current.assetGroupDetails 32 | assetGrpList: -> Collections.PM.Current.assetGroupDetails.assetList 33 | agSettings: -> { 34 | rowsPerPage: 10 35 | showFilter: true 36 | fields: [ 37 | { key: 'assetID', label: ' Asset ID' } 38 | { key: 'text', label: ' Title' } 39 | ] 40 | } 41 | safetyMthdDetails: -> Collections.PM.Current.safetyPlanDetails 42 | safetyMthdList: -> Collections.PM.Current.safetyPlanDetails.safetyMethod 43 | smSettings: -> { 44 | rowsPerPage: 10 45 | showFilter: false 46 | fields: [ 47 | { key: 'id', label: ' Sequence ID' } 48 | { key: 'activity', label: ' Activity' } 49 | { key: 'hazards', label: ' Hazards' } 50 | { key: 'controls', label: ' Controls' } 51 | { key: 'responsible', label: ' Responsible' } 52 | ] 53 | } 54 | workPlanDetails: -> Collections.PM.Current.workPlanDetails 55 | workPlanList: -> Collections.PM.Current.workPlanDetails.workPlan 56 | wpSettings: -> { 57 | rowsPerPage: 10 58 | showFilter: false 59 | fields: [ 60 | { key: 'id', label: ' Sequence ID' } 61 | { key: 'activity', label: ' Activity' } 62 | { key: 'text', label: ' Title' } 63 | { key: 'estimatedTime', label: ' Est Time' } 64 | { key: 'trade', label: ' Trade' } 65 | { key: 'tradeLevel', label: ' Trade Level' } 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /client/templates/application/pm/viewPM.jade: -------------------------------------------------------------------------------- 1 | template(name='viewPMPage') 2 | if customTemplate 3 | +viewPMPageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.viewPM 8 | legend View PM Plan 9 | if Template.subscriptionsReady 10 | .row 11 | .section 12 | h6.teal-text PM Details 13 | =viewDoc.pmDescription 14 | .row 15 | .divider.teal 16 | .section 17 | h6.teal-text Asset Group 18 | =assetGrpDetails.groupText 19 | +reactiveTable collection=assetGrpList settings=agSettings class='table striped' 20 | .row 21 | .divider.teal 22 | .section 23 | h6.teal-text Safety Method 24 | =safetyMthdDetails.text 25 | +reactiveTable collection=safetyMthdList settings=smSettings class='table striped' 26 | .row 27 | .divider.teal 28 | .section 29 | h6.teal-text Work Plan 30 | =workPlanDetails.text 31 | +reactiveTable collection=workPlanList settings=wpSettings class='table striped' 32 | else 33 | +spinner 34 | +fabBack 35 | -------------------------------------------------------------------------------- /client/templates/application/pm/viewPMs.coffee: -------------------------------------------------------------------------------- 1 | Template.viewPMsPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewPMsPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewPMsPage.helpers 9 | customTemplate: -> Customisations.viewPMs 10 | collectionPM: -> PM 11 | settings: -> { 12 | rowsPerPage: 10 13 | showFilter: true 14 | fields: [ 15 | { key: '_id', label: ' System ID' } 16 | { key: 'userDetails.profile.firstName', label: ' First Name ' } 17 | { key: 'userDetails.profile.lastName', label: ' Last Name' } 18 | { key: 'assetGroupDetails.groupText', label: ' Asset Group' } 19 | { key: 'pmDescription', label: ' PM Description' } 20 | { key: '', label: 'View/Edit/Delete', tmpl: Template.rtViewEditDelete } 21 | { key: '', label: 'Activate', tmpl: Template.viewPMsActivate } 22 | ] 23 | } 24 | 25 | Template.viewPMsPage.events 26 | 'click .viewPMs .btnView': (event) -> 27 | Session.set 'currentDoc', PM.findOne {_id: this._id} 28 | FlowRouter.go '/pm/view-pm' 29 | 30 | 'click .viewPMs .btnEdit': (event) -> 31 | Session.set 'currentDoc', PM.findOne {_id: this._id} 32 | FlowRouter.go '/pm/edit-pm' 33 | 34 | 'click .viewPMs .btnDelete': (event) -> 35 | Collections.PM.CurrentID = this._id 36 | MaterializeModal.display 37 | bodyTemplate: 'viewPMsDelete' 38 | title: 'Delete PM!' 39 | submitLabel: 'Delete' 40 | closeLabel: 'Cancel' 41 | callback: (error, response) -> 42 | if error 43 | console.error error 44 | else 45 | if response.submit 46 | Meteor.call 'deletePM', Collections.PM.CurrentID, (error, result) -> 47 | if error 48 | toast 'error', error 49 | else 50 | toast 'success', result 51 | return 52 | return 53 | 54 | 'click .viewPMs .btnStart': (event) -> 55 | Collections.PM.Current = PM.findOne {_id: this._id} 56 | Session.set 'currentDoc', Collections.PM.Current 57 | FlowRouter.go '/pm/activate-pm' 58 | -------------------------------------------------------------------------------- /client/templates/application/pm/viewPMs.jade: -------------------------------------------------------------------------------- 1 | template(name='viewPMsPage') 2 | if customTemplate 3 | +viewPMsPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset.viewPMs 8 | legend View PM Plans 9 | a(href='{{pathFor "create-pm"}}') 10 | button.btn-floating.waves-effect.waves-light.tooltipped(type='button', data-delay='50', data-position='bottom', data-tooltip='Create PM') 11 | i.fa.fa-plus 12 | .row 13 | if Template.subscriptionsReady 14 | +reactiveTable collection=collectionPM settings=settings class='table striped' 15 | else 16 | +spinner 17 | +fabBack 18 | 19 | template(name='viewPMsActivate') 20 | button.btn-floating.waves-effect.waves-light.tooltipped.green.btnStart(type='button', data-delay='50', data-position='bottom', data-tooltip='Activate PM') 21 | i.fa.fa-clock-o 22 | 23 | template(name='viewPMsDelete') 24 | h5.red-text Warning this will permanently delete the PM and all work history! 25 | | This process cannot be undone. Please consider making PM inactive instead. 26 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/createCompany.coffee: -------------------------------------------------------------------------------- 1 | Template.createCompanyPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.createCompanyPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.createCompanyPage.helpers 9 | formSchema: -> Schema.companies 10 | customTemplate: -> Customisations.createCompany 11 | classID: -> Session.get 'currentClassID' 12 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 13 | 14 | Template.createCompanyPage.events 15 | 'click .firstRow .btnAdd': (event, template) -> 16 | MaterializeModal.confirm 17 | title: 'Select Company Classification' 18 | bodyTemplate: "createCompanyModal" 19 | 20 | Template.createCompanyModal.onRendered -> 21 | tempData = Classification.find(type: 'company-classification').fetch() 22 | dataTree(tempData, 'classification') 23 | 24 | Template.createCompanyModal.helpers 25 | classificationDetails: -> Classification.findOne(_id: Session.get('currentClassID').toString()) 26 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/createCompanyClass.coffee: -------------------------------------------------------------------------------- 1 | Template.createCompanyClassificationPage.helpers 2 | customTemplate: -> Customisations.createCompanyClassification 3 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/createCompanyClass.jade: -------------------------------------------------------------------------------- 1 | template(name='createCompanyClassificationPage') 2 | if customTemplate 3 | +createCompanyClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +createClassificationPage classificationType='company-classification' 7 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/deleteCompany.coffee: -------------------------------------------------------------------------------- 1 | Template.deleteCompanyPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.deleteCompanyPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.deleteCompanyPage.helpers 9 | customTemplate: -> Customisations.deleteCompany 10 | textDoc: -> (Items.findOne {'id':Session.get('currentID').toString()}).text 11 | 12 | Template.deleteCompanyPage.events 13 | 'click .deleteCompany .btnDelete': (event) -> 14 | temp = Items.findOne {'parent':Session.get('currentID').toString()} 15 | if temp 16 | alert 'You cannot delete an item that has children!' 17 | else 18 | Meteor.call 'deleteCompany', Session.get('currentID').toString(), (error, result) -> 19 | if error 20 | toast 'error', error 21 | else 22 | toast 'success', result 23 | return 24 | FlowRouter.go history.back() 25 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/deleteCompany.jade: -------------------------------------------------------------------------------- 1 | template(name='deleteCompanyPage') 2 | if customTemplate 3 | +deleteCompanyPageCustom 4 | else 5 | .flow-text.deleteCompany 6 | if Template.subscriptionsReady 7 | .row 8 | br 9 | h1.red-text 10 | |Delete 11 | = textDoc 12 | |? 13 | h2 14 | | Warning this will permanently delete 15 | = textDoc 16 | |! 17 | | This will also affect any other documents that refer to 18 | = textDoc 19 | |. 20 | br 21 | div 22 | button.btn.waves-effect.waves-light.red.btnDelete Delete permanently 23 | a(href="{{pathFor '../inventory/items/view-items'}}") 24 | button.btn.waves-effect.waves-light(type='button') 25 | i.material-icons skip_previous 26 | | Back to safety 27 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/deleteCompanyClass.coffee: -------------------------------------------------------------------------------- 1 | Template.deleteCompanyClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.deleteCompanyClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.deleteCompanyClassificationPage.helpers 9 | customTemplate: -> Customisations.deleteCompanyClassification 10 | textDoc: -> Classification.findOne({'id':Session.get('currentClassID').toString()}).text 11 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/deleteCompanyClass.jade: -------------------------------------------------------------------------------- 1 | template(name='deleteCompanyClassificationPage') 2 | if customTemplate 3 | +deleteCompanyClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +deleteClassificationPage doc=textDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/editCompany.coffee: -------------------------------------------------------------------------------- 1 | Template.editCompanyPage.onCreated -> 2 | this.assetClassID = new ReactiveVar 3 | 4 | Template.editCompanyPage.onRendered -> 5 | $(".dropdown-button").dropdown() 6 | $('.tooltipped').tooltip {delay: 50} 7 | 8 | Template.editCompanyPage.onDestroyed -> 9 | $('.tooltipped').tooltip 'remove' 10 | 11 | Template.editCompanyPage.helpers 12 | formSchema: -> Schema.companies 13 | customTemplate: -> Customisations.editCompany 14 | currentDoc: -> Session.get 'currentDoc' 15 | classID: -> Session.get 'currentClassID' 16 | txtClassificationID: -> Classification.findOne(Session.get('currentClassID').toString()).text 17 | 18 | Template.editCompanyPage.events 19 | 'click .firstRow .btnAdd': (event, template) -> 20 | MaterializeModal.confirm 21 | title: 'Select Asset Classification' 22 | bodyTemplate: "modaleditCompanyPage" 23 | 24 | #------------------- Modal ------------------------------------- 25 | 26 | Template.modaleditCompanyPage.onRendered -> 27 | tempData = Classification.find(type: 'company-classification').fetch() 28 | dataTree(tempData, 'classification') 29 | 30 | Template.modaleditCompanyPage.helpers 31 | classificationDetails: -> Classification.findOne {_id:Session.get 'currentClassID'} 32 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/editCompanyClass.coffee: -------------------------------------------------------------------------------- 1 | Template.editCompanyClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editCompanyClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editCompanyClassificationPage.helpers 9 | customTemplate: -> Customisations.editCompanyClassification # user customised template if applicable 10 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/editCompanyClass.jade: -------------------------------------------------------------------------------- 1 | template(name='editCompanyClassificationPage') 2 | if customTemplate 3 | +editCompanyClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +editClassificationPage 7 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/viewCompanies.coffee: -------------------------------------------------------------------------------- 1 | Template.viewCompaniesPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewCompaniesPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewCompaniesPage.helpers 9 | customTemplate: -> Customisations.viewCompanies 10 | rtCollection: -> Companies 11 | settings: -> { 12 | rowsPerPage: 10 13 | showFilter: true 14 | fields: [ 15 | { key: '_id', label: ' System ID' } 16 | { key: 'company_id', label: ' Company ID' } 17 | { key: 'type', label: ' Type' } 18 | { key: 'referenceID', label: ' Reference ID' } 19 | { key: 'status', label: ' Status' } 20 | { key: 'name', label: ' Company Name' } 21 | { key: 'tradingName', label: ' Trading Name' } 22 | { key: 'companyNumber', label: ' Reg Number' } 23 | { key: '', label: 'View/Edit/Delete', tmpl: Template.rtViewEditDelete } 24 | ] 25 | } 26 | 27 | Template.viewCompaniesPage.events 28 | 'click .viewCompanies .btnView': (event) -> 29 | Session.set 'currentDoc', Companies.findOne {_id: this._id} 30 | Session.set 'currentClassID', '' 31 | FlowRouter.go '/procurement/company/view-company' 32 | 33 | 'click .viewCompanies .btnEdit': (event) -> 34 | Session.set 'currentDoc', Companies.findOne {_id: this._id} 35 | Session.set 'currentClassID', '' 36 | FlowRouter.go '/procurement/company/edit-company' 37 | 38 | 'click .viewCompanies .btnDelete': (event) -> 39 | Collections.Companies.CurrentID = this._id 40 | MaterializeModal.display 41 | bodyTemplate: 'viewCompaniesDelete' 42 | title: 'Delete Company!' 43 | submitLabel: 'Delete' 44 | closeLabel: 'Cancel' 45 | callback: (error, response) -> 46 | if error 47 | console.error error 48 | else 49 | if response.submit 50 | Meteor.call 'deleteCompany', Collections.Companies.CurrentID, (error, result) -> 51 | if error 52 | toast 'error', error 53 | else 54 | toast 'success', result 55 | return 56 | return 57 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/viewCompanies.jade: -------------------------------------------------------------------------------- 1 | template(name='viewCompaniesPage') 2 | if customTemplate 3 | +viewCompaniesPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset.viewCompanies 8 | legend View Companies 9 | a(href='{{pathFor "create-company"}}') 10 | button.btn-floating.waves-effect.waves-light.tooltipped(type='button', data-delay='50', data-position='bottom', data-tooltip='Create Company') 11 | i.fa.fa-plus 12 | .row 13 | if Template.subscriptionsReady 14 | +reactiveTable collection=rtCollection settings=settings class='table striped' 15 | else 16 | +spinner 17 | +fabBack 18 | 19 | template(name='viewCompaniesDelete') 20 | h5.red-text Warning this will permanently delete the company! 21 | | This process cannot be undone. 22 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/viewCompany.coffee: -------------------------------------------------------------------------------- 1 | Template.viewCompanyPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewCompanyPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewCompanyPage.helpers 9 | customTemplate: -> Customisations.viewCompany 10 | currentDoc: -> Session.get 'currentDoc' 11 | txtClassificationID: -> Classification.findOne(_id: Session.get('currentDoc').classificationID ).text 12 | 13 | Template.viewCompanyPage.events 14 | 'click .viewCompany .btnEdit': -> 15 | if (Session.get('currentID').toString() == '#') 16 | alert 'No company selected!' 17 | else 18 | FlowRouter.go '/company/edit-company' 19 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/viewCompany.jade: -------------------------------------------------------------------------------- 1 | template(name='viewCompanyPage') 2 | if customTemplate 3 | +viewCompanyPageCustom 4 | else 5 | .flow-text.container2.viewCompany 6 | +fabBack 7 | br 8 | fieldset 9 | legend View Item 10 | if Template.subscriptionsReady 11 | .row 12 | +smlField item=currentDoc._id label='System ID' 13 | +smlField item=currentDoc.company_id label='Company ID' 14 | +smlDateField item=currentDoc.createdDate label='Created Date' 15 | +smlField item=txtClassificationID label='Item Classification' 16 | +smlField item=currentDoc.type label='Type' 17 | +smlField item=currentDoc.referenceID label='Reference ID' 18 | +smlField item=currentDoc.status label='Status' 19 | +smlField item=currentDoc.name label='Company Name' 20 | +smlField item=currentDoc.tradingName label='Trading Name' 21 | +smlField item=currentDoc.companyNumber label='Company registration number' 22 | +smlField item=currentDoc.taxNumber label='Tax registration number' 23 | .row 24 | +lgeField item=currentDoc.text label='Title' 25 | +lgeField item=currentDoc.description label='Description' 26 | .row 27 | .divider.teal 28 | .section 29 | h6.teal-text Contact 30 | +smlField item=currentDoc.email label='Email Address' 31 | +smlField item=currentDoc.website label='Website' 32 | +smlField item=currentDoc.phone label='Phone Number' 33 | +smlField item=currentDoc.fax label='Fax Number' 34 | .row 35 | .divider.teal 36 | .section 37 | h6.teal-text Street Address 38 | +lgeField item=currentDoc.streetAddress label='Address' 39 | +smlField item=currentDoc.streetCity label='City' 40 | +smlField item=currentDoc.streetState label='State' 41 | +smlField item=currentDoc.streetCountry label='Country' 42 | +smlField item=currentDoc.streetZip label='Zip Post Code' 43 | .row 44 | .divider.teal 45 | .section 46 | h6.teal-text Postal Address 47 | +lgeField item=currentDoc.postalAddress label='Postal Address' 48 | +smlField item=currentDoc.postalCity label='City' 49 | +smlField item=currentDoc.postalState label='State' 50 | +smlField item=currentDoc.postalCountry label='Country' 51 | +smlField item=currentDoc.postalZip label='Zip Post Code' 52 | 53 | else 54 | +spinner 55 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/viewCompanyClass.coffee: -------------------------------------------------------------------------------- 1 | Template.viewCompanyClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewCompanyClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewCompanyClassificationPage.helpers 9 | customTemplate: -> Customisations.viewCompanyClassification 10 | viewDoc: -> 11 | Collections.Classification.Current = Classification.findOne {'id':Session.get('currentClassID').toString()} 12 | return Collections.Classification.Current 13 | 14 | Template.viewCompanyClassificationPage.events 15 | 'click .viewCompanyClassification .btnEdit': -> 16 | if (Session.get('currentClassID').toString() == '#') 17 | alert 'No classification selected!' 18 | else 19 | FlowRouter.go '/inventory/item/edit-classification' 20 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/viewCompanyClass.jade: -------------------------------------------------------------------------------- 1 | template(name='viewCompanyClassificationPage') 2 | if customTemplate 3 | +viewCompanyClassificationCustom 4 | else 5 | // template located in layouts folder 6 | +viewClassificationPage classDoc=viewDoc 7 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/viewCompanyClasses.coffee: -------------------------------------------------------------------------------- 1 | Template.viewCompanyClassificationsPage.onCreated -> 2 | # Set Navbar so Resources highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(0).addClass 'active' 5 | Session.set 'treeviewData', 'company-classification' 6 | 7 | Template.viewCompanyClassificationsPage.onRendered -> 8 | $(".dropdown-button").dropdown() 9 | $('.tooltipped').tooltip {delay: 50} 10 | 11 | Template.viewCompanyClassificationsPage.onDestroyed -> 12 | $('.tooltipped').tooltip 'remove' 13 | 14 | Template.viewCompanyClassificationsPage.helpers 15 | customTemplate: -> Customisations.viewCompanyClassifications 16 | classificationDetails: -> Classification.findOne {_id: Session.get('currentClassID').toString() } 17 | -------------------------------------------------------------------------------- /client/templates/application/procurement/companies/viewCompanyClasses.jade: -------------------------------------------------------------------------------- 1 | template(name='viewCompanyClassificationsPage') 2 | if customTemplate 3 | +viewCompanyClassificationsPageCustom 4 | else 5 | .container 6 | .row 7 | div.viewClassifications 8 | // template located in layouts folder 9 | +viewClassificationsPage type='procurement/company' 10 | +treeView nodeID=classificationDetails.classificationID nodeText=classificationDetails.text 11 | -------------------------------------------------------------------------------- /client/templates/application/procurement/procurement.coffee: -------------------------------------------------------------------------------- 1 | Template.procurementPage.onCreated -> 2 | # Set Navbar so Procurement highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(5).addClass 'active' 5 | 6 | Template.procurementPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.procurementPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.procurementPage.helpers 14 | customTemplate: -> Customisations.procurement 15 | -------------------------------------------------------------------------------- /client/templates/application/procurement/procurement.jade: -------------------------------------------------------------------------------- 1 | template(name='procurementPage') 2 | if customTemplate 3 | +procurementPageCustom 4 | else 5 | .container 6 | h1.icon-page Procurement 7 | .row.flow-text.center-align 8 | .col.s12.m6.l3 9 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "procurement/purchase/view-purchases"}}') 10 | i.fa-5x.fa.fa-shopping-cart 11 | br 12 | br 13 | | Purchases 14 | br 15 | br 16 | .col.s12.m6.l3 17 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "procurement/company/view-companies"}}') 18 | i.fa-5x.fa.fa-building-o 19 | br 20 | br 21 | | Companies 22 | br 23 | br 24 | .col.s12.m6.l3 25 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "procurement/company/view-classifications"}}') 26 | i.fa-5x.fa.fa-file-o 27 | br 28 | br 29 | | Company Classification 30 | br 31 | br 32 | .col.s12.m6.l3 33 | a.waves-effect.waves-dark.icon-page(href='#') 34 | i.fa-5x.fa.fa-money 35 | br 36 | br 37 | | Schedule of Rates 38 | br 39 | br 40 | -------------------------------------------------------------------------------- /client/templates/application/procurement/purchasing/receiveGoods.jade: -------------------------------------------------------------------------------- 1 | template(name='receiveGoodsPage') 2 | if customTemplate 3 | +receiveGoodsPageCustom 4 | else 5 | .container2 6 | br 7 | fieldset 8 | legend Goods Received 9 | .row 10 | .section.items 11 | if Template.subscriptionsReady 12 | +reactiveTable collection=purchaseItems settings=settings class='table striped' 13 | else 14 | +spinner 15 | +fabBackResetSubmit 16 | 17 | template(name='receiveGoodsModal') 18 | .row 19 | .input-field.col.s12.m6.l3 20 | input#receiveGoodsQty.validate(placeholder='Enter quantity received', type='number') 21 | label.active(for='receiveGoodsQty') Qty Goods Received 22 | .col.s12.m6.l9 23 | = invLocText 24 | +treeView nodeID=invLocDetails.invLocID nodeText=invLocDetails.text 25 | -------------------------------------------------------------------------------- /client/templates/application/procurement/purchasing/viewPurchase.coffee: -------------------------------------------------------------------------------- 1 | Template.viewPurchasePage.onRendered -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singlePurchase', Collections.Purchases.Current._id 5 | 6 | Template.viewPurchasePage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | Session.set 'currentDoc', {} # Requisition doc 10 | 11 | Template.viewPurchasePage.onDestroyed -> 12 | $('.tooltipped').tooltip 'remove' 13 | 14 | Template.viewPurchasePage.helpers 15 | customTemplate: -> Customisations.viewPurchase 16 | frmTitle: -> 17 | if Collections.Purchases.Current.status == '1' 18 | return 'View Purchase Requisition' 19 | else 20 | return 'View Purchase Order' 21 | editDoc: -> 22 | temp = Session.get 'currentDoc' 23 | if jQuery.isEmptyObject(temp) 24 | Session.set 'currentDoc', Purchases.findOne {_id: Collections.Purchases.Current._id } 25 | temp 26 | purchaseItems: -> Session.get('currentDoc').reqItems 27 | settings: -> ## Purchase Items 28 | return { 29 | rowsPerPage: 10 30 | showFilter: true 31 | fields: [ 32 | { key: 'referenceID', label: ' Reference ID' } 33 | { key: 'text', label: ' Title' } 34 | { key: 'orderQty', label: ' Qty' } 35 | { key: 'stockUnits', hidden: true } 36 | { key: 'itemPrice', label: ' Price' } 37 | { key: 'excludesTax', label: ' Ex Tax', tmpl: Template.rtBoolean } 38 | { key: 'comments', label: ' Comments' } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /client/templates/application/procurement/purchasing/viewPurchases.coffee: -------------------------------------------------------------------------------- 1 | Template.viewPurchasesPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewPurchasesPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewPurchasesPage.helpers 9 | purchases: -> Purchases.find {} 10 | spinner: -> 11 | MaterializeModal.loading 12 | nospinner: -> 13 | MaterializeModal.close 14 | numDocs: -> 15 | temp = Counts.get 'workorders-count' 16 | if temp > 1000 17 | FlowRouter.go '/work' 18 | toast 'error', ('Your query exceeds 1000 docs. ('+temp+')') 19 | else 20 | return temp 21 | customTemplate: -> Customisations.viewPeople 22 | settings: -> 23 | return { 24 | rowsPerPage: 10 25 | showFilter: true 26 | fields: [ 27 | { key: '_id', hidden: true } 28 | { key: 'createdDate', label: ' Date Raised' } 29 | { key: 'status', label: ' Status' } 30 | { key: 'refID', label: ' Reference ID' } 31 | { key: 'billingDetails.text', label: ' Bill to' } 32 | { key: 'supplierDetails.text', label: ' Supplier' } 33 | { key: 'assetID', label: ' Asset ID' } 34 | { key: 'assetText', label: ' Asset' } 35 | { key: 'workID', label: ' Work Order ID' } 36 | { key: '', label: 'View/Edit/Receive/Delete', tmpl: Template.rtViewEditReceivedDelete } 37 | ] 38 | } 39 | 40 | Template.viewPurchasesPage.events 41 | 'click .btnReceived': (event) -> 42 | if this.status < 5 43 | MaterializeModal.error 44 | title: "Error" 45 | label: "Not a purchase order!" 46 | message: "Can only receive goods against an approved purchase order (status = 5)" 47 | else 48 | Collections.Purchases.Current = this 49 | FlowRouter.go '/procurement/purchase/receive-goods' 50 | 'click .viewPurchases .btnView': (event) -> 51 | Collections.Purchases.Current = this 52 | FlowRouter.go '/procurement/purchase/view-purchase' 53 | 'click .viewPurchases .btnEdit': (event) -> 54 | Collections.Purchases.Current = this 55 | FlowRouter.go '/procurement/purchase/edit-purchase' 56 | 'click .viewPurchases .btnDelete': (event) -> 57 | temp = this._id 58 | MaterializeModal.confirm 59 | title: 'Delete Document' 60 | label: 'Warning - Permanent Delete' 61 | message: 'You are about permanently delete a document. This cannot be reversed and may affect other documents that reference it.' 62 | callback: (error, response) -> 63 | if (response.submit) 64 | Meteor.call 'deletePurchase', temp, (error, result) -> 65 | if error 66 | toast 'error', error 67 | else 68 | toast 'success', result 69 | -------------------------------------------------------------------------------- /client/templates/application/procurement/purchasing/viewPurchases.jade: -------------------------------------------------------------------------------- 1 | template(name='viewPurchasesPage') 2 | if customTemplate 3 | +viewPurchasesPageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.viewPurchases 8 | legend Purchases 9 | a(href='{{pathFor "create-purchase"}}') 10 | +frmBtnNew label='New Purchase Requisition' 11 | +reactiveTable collection='purchases-list' settings=settings class='table striped' 12 | +fabBack 13 | -------------------------------------------------------------------------------- /client/templates/application/reports/reports.coffee: -------------------------------------------------------------------------------- 1 | Template.reportsPage.onCreated -> 2 | # Set Navbar so Reports highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(6).addClass 'active' 5 | 6 | Template.reportsPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.reportsPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.reportsPage.helpers 14 | customTemplate: -> Customisations.reports 15 | -------------------------------------------------------------------------------- /client/templates/application/reports/reports.jade: -------------------------------------------------------------------------------- 1 | template(name='reportsPage') 2 | if customTemplate 3 | +reportsPageCustom 4 | else 5 | .container 6 | h1 Welcome to Lightning Reports! 7 | br 8 | br 9 | .row.valign-wrapper 10 | .col.s12.m6.l3.valign 11 | a(href='#') 12 | img(src='Logo_D3.png') 13 | .col.s12.m6.l3.valign 14 | a(href='#') 15 | img(src='Birt-logo.png') 16 | br 17 | br 18 | -------------------------------------------------------------------------------- /client/templates/application/resources/credentials.coffee: -------------------------------------------------------------------------------- 1 | Template.credentialsPage.onCreated -> 2 | self = this 3 | self.autorun -> self.subscribe 'singleUser',Collections.Users.Current._id 4 | Session.set 'currentDoc', Collections.Users.Current 5 | 6 | Template.credentialsPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.credentialsPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.credentialsPage.helpers 14 | currentUser: -> Session.get 'currentDoc' 15 | professionsValue: -> Collections.Users.Current.professions 16 | tradesValue: -> Collections.Users.Current.trades 17 | customTemplate: -> Customisations.credentials 18 | 19 | Template.credentialsPage.events 20 | 'click .credentials .btnSubmit': (event) -> 21 | FlowRouter.go '/resources/view-people' 22 | -------------------------------------------------------------------------------- /client/templates/application/resources/credentials.jade: -------------------------------------------------------------------------------- 1 | template(name='credentialsPage') 2 | if customTemplate 3 | +credentialsPageCustom 4 | else 5 | .flow-text.container2.credentials 6 | .form-group 7 | +autoForm id='editPeoplePage' collection='Meteor.users' doc=currentUser type='update' 8 | if Template.subscriptionsReady 9 | br 10 | fieldset 11 | legend Edit User Credentials and Records 12 | .row 13 | h6.teal-text Role 14 | .col.s12.m6.l3 15 | +afQuickField name='roles' 16 | .row 17 | .divider.teal 18 | .section 19 | .row 20 | h6.teal-text Database Access 21 | .col.s12.m6.l3 22 | +afQuickField name='databases' class='active' 23 | .row 24 | .divider.teal 25 | .section 26 | +afxArrayAdd title='Trade Qualifications' field='trades' item='trades' tip='Add Trade Qualification' 27 | .row 28 | .divider.teal 29 | .section 30 | +afxArrayAdd title='Academic Qualifications' field='professions' item='professions' tip='Add Academic Qualification' 31 | .row 32 | .divider.teal 33 | .section 34 | +afxArrayAdd title='Certifications' field='certifications' item='certifications' tip='Add Certifications' 35 | +fabBackResetSubmit 36 | else 37 | +spinner 38 | -------------------------------------------------------------------------------- /client/templates/application/resources/editPeople.coffee: -------------------------------------------------------------------------------- 1 | Template.editPeoplePage.onCreated -> 2 | self = this 3 | self.autorun -> self.subscribe 'singleUser',Collections.Users.Current._id 4 | 5 | Template.editPeoplePage.onRendered -> 6 | $(".dropdown-button").dropdown() 7 | $('.tooltipped').tooltip {delay: 50} 8 | 9 | Template.editPeoplePage.onDestroyed -> 10 | $('.tooltipped').tooltip 'remove' 11 | 12 | Template.editPeoplePage.helpers 13 | currentUser: -> Collections.Users.Current 14 | professionsValue: -> Collections.Users.Current.professions 15 | tradesValue: -> Collections.Users.Current.trades 16 | customTemplate: -> Customisations.editPeople 17 | 18 | Template.editPeoplePage.events 19 | 'click .editPeople .btnSubmit': (event) -> 20 | FlowRouter.go '/resources/view-people' 21 | -------------------------------------------------------------------------------- /client/templates/application/resources/editPeople.jade: -------------------------------------------------------------------------------- 1 | template(name='editPeoplePage') 2 | if customTemplate 3 | +editPeoplePageCustom 4 | else 5 | .flow-text.container2.editPeople 6 | +autoForm id='editPeoplePage' collection='Meteor.users' doc=currentUser type='update' 7 | +fabBackResetSubmit 8 | br 9 | if Template.subscriptionsReady 10 | fieldset.active 11 | legend Edit User Profile 12 | .row.z-depth-1 13 | .col.s12.m6.l3 14 | +afQuickField name='profile.firstName' 15 | .col.s12.m6.l3 16 | +afQuickField name='profile.lastName' 17 | .col.s12.m6.l3 18 | +afQuickField name='profile.cpyPosition' 19 | .col.s12.m6.l3 20 | +afQuickField name='profile.cpyName' 21 | .col.s12.m6.l3 22 | +afQuickField name='profile.cpyDiv' 23 | .col.s12.m6.l3 24 | +afQuickField name='profile.website' 25 | .col.s12.m6.l3 26 | +afQuickField name='profile.phone' 27 | .col.s12.m6.l3 28 | +afQuickField name='profile.mobile' 29 | .row 30 | .divider.teal 31 | .section 32 | .row 33 | h6.teal-text Email 34 | button.autoform-add-item.btn-floating.waves-effect.waves-light.teal(type='button', data-autoform-field='emails', data-position='bottom', data-tooltip='Add') 35 | i.fa.fa-plus 36 | +afEachArrayItem name='emails' 37 | .col.s12.m6.l3 38 | button.autoform-remove-item.btn-floating.waves-effect.waves-light.red(type='button', data-position='bottom', data-tooltip='Remove') 39 | i.fa.fa-trash 40 | +afQuickField name=this.name label=false 41 | else 42 | +spinner 43 | -------------------------------------------------------------------------------- /client/templates/application/resources/viewPeople.coffee: -------------------------------------------------------------------------------- 1 | Template.viewPeoplePage.onCreated -> 2 | # Set Navbar so Resources highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(3).addClass 'active' 5 | self = this 6 | self.autorun -> 7 | self.subscribe 'directory' 8 | 9 | Template.viewPeoplePage.onRendered -> 10 | $(".dropdown-button").dropdown() 11 | $('.tooltipped').tooltip {delay: 50} 12 | 13 | Template.viewPeoplePage.onDestroyed -> 14 | $('.tooltipped').tooltip 'remove' 15 | 16 | Template.viewPeoplePage.helpers 17 | customTemplate: -> Customisations.viewPeople 18 | userEmail: -> this.emails[0].address 19 | userID: -> this._id 20 | userRole: -> this.roles[0] 21 | settings: -> 22 | return { 23 | rowsPerPage: 10 24 | showFilter: true 25 | fields: [ 26 | { key: 'profile.firstName', label: ' First Name' } 27 | { key: 'profile.lastName', label: 'Last Name' } 28 | { key: 'profile.cpyName', label: 'Company' } 29 | { key: 'profile.cpyDiv', label: 'Division' } 30 | { key: 'emails.0.address', label: 'Email' } 31 | { key: 'roles.0', label: 'Role' } 32 | { key: 'location', label: 'Edit/Secure/Delete', tmpl: Template.editPerson } 33 | ] 34 | } 35 | 36 | Template.viewPeoplePage.events 37 | 'click .viewPeople .btnEach': (event) -> 38 | Collections.Users.Current = this 39 | FlowRouter.go '/resources/edit-people' 40 | 'click .viewPeople .btnEach2': (event) -> 41 | Collections.Users.Current = this 42 | FlowRouter.go '/resources/credentials' 43 | 'click .viewPeople .btnDelete': (event) -> 44 | Collections.Users.Current = this 45 | $('#viewPeoplePageModal').openModal() 46 | 'click .viewPeople .btnConfirm': (event) -> 47 | temp = Collections.Users.Current 48 | Meteor.call 'deleteUser', temp._id, (error, result) -> 49 | if error 50 | toast 'error', error 51 | else 52 | toast 'success', result 53 | return 54 | FlowRouter.go '/resources' 55 | 56 | Template.editPerson.onRendered -> 57 | $('.tooltipped').tooltip {delay: 50} 58 | 59 | Template.editPerson.onDestroyed -> 60 | $('.tooltipped').tooltip 'remove' 61 | -------------------------------------------------------------------------------- /client/templates/application/resources/viewPeople.jade: -------------------------------------------------------------------------------- 1 | template(name='viewPeoplePage') 2 | if customTemplate 3 | +viewPeoplePageCustom 4 | else 5 | .flow-text.container2.viewPeople 6 | if Template.subscriptionsReady 7 | br 8 | fieldset 9 | legend People 10 | +reactiveTable collection='resources-data' settings=settings class='table striped' 11 | else 12 | +spinner 13 | .fixed-action-btn(style='bottom: 45px; right: 24px;') 14 | a.btn-floating.btn-large(href="{{pathFor '../resources'}}") 15 | i.large.material-icons skip_previous 16 | // Delete Modal 17 | #viewPeoplePageModal.modal 18 | .container 19 | .modal-content 20 | h4.red-text Delete User 21 | p Warning! This will permanently delete the user. 22 | .modal-footer 23 | a.modal-action.modal-close.waves-effect.waves-red.btn-flat(href='#!') Cancel 24 | button.modal-action.modal-close.waves-effect.waves-green.btn-flat.btnConfirm(type='button') Delete 25 | 26 | template(name='editPerson') 27 | button.btn-floating.waves-effect.waves-light.tooltipped.btnEach(type='button', data-delay='50', data-position='bottom,', data-tooltip='edit user') 28 | i.fa.fa-edit 29 | button.btn-floating.waves-effect.waves-light.tooltipped.btnEach2(type='button', data-delay='50', data-position='bottom', data-tooltip='edit permissions') 30 | i.fa.fa-shield 31 | button.btn-floating.waves-effect.waves-light.tooltipped.btnDelete.red(type='button', data-delay='50', data-position='bottom', data-tooltip='Permanently delete user!') 32 | i.fa.fa-trash-o 33 | -------------------------------------------------------------------------------- /client/templates/application/work/createSafetyTemplate.coffee: -------------------------------------------------------------------------------- 1 | Template.createSafetyTemplatePage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.createSafetyTemplatePage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.createSafetyTemplatePage.helpers 9 | customTemplate: -> Customisations.createSafetyTemplate 10 | createdID: -> Meteor.userId() 11 | createSafetyTemplateSchema: -> Schema.safetyMethodTemplate 12 | -------------------------------------------------------------------------------- /client/templates/application/work/createSafetyTemplate.jade: -------------------------------------------------------------------------------- 1 | template(name='createSafetyTemplatePage') 2 | if customTemplate 3 | +createSafetyTemplatePageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=createSafetyTemplateSchema id='createSafetyTemplatePage' type='method' meteormethod='createSafetyTemplate' 8 | fieldset 9 | legend New Safety Template 10 | .row 11 | +afQuickField name='createdByID' value=createdID type='hidden' 12 | +afQuickField name='text' 13 | .row 14 | .divider.teal 15 | .section 16 | +afxArrayAdd title='Safety Method' field='safetyMethod' item='safetyMethod' tip='Add Safety Method' 17 | +fabBackResetSubmit 18 | .form-group 19 | -------------------------------------------------------------------------------- /client/templates/application/work/createWork.coffee: -------------------------------------------------------------------------------- 1 | Template.createWorkPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | temp = Locations.find().fetch() 5 | dataTree(temp , 'general') 6 | 7 | Template.createWorkPage.onDestroyed -> 8 | $('.tooltipped').tooltip 'remove' 9 | 10 | Template.createWorkPage.helpers 11 | customTemplate: -> Customisations.createWork 12 | formSchema: -> Schema.requests 13 | requestor: -> 14 | temp=Meteor.user() 15 | return { 16 | reqBy_id: temp._id 17 | reqByFirstName: temp.profile.firstName 18 | reqByLastName: temp.profile.lastName 19 | } 20 | reqDate: -> (new Date()).toISOString() 21 | assetDetails: -> 22 | Collections.Locations.Current = Locations.findOne {'id':Session.get('currentID').toString()} 23 | Collections.Locations.Current 24 | -------------------------------------------------------------------------------- /client/templates/application/work/createWork.jade: -------------------------------------------------------------------------------- 1 | template(name='createWorkPage') 2 | if customTemplate 3 | +createWorkPageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=formSchema id='createWorkPage' type='method' meteormethod='createWO' 8 | fieldset 9 | legend New Work Request 10 | .row 11 | +afQuickField name='type' value='workorder' type='hidden' 12 | +afQuickField name='reqBy_id' value=requestor.reqBy_id type='hidden' 13 | +afQuickField name='reqByFirstName' value=requestor.reqByFirstName type='hidden' 14 | +afQuickField name='reqByLastName' value=requestor.reqByLastName type='hidden' 15 | +afQuickField name='status' value='1' type='hidden' 16 | +afQuickField name='asset_ID' value=assetDetails._id type='hidden' 17 | +afQuickField name='asset_treePath' value=assetDetails.treePath type='hidden' 18 | +afQuickField name='assetID' value=assetDetails.assetID type='hidden' 19 | +afQuickField name='assetText' value=assetDetails.text type='hidden' 20 | .col.s12.m6.l3 21 | +afQuickField name='refID' 22 | .col.s12.m6.l3 23 | +afQuickField name='reqPriority' 24 | div 25 | +afQuickField name='reqDescription' 26 | .row 27 | .divider.teal 28 | .section 29 | h6.teal-text Asset 30 | +treeView nodeID=assetDetails.assetID nodeText=assetDetails.text 31 | +fabBackResetSubmit 32 | -------------------------------------------------------------------------------- /client/templates/application/work/createWorkTemplate.coffee: -------------------------------------------------------------------------------- 1 | Template.createWorkTemplatePage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.createWorkTemplatePage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.createWorkTemplatePage.helpers 9 | customTemplate: -> Customisations.createWorkTemplate 10 | createdID: -> Meteor.userId() 11 | createWorkTemplateSchema: -> Schema.workPlanTemplate 12 | -------------------------------------------------------------------------------- /client/templates/application/work/createWorkTemplate.jade: -------------------------------------------------------------------------------- 1 | template(name='createWorkTemplatePage') 2 | if customTemplate 3 | +createWorkTemplatePageCustom 4 | else 5 | .container2 6 | br 7 | +autoForm schema=createWorkTemplateSchema id='createWorkTemplatePage' type='method' meteormethod='createWorkTemplate' 8 | fieldset 9 | legend New Work Template 10 | .row 11 | +afQuickField name='createdByID' value=createdID type='hidden' 12 | +afQuickField name='text' 13 | .row 14 | .divider.teal 15 | .section 16 | +afxArrayAdd title='Work Plan' field='workPlan' item='workPlan' tip='Add Work Plan Task' 17 | +fabBackResetSubmit 18 | -------------------------------------------------------------------------------- /client/templates/application/work/editSafetyTemplate.coffee: -------------------------------------------------------------------------------- 1 | Template.editSafetyTemplatePage.onCreated -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singleSafetymethod', Collections.Safetyplans.Current._id 5 | 6 | Template.editSafetyTemplatePage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.editSafetyTemplatePage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.editSafetyTemplatePage.helpers 14 | customTemplate: -> Customisations.viewSafetyTemplate 15 | viewDoc: -> Safetyplans.findOne '_id': Collections.Safetyplans.Current._id 16 | schemaSafetyplans: -> Schema.safetyMethodTemplate 17 | -------------------------------------------------------------------------------- /client/templates/application/work/editSafetyTemplate.jade: -------------------------------------------------------------------------------- 1 | template(name='editSafetyTemplatePage') 2 | if customTemplate 3 | +editSafetyTemplatePageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.active 8 | legend Safety Method Template 9 | if Template.subscriptionsReady 10 | +autoForm schema=schemaSafetyplans id='editSafetyTemplatePage' type='update' collection='Safetyplans' doc=viewDoc 11 | .row 12 | +afQuickField name='text' 13 | .row 14 | .divider.teal 15 | .section 16 | +afxArrayAdd title='Safety Method' field='safetyMethod' item='safetyMethod' tip='Add Safety Method Task' 17 | +fabBackResetSubmit 18 | else 19 | +spinner 20 | 21 | -------------------------------------------------------------------------------- /client/templates/application/work/editWorkTemplate.coffee: -------------------------------------------------------------------------------- 1 | Template.editWorkTemplatePage.onCreated -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singleWorkplan', Collections.Workplans.Current._id 5 | 6 | Template.editWorkTemplatePage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.editWorkTemplatePage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.editWorkTemplatePage.helpers 14 | customTemplate: -> Customisations.editWorkTemplate 15 | viewDoc: -> Workplans.findOne '_id': Collections.Workplans.Current._id 16 | -------------------------------------------------------------------------------- /client/templates/application/work/editWorkTemplate.jade: -------------------------------------------------------------------------------- 1 | template(name='editWorkTemplatePage') 2 | if customTemplate 3 | +editWorkTemplatePageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.active 8 | legend Work Plan Template 9 | if Template.subscriptionsReady 10 | +autoForm id='editWorkTemplatePage' type='update' collection='Workplans' doc=viewDoc 11 | .row 12 | +afQuickField name='text' 13 | .row 14 | .divider.teal 15 | .section 16 | +afxArrayAdd title='Work Plan' field='workPlan' item='workPlan' tip='Add Task' 17 | +fabBackResetSubmit 18 | else 19 | +spinner 20 | -------------------------------------------------------------------------------- /client/templates/application/work/myWorkorders.coffee: -------------------------------------------------------------------------------- 1 | Template.myWorkordersPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.myWorkordersPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.myWorkordersPage.helpers 9 | myWork: -> Workorders.find {} 10 | spinner: -> 11 | MaterializeModal.loading 12 | nospinner: -> 13 | MaterializeModal.close 14 | numDocs: -> 15 | temp = Counts.get 'workorders-count' 16 | if temp > 1000 17 | FlowRouter.go '/work' 18 | toast 'error', ('Your query exceeds 1000 docs. ('+temp+')') 19 | else 20 | return temp 21 | customTemplate: -> Customisations.viewPeople 22 | settings: -> 23 | return { 24 | rowsPerPage: 10 25 | showFilter: true 26 | fields: [ 27 | { key: '_id', label: 'System ID' } 28 | { key: 'refID', label: 'Reference ID' } 29 | { key: 'assetID', label: 'Asset ID' } 30 | { key: 'assetText', label: 'Asset' } 31 | { key: 'text', label: 'Title' } 32 | { key: 'location', label: 'Start/View/Edit', tmpl: Template.startWO } 33 | { key: 'status', label: 'Status' } 34 | ] 35 | } 36 | 37 | Template.myWorkordersPage.events 38 | 'click .myWorkorders .btnStart': (event) -> 39 | Collections.Workorders.Current = this 40 | FlowRouter.go '/work/my-workorder' 41 | 'click .myWorkorders .btnView': (event) -> 42 | Collections.Workorders.Current = this 43 | FlowRouter.go '/work/view-workorder' 44 | 'click .myWorkorders .btnEdit': (event) -> 45 | Collections.Workorders.Current = this 46 | FlowRouter.go '/work/edit-workorder' 47 | 48 | Template.startWO.onRendered -> 49 | $('.tooltipped').tooltip {delay: 50} 50 | 51 | Template.startWO.onDestroyed -> 52 | $('.tooltipped').tooltip 'remove' 53 | -------------------------------------------------------------------------------- /client/templates/application/work/myWorkorders.jade: -------------------------------------------------------------------------------- 1 | template(name='myWorkordersPage') 2 | if customTemplate 3 | +myWorkordersPageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.myWorkorders 8 | legend My Work 9 | +reactiveTable collection=myWork settings=settings class='table striped' 10 | 11 | +fabBack 12 | 13 | template(name='startWO') 14 | button.btn-floating.waves-effect.waves-light.tooltipped.green.btnStart(type='button', data-delay='50', data-position='bottom', data-tooltip='Start') 15 | i.fa.fa-wrench 16 | button.btn-floating.waves-effect.waves-light.tooltipped.btnView(type='button', data-delay='50', data-position='bottom', data-tooltip='View') 17 | i.fa.fa-eye 18 | button.btn-floating.waves-effect.waves-light.tooltipped.btnEdit(type='button', data-delay='50', data-position='bottom', data-tooltip='Edit') 19 | i.fa.fa-edit 20 | -------------------------------------------------------------------------------- /client/templates/application/work/query.coffee: -------------------------------------------------------------------------------- 1 | Template.workQueryPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.workQueryPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.workQueryPage.helpers 9 | spinner: -> 10 | MaterializeModal.loading 11 | nospinner: -> 12 | MaterializeModal.close 13 | numDocs: -> 14 | temp = Counts.get 'workorders-count' 15 | if temp > 1000 16 | FlowRouter.go '/work' 17 | Materialize.toast('Your query exceeds 1000 docs. ('+temp+')', 3000, 'red') 18 | else 19 | return temp 20 | customTemplate: -> Customisations.viewPeople 21 | settings: -> 22 | return { 23 | rowsPerPage: 10 24 | showFilter: true 25 | fields: [ 26 | { key: '_id', label: 'System ID' } 27 | { key: 'refID', label: 'Reference ID' } 28 | { key: 'reqByFirstName', label: ' First Name' } 29 | { key: 'reqByLastName', label: 'Last Name' } 30 | { key: 'reqDate', label: 'Date Requested' } 31 | { key: 'assetID', label: 'Asset ID' } 32 | { key: 'assetText', label: 'Asset' } 33 | { key: 'reqDescription', label: 'Request' } 34 | { key: 'description', label: 'Description' } 35 | { key: 'location', label: 'View/Edit/Delete', tmpl: Template.editWO } 36 | { key: 'status', label: 'Status' } 37 | ] 38 | } 39 | 40 | Template.workQueryPage.events 41 | 'click .workQuery .btnView': (event) -> 42 | Collections.Workorders.Current = this 43 | FlowRouter.go '/work/view-workorder' 44 | 'click .workQuery .btnEdit': (event) -> 45 | Collections.Workorders.Current = this 46 | FlowRouter.go '/work/edit-workorder' 47 | 'click .workQuery .btnDelete': (event) -> 48 | Collections.Workorders.Current = this 49 | MaterializeModal.display 50 | bodyTemplate: 'workQueryDelete' 51 | title: 'Delete Work Record!' 52 | submitLabel: 'Delete' 53 | closeLabel: 'Cancel' 54 | callback: (error, response) -> 55 | if error 56 | console.error error 57 | else 58 | if response.submit 59 | Meteor.call 'deleteWO', Collections.Workorders.Current._id, (error, result) -> 60 | if error 61 | Materialize.toast("Error", 3000, "red") 62 | else 63 | Materialize.toast("Deleted", 3000, "teal") 64 | return 65 | return 66 | 67 | Template.editWO.onRendered -> 68 | $('.tooltipped').tooltip {delay: 50} 69 | 70 | Template.editWO.onDestroyed -> 71 | $('.tooltipped').tooltip 'remove' 72 | -------------------------------------------------------------------------------- /client/templates/application/work/query.jade: -------------------------------------------------------------------------------- 1 | template(name='workQueryPage') 2 | if customTemplate 3 | +workQueryPageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.workQuery 8 | legend Work 9 | +reactiveTable collection='workorder-data' settings=settings class='table striped' 10 | +fabBack 11 | 12 | template(name='editWO') 13 | button.btn-floating.waves-effect.waves-light.tooltipped.btnView(type='button', data-delay='50', data-position='bottom', data-tooltip='View') 14 | i.fa.fa-eye 15 | button.btn-floating.waves-effect.waves-light.tooltipped.btnEdit(type='button', data-delay='50', data-position='bottom', data-tooltip='Edit') 16 | i.fa.fa-edit 17 | button.btn-floating.waves-effect.waves-light.tooltipped.btnDelete.red(type='button', data-delay='50', data-position='bottom', data-tooltip='Delete') 18 | i.fa.fa-trash 19 | 20 | template(name='workQueryDelete') 21 | h5.red-text Warning this will permanently delete the work request or order! 22 | | This process cannot be undone. 23 | 24 | -------------------------------------------------------------------------------- /client/templates/application/work/safetyTemplates.coffee: -------------------------------------------------------------------------------- 1 | Template.safetyTemplatesPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.safetyTemplatesPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.safetyTemplatesPage.helpers 9 | customTemplate: -> Customisations.safetyTemplates 10 | safetyCollection: -> Safetyplans 11 | settings: -> 12 | return { 13 | rowsPerPage: 10 14 | showFilter: true 15 | fields: [ 16 | { key: 'createdByID', label: ' Created by ID' } 17 | { key: 'text', label: ' Title' } 18 | { key: 'location', label: 'View/Edit/Delete', tmpl: Template.rtViewEditDelete } 19 | ] 20 | } 21 | 22 | Template.safetyTemplatesPage.events 23 | 'click .safetyTemplates .btnView': (event) -> 24 | Collections.Safetyplans.Current = this 25 | FlowRouter.go '/work/view-safety' 26 | 'click .safetyTemplates .btnEdit': (event) -> 27 | Collections.Safetyplans.Current = this 28 | FlowRouter.go '/work/edit-safety' 29 | 'click .safetyTemplates .btnDelete': (event) -> 30 | Collections.Safetyplans.Current = this 31 | MaterializeModal.display 32 | bodyTemplate: 'safetyTemplatesDelete' 33 | title: 'Delete Safety Template!' 34 | submitLabel: 'Delete' 35 | closeLabel: 'Cancel' 36 | callback: (error, response) -> 37 | if error 38 | console.error error 39 | else 40 | if response.submit 41 | Meteor.call 'deleteSafety', Collections.Safetyplans.Current._id, (error, result) -> 42 | if error 43 | toast 'error', error 44 | else 45 | toast 'success', result 46 | return 47 | return 48 | -------------------------------------------------------------------------------- /client/templates/application/work/safetyTemplates.jade: -------------------------------------------------------------------------------- 1 | template(name='safetyTemplatesPage') 2 | if customTemplate 3 | +safetyTemplatesPageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.safetyTemplates 8 | legend Safety Method Templates 9 | a(href='{{pathFor "../work/create-safety"}}') 10 | button.btn-floating.btn-large.waves-effect.waves-light.tooltipped(type='button', data-position='bottom', data-delay='50', data-tooltip='Create new template') 11 | i.fa.fa-file-o 12 | if Template.subscriptionsReady 13 | +reactiveTable collection=safetyCollection settings=settings class='table striped' 14 | +fabBack 15 | 16 | template(name='safetyTemplatesDelete') 17 | h5.red-text Warning this will permanently delete the safety method template! 18 | | This process cannot be undone. 19 | 20 | -------------------------------------------------------------------------------- /client/templates/application/work/viewSafetyTemplate.coffee: -------------------------------------------------------------------------------- 1 | Template.viewSafetyTemplatePage.onCreated -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singleSafetymethod', Collections.Safetyplans.Current._id 5 | 6 | Template.viewSafetyTemplatePage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.viewSafetyTemplatePage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.viewSafetyTemplatePage.helpers 14 | customTemplate: -> Customisations.viewSafetyTemplate 15 | viewDoc: -> Safetyplans.findOne '_id': Collections.Safetyplans.Current._id 16 | schemaSafetyplans: -> Schema.safetyMethodTemplate 17 | collectionSafetyplans: -> Safetyplans 18 | settings: -> { 19 | rowsPerPage: 10 20 | showFilter: true 21 | fields: [ 22 | { key: 'id', label: ' Sequence ID' } 23 | { key: 'activity', label: ' Activity' } 24 | { key: 'hazards', label: ' Hazards' } 25 | { key: 'controls', label: ' Controls' } 26 | { key: 'responsible', label: ' Responsible' } 27 | ] 28 | } 29 | 30 | Template.viewSafetyTemplatePage.events 31 | 'click .btnEdit': (event) -> 32 | FlowRouter.go '/work/edit-safety' 33 | -------------------------------------------------------------------------------- /client/templates/application/work/viewSafetyTemplate.jade: -------------------------------------------------------------------------------- 1 | template(name='viewSafetyTemplatePage') 2 | if customTemplate 3 | +viewSafetyTemplatePageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | +fabBackEdit 8 | fieldset 9 | legend Safety Method Template 10 | if Template.subscriptionsReady 11 | +lgeField label='Title' item=viewDoc.text 12 | .row 13 | .divider.teal 14 | .section 15 | +reactiveTable collection=viewDoc.safetyMethod settings=settings class='table striped' 16 | else 17 | +spinner 18 | -------------------------------------------------------------------------------- /client/templates/application/work/viewWorkTemplate.coffee: -------------------------------------------------------------------------------- 1 | Template.viewWorkTemplatePage.onCreated -> 2 | self = this 3 | self.autorun -> 4 | self.subscribe 'singleWorkplan', Collections.Workplans.Current._id 5 | 6 | Template.viewWorkTemplatePage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.viewWorkTemplatePage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.viewWorkTemplatePage.helpers 14 | customTemplate: -> Customisations.viewWorkTemplate 15 | viewDoc: -> Workplans.findOne '_id': Collections.Workplans.Current._id 16 | -------------------------------------------------------------------------------- /client/templates/application/work/viewWorkTemplate.jade: -------------------------------------------------------------------------------- 1 | template(name='viewWorkTemplatePage') 2 | if customTemplate 3 | +viewWorkTemplatePageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | .form-group 8 | .fixed-action-btn.click-to-toggle(style='bottom: 45px; right: 24px;') 9 | a.btn-floating.btn-large.purple 10 | i.large.mdi-navigation-menu 11 | ul 12 | li 13 | button.btn-floating.yellow.darken-1.tooltipped(type='button', onclick='history.back(-1)', data-position='left', data-tooltip='Go Back') 14 | i.material-icons skip_previous 15 | li 16 | a.btnEdit.btn-floating.blue.tooltipped(href='{{pathFor "edit-work"}}' data-position='left', data-tooltip='Edit') 17 | i.fa.fa-edit 18 | fieldset 19 | legend Work Plan Template 20 | if Template.subscriptionsReady 21 | +autoForm id='viewWorkTemplatePage' type='readonly' collection='Workplans' doc=viewDoc 22 | .row 23 | +afQuickField name='text' 24 | .row 25 | .divider.teal 26 | .section 27 | .row 28 | h6.teal-text Work Plan 29 | +afEachArrayItem name='workPlan' 30 | .col.s12.m6.l3 31 | +afQuickField name=this.name label=false 32 | else 33 | +spinner 34 | 35 | -------------------------------------------------------------------------------- /client/templates/application/work/viewWorkorder.coffee: -------------------------------------------------------------------------------- 1 | Template.viewWorkorderPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewWorkorderPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewWorkorderPage.helpers 9 | customTemplate: -> Customisations.viewAsset 10 | viewDoc: -> Collections.Workorders.Current 11 | workorder: -> Collections.Workorders.Current.status > 2 12 | 13 | Template.viewWoForm.helpers 14 | viewDoc: -> Collections.Workorders.Current 15 | safetyDoc: -> Collections.Workorders.Current.safetyMethod 16 | settingsSafety: -> { 17 | rowsPerPage: 10 18 | showFilter: false 19 | fields: [ 20 | { key: 'id', label: 'Sequence ID'} 21 | { key: 'createdBy', label: 'Created by' } 22 | { key: 'activity', label: ' Activity' } 23 | { key: 'hazards', label: ' Hazards' } 24 | { key: 'controls', label: ' Risk control measures' } 25 | { key: 'responsible', label: 'Responsible' } 26 | { key: 'completedTime', label: 'Completed Time' } 27 | { key: '', label: 'Start/Complete', tmpl: Template.rtViewEditDelete } 28 | ] 29 | } 30 | workDoc: -> Collections.Workorders.Current.workPlan 31 | settingsWork: -> { 32 | rowsPerPage: 10 33 | showFilter: false 34 | fields: [ 35 | { key: 'id', label: 'Sequence ID'} 36 | { key: 'text', label: 'Instructions' } 37 | { key: 'estimatedTime', label: 'Est hrs' } 38 | { key: 'finishTime', label: 'Finish Time' } 39 | { key: 'completedTime', label: 'Completed Time' } 40 | { key: '', label: 'Start/Complete', tmpl: Template.rtViewEditDelete } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /client/templates/application/work/work.coffee: -------------------------------------------------------------------------------- 1 | Template.workPage.onCreated -> 2 | # Set Navbar so Work highlighted 3 | $('#header1DesktopUL li').removeClass 'active' 4 | $('#header1DesktopUL li').eq(1).addClass 'active' 5 | 6 | Template.workPage.onRendered -> 7 | $(".dropdown-button").dropdown() 8 | $('.tooltipped').tooltip {delay: 50} 9 | 10 | Template.workPage.onDestroyed -> 11 | $('.tooltipped').tooltip 'remove' 12 | 13 | Template.workPage.helpers 14 | customTemplate: -> Customisations.work 15 | -------------------------------------------------------------------------------- /client/templates/application/work/work.jade: -------------------------------------------------------------------------------- 1 | template(name='workPage') 2 | if customTemplate 3 | +workPageCustom 4 | else 5 | .container 6 | h1.icon-page {{_ 'work-mgt'}} 7 | .row.flow-text.center-align 8 | .col.s12.m6.l3 9 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "work/create"}}') 10 | i.fa-5x.fa.fa-commenting-o 11 | br 12 | br 13 | | {{_ 'create-request'}} 14 | br 15 | br 16 | .col.s12.m6.l3 17 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "work/view"}}') 18 | i.fa-5x.fa.fa-wrench 19 | br 20 | br 21 | | {{_ 'work'}} 22 | br 23 | br 24 | .col.s12.m6.l3 25 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "work/my-workorders"}}') 26 | i.fa-5x.fa.fa-user 27 | br 28 | br 29 | | {{_ 'my-work'}} 30 | br 31 | br 32 | .col.s12.m6.l3 33 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "work/work-template"}}') 34 | i.fa-5x.fa.fa-file-o 35 | br 36 | br 37 | | {{_ 'work-template'}} 38 | br 39 | br 40 | .col.s12.m6.l3 41 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "work/safety-template"}}') 42 | i.fa-5x.fa.fa-file-o 43 | br 44 | br 45 | | {{_ 'safety-template'}} 46 | br 47 | br 48 | -------------------------------------------------------------------------------- /client/templates/application/work/workTemplates.coffee: -------------------------------------------------------------------------------- 1 | Template.workTemplatesPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.workTemplatesPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.workTemplatesPage.helpers 9 | customTemplate: -> Customisations.workTemplates 10 | workCollection: -> Workplans 11 | settings: -> 12 | return { 13 | rowsPerPage: 10 14 | showFilter: true 15 | fields: [ 16 | { key: 'createdByID', label: ' Created by ID' } 17 | { key: 'text', label: ' Title' } 18 | { key: 'location', label: 'View/Edit/Delete', tmpl: Template.editWork } 19 | ] 20 | } 21 | 22 | Template.workTemplatesPage.events 23 | 'click .workTemplates .btnView': (event) -> 24 | Collections.Workplans.Current = this 25 | FlowRouter.go '/work/view-work' 26 | 'click .workTemplates .btnEdit': (event) -> 27 | Collections.Workplans.Current = this 28 | FlowRouter.go '/work/edit-work' 29 | 'click .workTemplates .btnDelete': (event) -> 30 | Collections.Workplans.Current = this 31 | MaterializeModal.display 32 | bodyTemplate: 'workTemplatesDelete' 33 | title: 'Delete Work Template!' 34 | submitLabel: 'Delete' 35 | closeLabel: 'Cancel' 36 | callback: (error, response) -> 37 | if error 38 | console.error error 39 | else 40 | if response.submit 41 | Meteor.call 'deleteWork', Collections.Workplans.Current._id, (error, result) -> 42 | if error 43 | Materialize.toast("Error", 3000, "red") 44 | else 45 | Materialize.toast("Deleted", 3000, "teal") 46 | return 47 | return 48 | 49 | Template.editWork.onRendered -> 50 | $('.tooltipped').tooltip {delay: 50} 51 | 52 | Template.editWork.onDestroyed -> 53 | $('.tooltipped').tooltip 'remove' 54 | -------------------------------------------------------------------------------- /client/templates/application/work/workTemplates.jade: -------------------------------------------------------------------------------- 1 | template(name='workTemplatesPage') 2 | if customTemplate 3 | +workTemplatesPageCustom 4 | else 5 | .flow-text.container2 6 | br 7 | fieldset.workTemplates 8 | legend Work Templates 9 | a(href='{{pathFor "../work/create-work"}}') 10 | button.btn-floating.btn-large.waves-effect.waves-light.tooltipped(type='button', data-position='bottom', data-delay='50', data-tooltip='Create new template') 11 | i.fa.fa-file-o 12 | if Template.subscriptionsReady 13 | +reactiveTable collection=workCollection settings=settings class='table striped' 14 | +fabBack 15 | 16 | template(name='editWork') 17 | button.btn-floating.waves-effect.waves-light.tooltipped.btnView(type='button', data-delay='50', data-position='bottom', data-tooltip='View') 18 | i.fa.fa-eye 19 | button.btn-floating.waves-effect.waves-light.tooltipped.btnEdit(type='button', data-delay='50', data-position='bottom', data-tooltip='Edit') 20 | i.fa.fa-edit 21 | button.btn-floating.waves-effect.waves-light.tooltipped.btnDelete.red(type='button', data-delay='50', data-position='bottom', data-tooltip='Delete') 22 | i.fa.fa-trash 23 | 24 | template(name='workTemplatesDelete') 25 | h5.red-text Warning this will permanently delete the work Plan template! 26 | | This process cannot be undone. 27 | 28 | -------------------------------------------------------------------------------- /client/templates/includes/access_denied.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /client/templates/includes/loading.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /client/templates/includes/signin.html: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /client/templates/layouts/about.coffee: -------------------------------------------------------------------------------- 1 | Template.aboutPage.onCreated -> 2 | # Set Navbar so About highlighted 3 | $("#header1DesktopUL li").removeClass "active" 4 | $("#header1DesktopUL li").eq(8).addClass "active" 5 | -------------------------------------------------------------------------------- /client/templates/layouts/classification/createClassification.coffee: -------------------------------------------------------------------------------- 1 | Template.createClassificationPage.helpers 2 | parentID: -> Session.get('currentClassID').toString() 3 | children: -> [] 4 | ClassificationFormSchema: -> Schema.classification 5 | -------------------------------------------------------------------------------- /client/templates/layouts/classification/createClassification.jade: -------------------------------------------------------------------------------- 1 | template(name='createClassificationPage') 2 | .container2 3 | br 4 | +autoForm schema=ClassificationFormSchema id='createClassificationPage' type='method' meteormethod='createClassification' 5 | fieldset 6 | legend New Classification 7 | .row 8 | +afQuickField name='id' type='hidden' 9 | +afQuickField name='type' value=classificationType type='hidden' 10 | +afQuickField name='parent' value=parentID defaultValue='#' type='hidden' 11 | .col.s12.m6.l3 12 | +afQuickField name='classificationID' 13 | +smlField label='Classification Type' item=classificationType 14 | div 15 | +afQuickField name='text' 16 | div 17 | +afQuickField name='description' 18 | +fabBackResetSubmit 19 | br 20 | -------------------------------------------------------------------------------- /client/templates/layouts/classification/editClassification.coffee: -------------------------------------------------------------------------------- 1 | Template.editClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.editClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.editClassificationPage.helpers 9 | classificationFormSchema: -> Schema.classification 10 | classDoc: -> Collections.Classification.Current 11 | -------------------------------------------------------------------------------- /client/templates/layouts/classification/editClassification.jade: -------------------------------------------------------------------------------- 1 | template(name='editClassificationPage') 2 | .container2 3 | br 4 | fieldset 5 | legend Edit Classification 6 | +autoForm schema=classificationFormSchema id="editClassificationPage" type="update" collection="Classification" doc=classDoc 7 | if Template.subscriptionsReady 8 | .row 9 | +afQuickField name="parent" type="hidden" 10 | +afQuickField name="treePath" type="hidden" 11 | +afQuickField name="type" type="hidden" 12 | .col.s12.m6.l3 13 | +afQuickField name="classificationID" 14 | div 15 | +afQuickField name="text" 16 | div 17 | +afQuickField name="description" 18 | div 19 | else 20 | +spinner 21 | +fabBackResetSubmit 22 | -------------------------------------------------------------------------------- /client/templates/layouts/classification/viewClassification.coffee: -------------------------------------------------------------------------------- 1 | Template.viewClassificationPage.onRendered -> 2 | $(".dropdown-button").dropdown() 3 | $('.tooltipped').tooltip {delay: 50} 4 | 5 | Template.viewClassificationPage.onDestroyed -> 6 | $('.tooltipped').tooltip 'remove' 7 | 8 | Template.viewClassificationPage.helpers 9 | ClassificationFormSchema: -> Schema.classification 10 | -------------------------------------------------------------------------------- /client/templates/layouts/classification/viewClassification.jade: -------------------------------------------------------------------------------- 1 | template(name='viewClassificationPage') 2 | .flow-text.container2.viewClassification 3 | +fabBackCopyEdit 4 | br 5 | fieldset 6 | legend View Asset 7 | +autoForm schema=ClassificationFormSchema id="viewClassificationPage" type="readonly" collection="Classification" doc=classDoc 8 | if Template.subscriptionsReady 9 | .row 10 | h6.teal-text Classification Details 11 | .col.s12.m6.l3 12 | +afQuickField name="id" 13 | .col.s12.m6.l3 14 | +afQuickField name="classificationID" 15 | div 16 | +afQuickField name="text" 17 | div 18 | +afQuickField name="description" 19 | else 20 | +spinner 21 | -------------------------------------------------------------------------------- /client/templates/layouts/forms/autoform.coffee: -------------------------------------------------------------------------------- 1 | Template.afxSmlQuickFieldAdd.onRendered -> 2 | $('.tooltipped').tooltip {delay: 50} 3 | Template.afxSmlQuickFieldAdd.onDestroyed -> 4 | $('.tooltipped').tooltip 'remove' 5 | 6 | Template.afxArrayAdd.onRendered -> 7 | $('.tooltipped').tooltip {delay: 50} 8 | Template.afxArrayAdd.onDestroyed -> 9 | $('.tooltipped').tooltip 'remove' 10 | 11 | Template.afxArrayAddCreate.onRendered -> 12 | $('.tooltipped').tooltip {delay: 50} 13 | Template.afxArrayAddCreate.onDestroyed -> 14 | $('.tooltipped').tooltip 'remove' 15 | -------------------------------------------------------------------------------- /client/templates/layouts/forms/autoform.jade: -------------------------------------------------------------------------------- 1 | template(name='afxSmlQuickFieldAdd') 2 | .col.s12.m6.l3 3 | h6 4 | =title 5 | button.autoform-add-item.btn-floating.waves-effect.waves-light.tooltipped.btnAdd(type='button', data-autoform-field=field, data-position='bottom', data-tooltip=tip) 6 | i.fa.fa-plus 7 | +afQuickField name=item 8 | 9 | template(name='afxArrayAdd') 10 | .row 11 | h6.teal-text 12 | =title 13 | button.autoform-add-item.btn-floating.waves-effect.waves-light.teal(type='button', data-autoform-field=field, data-position='bottom', data-tooltip=tip) 14 | i.fa.fa-plus 15 | +afEachArrayItem name=item 16 | .col.s12.m6.l3 17 | button.autoform-remove-item.btn-floating.waves-effect.waves-light.red(type='button', data-position='bottom', data-tooltip='Remove') 18 | i.fa.fa-trash 19 | +afQuickField name=this.name label=false 20 | 21 | template(name='afxArrayAddCreate') 22 | .row 23 | h6.teal-text 24 | =title 25 | button.autoform-add-item.btn-floating.waves-effect.waves-light.tooltipped(type='button', data-autoform-field=field, data-position='bottom', data-tooltip=tip) 26 | i.fa.fa-plus 27 | button.btn-floating.waves-effect.waves-light.tooltipped.btnTemplate(type='button', data-position='bottom', data-tooltip=tip2) 28 | i.fa.fa-file-o 29 | +afEachArrayItem name=item 30 | .col.s12.m6.l3 31 | button.autoform-remove-item.btn-floating.waves-effect.waves-light.red(type='button', data-position='bottom', data-tooltip='Remove') 32 | i.fa.fa-trash 33 | +afQuickField name=this.name label=false 34 | -------------------------------------------------------------------------------- /client/templates/layouts/forms/forms.coffee: -------------------------------------------------------------------------------- 1 | Template.smlDateField.helpers 2 | dateItem: -> 3 | if this.item 4 | dateToText(this.item) 5 | 6 | Template.fabBackResetSubmit.events 7 | 'click .btnBack': (event) -> 8 | $('.tooltipped').tooltip 'remove' 9 | FlowRouter.go history.back() 10 | 11 | Template.fabBack.events 12 | 'click .btnBack': (event) -> 13 | $('.tooltipped').tooltip 'remove' 14 | FlowRouter.go history.back() 15 | 16 | Template.fabBackSubmit.events 17 | 'click .btnBack': (event) -> 18 | $('.tooltipped').tooltip 'remove' 19 | FlowRouter.go history.back() 20 | 21 | Template.fabBackCopyEdit.events 22 | 'click .btnBack': (event) -> 23 | $('.tooltipped').tooltip 'remove' 24 | FlowRouter.go history.back() 25 | 26 | Template.fabBackEdit.events 27 | 'click .btnBack': (event) -> 28 | $('.tooltipped').tooltip 'remove' 29 | FlowRouter.go history.back() 30 | 31 | Template.fabBackSearch.events 32 | 'click .btnBack': (event) -> 33 | $('.tooltipped').tooltip 'remove' 34 | FlowRouter.go history.back() 35 | -------------------------------------------------------------------------------- /client/templates/layouts/forms/reactive-table.coffee: -------------------------------------------------------------------------------- 1 | Template.rtViewEditDelete.onRendered -> 2 | $('.tooltipped').tooltip {delay: 50} 3 | Template.rtViewEditDelete.onDestroyed -> 4 | $('.tooltipped').tooltip 'remove' 5 | 6 | Template.rtEditDelete.onRendered -> 7 | $('.tooltipped').tooltip {delay: 50} 8 | Template.rtEditDelete.onDestroyed -> 9 | $('.tooltipped').tooltip 'remove' 10 | 11 | Template.rtDelete.onRendered -> 12 | $('.tooltipped').tooltip {delay: 50} 13 | Template.rtDelete.onDestroyed -> 14 | $('.tooltipped').tooltip 'remove' 15 | 16 | Template.rtAdd.onRendered -> 17 | $('.tooltipped').tooltip {delay: 50} 18 | Template.rtAdd.onDestroyed -> 19 | $('.tooltipped').tooltip 'remove' 20 | 21 | Template.rtEdit.onRendered -> 22 | $('.tooltipped').tooltip {delay: 50} 23 | Template.rtEdit.onDestroyed -> 24 | $('.tooltipped').tooltip 'remove' 25 | 26 | Template.rtBoolean.onRendered -> 27 | $('.tooltipped').tooltip {delay: 50} 28 | Template.rtBoolean.onDestroyed -> 29 | $('.tooltipped').tooltip 'remove' 30 | 31 | Template.rtViewEditReceivedDelete.onRendered -> 32 | $('.tooltipped').tooltip {delay: 50} 33 | Template.rtViewEditReceivedDelete.onDestroyed -> 34 | $('.tooltipped').tooltip 'remove' 35 | 36 | Template.rtEditMoveIssue.onRendered -> 37 | $('.tooltipped').tooltip {delay: 50} 38 | Template.rtEditMoveIssue.onDestroyed -> 39 | $('.tooltipped').tooltip 'remove' 40 | -------------------------------------------------------------------------------- /client/templates/layouts/forms/treeview.coffee: -------------------------------------------------------------------------------- 1 | @dataTree = (treeData, treeType) -> 2 | # Initialize Treeview 3 | to = false 4 | $('.view_q').keyup -> 5 | if to 6 | clearTimeout to 7 | to = setTimeout((-> 8 | v = $('.view_q').val() 9 | $('.tree_view').jstree(true).search v 10 | return 11 | ), 250) 12 | return 13 | $('.tree_view').on 'changed.jstree', (e, data) -> 14 | if data.selected.length != 0 15 | if treeType == 'general' 16 | Session.set 'currentID', data.selected 17 | else 18 | Session.set 'currentClassID', data.selected 19 | else 20 | if treeType == 'general' 21 | Session.set 'currentID', '#' 22 | else 23 | Session.set 'currentClassID', '#' 24 | return 25 | if !treeData 26 | console.log 'No data source defined for treeview' 27 | $('.tree_view').jstree 28 | 'core': 29 | 'animation': 0 30 | 'multiple': false 31 | 'check_callback': true 32 | 'themes': 33 | 'stripes': true 34 | 'responsive': true 35 | 'variant': 'large' 36 | 'check_callback' : true 37 | 'data': treeData 38 | 'types': 39 | '#': 40 | 'max_children': -1 41 | 'max_depth': -1 42 | 'valid_children': -1 43 | 'default': 44 | 'icon': 'fa fa-map-marker teal lighten-4' 45 | 'valid_children': -1 46 | 'root': 47 | 'icon': 'fa fa-flash teal lighten-4' 48 | 'valid_children': -1 49 | 'asset': 50 | 'icon': 'fa fa-industry teal lighten-4' 51 | 'valid_children': -1 52 | 'asset-classification': 53 | 'icon': 'fa fa-sitemap teal lighten-4' 54 | 'valid_children': -1 55 | 'item-classification': 56 | 'icon': 'fa fa-sitemap teal lighten-4' 57 | 'valid_children': -1 58 | 'database': 59 | 'icon': 'fa fa-database teal lighten-4' 60 | 'valid_children': -1 61 | 'plugins': [ 62 | 'search' 63 | 'state' 64 | 'types' 65 | 'wholerow' 66 | ] 67 | return 68 | -------------------------------------------------------------------------------- /client/templates/layouts/forms/treeview.jade: -------------------------------------------------------------------------------- 1 | template(name='treeViewAdd') 2 | .row 3 | .col.s12.m3.l2.z-depth-1(style='text-align:right;') 4 | input.view_q(type='text', value='', placeholder='Search') 5 | .row.treeview 6 | .row.teal.lighten-1.white-text.z-depth-1 7 | = nodeID 8 | | - 9 | = nodeText 10 | button.autoform-add-item.btn-floating.waves-effect.waves-light.green.tooltipped.btnAdd(type='button', data-autoform-field='workPlan', data-position='bottom', data-tooltip='Add Asset') 11 | i.fa.fa-plus 12 | .tree_view.row.treeview.z-depth-1 13 | 14 | template(name='treeView') 15 | .row 16 | .col.s12.m3.l2.z-depth-1(style='text-align:right;') 17 | input.view_q(type='text', value='', placeholder='Search') 18 | .row.treeview 19 | .row.teal.lighten-1.white-text.z-depth-1 20 | = nodeID 21 | | - 22 | = nodeText 23 | .tree_view.row.treeview.z-depth-1 24 | 25 | template(name='treeViewSimple') 26 | .row 27 | .col.s12.m3.l2.z-depth-1(style='text-align:right;') 28 | input.view_q(type='text', value='', placeholder='Search') 29 | .row.treeview 30 | .tree_view.row.treeview.z-depth-1 31 | -------------------------------------------------------------------------------- /client/templates/layouts/layout.coffee: -------------------------------------------------------------------------------- 1 | # Initialize collapse button 2 | Template.layout.onRendered -> 3 | $(".dropdown-button").dropdown() 4 | $('.button-collapse').sideNav { closeOnClick: true } 5 | 6 | Template.layoutAssets.onRendered -> 7 | $('.button-collapse').sideNav { closeOnClick: true } 8 | 9 | Template.layoutPM.onRendered -> 10 | $('.button-collapse').sideNav { closeOnClick: true } 11 | 12 | Template.layoutResources.onRendered -> 13 | $('.button-collapse').sideNav { closeOnClick: true } 14 | 15 | Template.layoutWork.onRendered -> 16 | $('.button-collapse').sideNav { closeOnClick: true } 17 | 18 | Template.layoutInventory.onRendered -> 19 | $('.button-collapse').sideNav { closeOnClick: true } 20 | 21 | # Set relevant classification type 22 | Template.layoutAssets.onCreated -> 23 | Session.set 'currentClass', 'asset-classification' 24 | 25 | # Subscriptions 26 | Template.layoutPM.onCreated -> 27 | self = this 28 | self.autorun -> 29 | self.subscribe 'pm' 30 | self.subscribe 'assetGroups' 31 | self.subscribe 'safetyplans' 32 | self.subscribe 'workplans' 33 | 34 | Template.layoutWork.onCreated -> 35 | self = this 36 | self.autorun -> 37 | self.subscribe 'my-work', Meteor.userId() 38 | self.subscribe 'safetyplans' 39 | self.subscribe 'workplans' 40 | 41 | Template.layoutInventory.onCreated -> 42 | self = this 43 | self.autorun -> 44 | self.subscribe 'classification' 45 | self.subscribe 'bins' 46 | self.subscribe 'items' 47 | self.subscribe 'equipment' 48 | 49 | Template.layoutProcurement.onCreated -> 50 | self = this 51 | self.autorun -> 52 | self.subscribe 'companies' 53 | 54 | #Helpers 55 | Template.header1.helpers 56 | serverConnected: -> (Meteor.status().status == "connected") 57 | userSignedIn: -> 58 | if (Meteor.userId()) 59 | return true 60 | else 61 | return false 62 | currentUser: -> Meteor.userId() 63 | 64 | Template.header1.events 65 | 'click #btnheader1Logout': -> AccountsTemplates.logout() 66 | -------------------------------------------------------------------------------- /client/templates/layouts/notFound.jade: -------------------------------------------------------------------------------- 1 | template(name='notFound') 2 | br 3 | h1 Not found! 4 | br 5 | -------------------------------------------------------------------------------- /client/templates/layouts/toast.coffee: -------------------------------------------------------------------------------- 1 | if Meteor.isClient 2 | @toast = (type, msg) -> 3 | time = 3000 4 | if type=='success' 5 | Materialize.toast(msg, time, 'green') 6 | console.log 'Success: '+msg 7 | else if type=='error' 8 | Materialize.toast(msg, time, 'red') 9 | console.log 'Error: '+msg 10 | else if type=='warning' 11 | Materialize.toast(msg, time, 'orange') 12 | console.log 'Warning: '+msg 13 | else if type=='info' 14 | Materialize.toast(msg, time, 'teal') 15 | console.log 'Info: '+msg 16 | -------------------------------------------------------------------------------- /client/templates/layouts/welcome.coffee: -------------------------------------------------------------------------------- 1 | Template.welcomePage.onCreated -> 2 | # Clear Navbar highlighting 3 | $("#header1DesktopUL li").removeClass "active" 4 | 5 | Template.welcomePage.helpers 6 | customTemplate: -> Customisations.welcome 7 | -------------------------------------------------------------------------------- /client/templates/layouts/welcome.jade: -------------------------------------------------------------------------------- 1 | template(name='welcomePage') 2 | if customTemplate 3 | +welcomePageCustom 4 | else 5 | #welcome 6 | .container.center-align 7 | br 8 | .hide-on-small-only.icon-page 9 | i.fa-5x.fa.fa-flash 10 | h1 {{_ 'layouts-welcome1'}} 11 | h5 {{_ 'layouts-welcome2'}} 12 | br 13 | .hide-on-med-and-up.icon-page 14 | h5 {{_ 'layouts-welcome1'}} 15 | br 16 | .row 17 | .col.s6.m4.l3 18 | a.waves-effect.waves-dark.icon-page(href='{{pathFor "assets/view-locations"}}') 19 | i.fa-5x.fa.fa-industry 20 | br 21 | br 22 | | {{_ 'assets'}} 23 | br 24 | br 25 | .col.s6.m4.l3 26 | a.waves-effect.waves-dark.icon-page(href="{{pathFor '/work'}}") 27 | i.fa-5x.fa.fa-wrench 28 | br 29 | br 30 | | {{_ 'work'}} 31 | br 32 | br 33 | .col.s6.m4.l3 34 | a.waves-effect.waves-dark.icon-page(href="{{pathFor '/pm'}}") 35 | i.fa-5x.fa.fa-calendar 36 | br 37 | br 38 | | Planned Maint 39 | br 40 | br 41 | .col.s6.m4.l3 42 | a.waves-effect.waves-dark.icon-page(href="{{pathFor '/resources/view-people'}}") 43 | i.fa-5x.fa.fa-users 44 | br 45 | br 46 | | Resources 47 | br 48 | br 49 | .col.s6.m4.l3 50 | a.waves-effect.waves-dark.icon-page(href="{{pathFor '/procurement'}}") 51 | i.fa-5x.fa.fa-credit-card 52 | br 53 | br 54 | | Procurement 55 | br 56 | br 57 | .col.s6.m4.l3 58 | a.waves-effect.waves-dark.icon-page(href="{{pathFor '/inventory'}}") 59 | i.fa-5x.fa.fa-cubes 60 | br 61 | br 62 | | Inventory 63 | br 64 | br 65 | .col.s6.m4.l3 66 | a.waves-effect.waves-dark.icon-page(href="{{pathFor '/reports'}}") 67 | i.fa-5x.fa.fa-line-chart 68 | br 69 | br 70 | | Reports 71 | br 72 | br 73 | .col.s6.m4.l3 74 | a.waves-effect.waves-dark.icon-page(href="{{pathFor '/help'}}") 75 | i.fa-5x.fa.fa-life-bouy 76 | br 77 | br 78 | | Help 79 | br 80 | br 81 | -------------------------------------------------------------------------------- /lib/collections/0Global.coffee: -------------------------------------------------------------------------------- 1 | #************************** Global Variables ********************************** 2 | 3 | @Schema = {} 4 | 5 | @Lists = {} 6 | 7 | @Lists.Classification = {} 8 | @Lists.Locations = {} 9 | @Lists.Resources = {} 10 | @Lists.Workorders = {} 11 | @Lists.Inventory = {} 12 | @Lists.PM = {} 13 | @Lists.Companies = {} 14 | @Lists.Purchases = {} 15 | 16 | @Customisations = {} 17 | 18 | @Collections = {} 19 | 20 | @Collections.Classification = {} 21 | @Collections.Classification.Current = {} 22 | @Collections.Classification.CurrentID = 0 23 | @Collections.Classification.Folder = '' 24 | 25 | @Collections.Locations = {} 26 | @Collections.Locations.Current = {} 27 | @Collections.Locations.CurrentID = 0 28 | @Collections.Locations.CurrentMeter = {} 29 | @Collections.Locations.CurrentMeterID = 0 30 | 31 | @Collections.Users = {} 32 | @Collections.Users.Current = {} 33 | 34 | @Collections.Workorders = {} 35 | @Collections.Workorders.Current = {} 36 | @Collections.Workorders.CurrentID = 0 37 | @Collections.Workorders.workQuery = {} 38 | @Collections.Workorders.Clock = {} 39 | 40 | @Collections.Safetyplans = {} 41 | @Collections.Safetyplans.Current = {} 42 | @Collections.Safetyplans.CurrentID = 0 43 | 44 | @Collections.Workplans = {} 45 | @Collections.Workplans.Current = {} 46 | @Collections.Workplans.CurrentID = 0 47 | 48 | @Collections.PM = {} 49 | @Collections.PM.Current = {} 50 | @Collections.PM.CurrentID = 0 51 | 52 | @Collections.Assetgroups = {} 53 | @Collections.Assetgroups.Current = {} 54 | @Collections.Assetgroups.CurrentID = 0 55 | 56 | @Collections.Crontasks = {} 57 | @Collections.Crontasks.Current = {} 58 | @Collections.Crontasks.CurrentID = 0 59 | 60 | @Collections.Items = {} 61 | @Collections.Items.Current = {} 62 | @Collections.Items.CurrentID = 0 63 | 64 | @Collections.Equipment = {} 65 | @Collections.Equipment.Current = {} 66 | @Collections.Equipment.CurrentID = 0 67 | 68 | @Collections.Bins = {} 69 | @Collections.Bins.Current = {} 70 | @Collections.Bins.CurrentID = 0 71 | 72 | 73 | @Collections.BOM = {} 74 | @Collections.BOM.Current = {} 75 | @Collections.BOM.CurrentID = 0 76 | 77 | @Collections.Companies = {} 78 | @Collections.Companies.Current = {} 79 | @Collections.Companies.CurrentID = 0 80 | 81 | @Collections.Purchases = {} 82 | @Collections.Purchases.Current = {} 83 | @Collections.Purchases.CurrentID = 0 84 | -------------------------------------------------------------------------------- /lib/collections/Collections.coffee: -------------------------------------------------------------------------------- 1 | #************************** Assets / Locations ******************************** 2 | @Locations = new Mongo.Collection 'locations', transform: (doc) -> 3 | if doc.assetClassificationID 4 | doc.assetClassification = Classification.findOne {'_id': doc.assetClassificationID }, { fields: 5 | text: true} 6 | doc 7 | 8 | #************************** Classifications *********************************** 9 | @Classification = new Mongo.Collection 'classification' 10 | 11 | #************************** Work ********************************************** 12 | @Workorders = new Mongo.Collection 'workorders' 13 | if Meteor.isServer 14 | Workorders._ensureIndex {status: 1} 15 | Workorders._ensureIndex {asset_ID: 1} 16 | 17 | @Workplans = new Mongo.Collection 'workplans' 18 | @Safetyplans = new Mongo.Collection 'safetyplans' 19 | 20 | #************************** PM ************************************************ 21 | @Assetgroups = new Mongo.Collection 'assetgroups', transform: (doc) -> 22 | if doc.asset_IDs 23 | doc.assetList = Locations.find( {'_id': {'$in': doc.asset_IDs} }, { fields: 24 | text: true 25 | assetID: true 26 | parent: true 27 | treePath: true 28 | meters: true} ).fetch() 29 | doc 30 | 31 | @PM = new Mongo.Collection 'pm', transform: (doc) -> 32 | if doc.assetGroup_ID 33 | doc.assetGroupDetails = Assetgroups.findOne {'_id': doc.assetGroup_ID } 34 | if doc.workPlan_ID 35 | doc.workPlanDetails = Workplans.findOne {'_id': doc.workPlan_ID } 36 | if doc.safetyPlan_ID 37 | doc.safetyPlanDetails = Safetyplans.findOne {'_id': doc.safetyPlan_ID } 38 | if doc.createdBy_id 39 | doc.userDetails = Meteor.users.findOne {'_id': doc.createdBy_id }, fields: 40 | profile: true 41 | doc 42 | if Meteor.isServer 43 | PM._ensureIndex {workorderPM: 1} 44 | 45 | if Meteor.isServer 46 | @Crontasks = new Mongo.Collection 'crontasks' 47 | 48 | #************************** Inventory **************************************** 49 | @Bins = new Mongo.Collection 'bins' 50 | @Items = new Mongo.Collection 'items' 51 | @Equipment = new Mongo.Collection 'equipment' 52 | @BOM = new Mongo.Collection 'bom' 53 | 54 | #************************** Procurement *************************************** 55 | @Companies = new Mongo.Collection 'companies' 56 | @Purchases = new Mongo.Collection 'purchases', transform: (doc) -> 57 | if doc.billing_ID 58 | doc.billingDetails = Companies.findOne {'_id': doc.billing_ID} 59 | if doc.supplier_ID 60 | doc.supplierDetails = Companies.findOne {'_id': doc.supplier_ID} 61 | doc 62 | -------------------------------------------------------------------------------- /lib/collections/schema0General.coffee: -------------------------------------------------------------------------------- 1 | ###************************* Classification *********************************### 2 | Classification.allow 3 | insert: -> 4 | true 5 | update: -> 6 | true 7 | remove: -> 8 | true 9 | 10 | Schema.classification = new SimpleSchema( 11 | id: #Copy of _id used by treeView 12 | type: String 13 | label: 'Sys ID' 14 | optional: true 15 | createdDate: 16 | type: Date 17 | label: 'Created Date' 18 | optional: true 19 | classificationID: 20 | type: String 21 | label: 'ID' 22 | optional: true 23 | text: 24 | type: String 25 | label: 'Title' 26 | parent: 27 | type: String 28 | label: 'Parent Sys ID' 29 | defaultValue: '#' 30 | treePath: 31 | type: [String] 32 | label: 'Tree Path' 33 | optional: true 34 | type: 35 | type: String 36 | label: 'Type' 37 | autoform: 38 | type: 'select' 39 | options: -> 40 | [ 41 | { 42 | label: 'Asset Classification' 43 | value: 'asset-classification' 44 | } 45 | { 46 | label: 'Item Classification' 47 | value: 'item-classification' 48 | } 49 | { 50 | label: 'Equipment Classification' 51 | value: 'equipment-classification' 52 | } 53 | { 54 | label: 'Inventory Location Classification' 55 | value: 'invloc-classification' 56 | } 57 | ] 58 | description: 59 | type: String 60 | label: 'Description' 61 | optional: true 62 | ) 63 | -------------------------------------------------------------------------------- /lib/config/accounts_t9n.js: -------------------------------------------------------------------------------- 1 | T9n.setLanguage('en'); 2 | -------------------------------------------------------------------------------- /lib/config/at_config.js: -------------------------------------------------------------------------------- 1 | // Options 2 | AccountsTemplates.configure({ 3 | defaultTemplate: 'signInPage', 4 | defaultLayout: 'layoutSignIn', 5 | defaultLayoutRegions: { 6 | header: 'header1', 7 | footer: 'footer1' 8 | }, 9 | defaultContentRegion: 'content', 10 | 11 | //defaultLayout: 'emptyLayout', 12 | showForgotPasswordLink: true, 13 | overrideLoginErrors: true, 14 | enablePasswordChange: true, 15 | //sendVerificationEmail: true, 16 | 17 | //enforceEmailVerification: true, 18 | //confirmPassword: true, 19 | //continuousValidation: false, 20 | //displayFormLabels: true, 21 | //forbidClientAccountCreation: false, 22 | //formValidationFeedback: true, 23 | //homeRoutePath: '/', 24 | //showAddRemoveServices: false, 25 | //showPlaceholders: true, 26 | 27 | negativeValidation: true, 28 | positiveValidation:true, 29 | negativeFeedback: false, 30 | positiveFeedback:true, 31 | 32 | // Privacy Policy and Terms of Use 33 | //privacyUrl: 'privacy', 34 | //termsUrl: 'terms-of-use', 35 | 36 | }); 37 | 38 | AccountsTemplates.addFields([ 39 | { 40 | _id: "firstName", 41 | type: "text", 42 | displayName: "First Name", 43 | required: true 44 | }, 45 | { 46 | _id: "lastName", 47 | type: "text", 48 | displayName: "Last Name", 49 | required: true 50 | } 51 | ]); 52 | 53 | //Routes 54 | AccountsTemplates.configureRoute('changePwd'); 55 | AccountsTemplates.configureRoute('forgotPwd'); 56 | AccountsTemplates.configureRoute('resetPwd'); 57 | AccountsTemplates.configureRoute('enrollAccount'); 58 | AccountsTemplates.configureRoute('signIn'); 59 | AccountsTemplates.configureRoute('signUp'); 60 | AccountsTemplates.configureRoute('verifyEmail'); 61 | -------------------------------------------------------------------------------- /lib/custom/inventoryLists.coffee: -------------------------------------------------------------------------------- 1 | # User editable lists 2 | Lists.Inventory.Units = { 3 | 'units': 'Units' 4 | 'kg': 'Kilograms' 5 | 'grams': 'Grams' 6 | 'litres': 'Litres' 7 | 'mm': 'Millimeters' 8 | 'm': 'Meters' 9 | } 10 | Lists.Inventory.LocationTypes = { 11 | 'site': 'Site' 12 | 'warehouse': 'Warehouse' 13 | 'store': 'Store' 14 | 'aisle': 'Aisle' 15 | 'bay': 'Bay' 16 | 'shelf': 'Shelf' 17 | 'bin': 'Bin' 18 | } 19 | -------------------------------------------------------------------------------- /lib/custom/locationsLists.coffee: -------------------------------------------------------------------------------- 1 | # User editable lists 2 | Lists.Locations.Criticality = { 3 | 5: '5 - Highly Critical' 4 | 4: '4 - Critical' 5 | 3: '3 - Very Important' 6 | 2: '2 - Important' 7 | 1: '1 - Not Important' 8 | } 9 | Lists.Locations.Classification = { 10 | 'pump': 'Pump' 11 | 'emotor': 'Electric Motor' 12 | 'gearbox': 'Gearbox' 13 | 'pvessel': 'Pressure Vessel' 14 | 'valve': 'Valve' 15 | } 16 | Lists.Locations.Status = { 17 | 'inservice': 'In Service' 18 | 'outservice': 'Out of Service' 19 | 'downpm': 'Down for Planned Maintenance' 20 | 'downbreak': 'Down for Breakdown Maintenance' 21 | 'unsafe': 'Unsafe' 22 | } 23 | -------------------------------------------------------------------------------- /lib/custom/procurementLists.coffee: -------------------------------------------------------------------------------- 1 | # User editable lists 2 | 3 | Lists.Purchases.Priority = { 4 | 5: '5 - Emergency' 5 | 4: '4 - Immediate' 6 | 3: '3 - High Priority' 7 | 2: '2 - Medium Priority' 8 | 1: '1 - Low Priority' 9 | 0: '0 - No Priority' 10 | } 11 | 12 | Lists.Purchases.Freight = { 13 | 'regular': 'Regular Post' 14 | 'express': 'Express Post' 15 | 'local': 'Local Courier' 16 | 'int-courier': 'International Courier' 17 | } 18 | -------------------------------------------------------------------------------- /lib/custom/readme.txt: -------------------------------------------------------------------------------- 1 | The custom folder contains user customizations. 2 | 3 | The lists folder contains user customizable lists. You can modify lists with low risk of application damage. 4 | 5 | There is also a folder in client/templates/application for custom templates and a folder at lib/collections/custom for custom methods. 6 | **** Custom templates and methods pose a high risk of damaging the application and data integrity. Use lists where possible **** 7 | 8 | When upgrading application all customizations will need to be saved and re-applied and tested after upgrade. 9 | -------------------------------------------------------------------------------- /lib/custom/resourcesLists.coffee: -------------------------------------------------------------------------------- 1 | # User editable lists 2 | Lists.Resources.Trades = { 3 | 'NoTrade': 'Unskilled-No Trade' 4 | 'professional': 'Professional-No Trade' 5 | 'AppServTech': 'Appliance Service Technician' 6 | 'AutoBodyTech': 'Auto Body Technician' 7 | 'AutoServTech': 'Automotive Service Technician' 8 | 'Boilermaker': 'Boilermaker' 9 | 'CraneOp': 'Crane and Hoisting Equipment Operator' 10 | 'CraneTech': 'Crane and Hoisting Equipment Technician' 11 | 'Electrician': 'Electrician' 12 | 'Fitter': 'Fitter' 13 | 'Gasfitter': 'Gasfitter' 14 | 'HVACMech': 'HVAC Mechanic' 15 | 'HeavyEqTech': 'Heavy Equipment Technician' 16 | 'Ironworker': 'Ironworker' 17 | 'MachineOp': 'Machine Operator' 18 | 'Machinist': 'Machinist-Turner' 19 | 'Plumber': 'Plumber' 20 | 'RefrigMech': 'Refrigeration Mechanic' 21 | 'Rigger': 'Rigger' 22 | 'SheetMetal': 'Sheet Metal Worker' 23 | 'SteamFitter': 'Steamfitter-Pipefitter' 24 | 'Toolmaker': 'Toolmaker' 25 | 'Welder': 'Welder' 26 | } 27 | Lists.Resources.TradeLevels = { 28 | 0: 'Trades Assistant' 29 | 1: 'Apprentice Stage 1' 30 | 2: 'Apprentice Stage 2' 31 | 3: 'Apprentice Stage 3' 32 | 4: 'Apprentice Stage 4' 33 | 5: 'Trade Qualified' 34 | 6: 'Trade Licensed' 35 | 7: 'Master Tradesman' 36 | } 37 | Lists.Resources.Professions = { 38 | 'AeroEng': 'Engineering Aerospace' 39 | 'CivilEng': 'Engineering Civil' 40 | 'ElecEngineer': 'Engineering Electrical' 41 | 'ElectronicEng': 'Engineering Electronic' 42 | 'MechEngineer': 'Engineering Mechanical' 43 | 'MechatronicEng': 'Engineering Mechatronic' 44 | } 45 | Lists.Resources.ProfessionLevels = { 46 | 0: 'Undergraduate' 47 | 1: 'Associate Diploma' 48 | 2: 'Diploma' 49 | 3: 'Bachelor Degree' 50 | 4: 'Postgraduate Diplmoma' 51 | 5: 'Masters Degree' 52 | 6: 'Doctorate-Phd' 53 | } 54 | Lists.Resources.Certifications = { 55 | 'eleca': 'Electrician A Grade' 56 | 'confined': 'Confined Space' 57 | 'heights': 'Working at Heights' 58 | 'presspipe': 'Pressure Pipe Welding' 59 | } 60 | -------------------------------------------------------------------------------- /lib/custom/workorderLists.coffee: -------------------------------------------------------------------------------- 1 | # User editable lists 2 | Lists.Workorders.Priority = { 3 | 5: '5 - Emergency' 4 | 4: '4 - Immediate' 5 | 3: '3 - High Priority' 6 | 2: '2 - Medium Priority' 7 | 1: '1 - Low Priority' 8 | 0: '0 - No Priority' 9 | } 10 | 11 | Lists.Workorders.Fault = { 12 | 'heat': 'Excessive Heat' 13 | 'leak': 'Leaking' 14 | 'lube': 'Lubrication' 15 | 'noise': 'Excessive Noise' 16 | 'nop': 'Not Operating' 17 | 'perf': 'Performance Degradation' 18 | 'vib': 'Vibration' 19 | 'nl': 'Not Listed' 20 | 'nf': 'No Fault' 21 | } 22 | 23 | Lists.Workorders.Cause = { 24 | 'align': 'Alignment' 25 | 'balance': 'Balancing' 26 | 'dirt': 'Contamination / Dirt' 27 | 'filt': 'Blocked Filter' 28 | 'gasket': 'Gasket Failure' 29 | 'leak': 'Lubrication Leak' 30 | 'loose': 'Loose Fit' 31 | 'lube': 'Lubrication' 32 | 'mount': 'Mounting' 33 | 'oper': 'Incorrect Operation' 34 | 'perf': 'Seal Performance' 35 | 'seal': 'Seal Failure' 36 | 'sound': 'Soundproofing' 37 | 'vent': 'Poor Ventilation' 38 | 'water': 'Water Ingress' 39 | 'wear': 'Wear' 40 | 'wrong': 'Wrong Lubricant' 41 | 'nl': 'Not Listed' 42 | 'nf': 'No Fault' 43 | } 44 | 45 | Lists.Workorders.Remedy = { 46 | 'clean': 'Clean and Lube' 47 | 'clean': 'Clean Filter' 48 | 'lube': 'Lubricant Change' 49 | 'ohaul': 'Overhaul' 50 | 'refit': 'Re-fit' 51 | 'remount': 'Re-mount' 52 | 'replace': 'Replace' 53 | 'nl': 'Not Listed' 54 | 'nf': 'No Fault' 55 | } 56 | -------------------------------------------------------------------------------- /lib/functions/general.coffee: -------------------------------------------------------------------------------- 1 | # Convert Date objects to a string phrase 2 | @dateToText = (dateObj) -> 3 | day = dateObj.getDate() 4 | month = Lists.Months[dateObj.getMonth()] 5 | year = dateObj.getFullYear() 6 | day + ' ' + month + ' ' + year 7 | -------------------------------------------------------------------------------- /lib/i18n/en.i18n.json: -------------------------------------------------------------------------------- 1 | { 2 | "layouts-welcome1": "Welcome to The Lightning EAM Project!", 3 | "layouts-welcome2": "Creating the World's fastest Enterprise Asset Management (EAM) system", 4 | "assets": "Assets", 5 | "locations": "Locations", 6 | "assets&locations1": "Assets & Locations", 7 | "assets&locations2": "Assets and Locations", 8 | "work": "Work Mgt", 9 | "work-mgt": "Work Management", 10 | "create-request": "Create Request", 11 | "view-work": "View Work", 12 | "work-orders": "Work Orders", 13 | "my-work": "My Work", 14 | "work-template": "Work Template", 15 | "safety-template": "Safety Template" 16 | } 17 | -------------------------------------------------------------------------------- /lib/i18n/i18n.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackSpaceTech/lightning-eam/42ff6409c5b91633133eff7d6366665e62a1ea04/lib/i18n/i18n.xlsx -------------------------------------------------------------------------------- /lib/permissions.js: -------------------------------------------------------------------------------- 1 | // check that the userId specified owns the documents 2 | ownsDocument = function(userId, doc) { 3 | return doc && doc.user === userId; 4 | } 5 | -------------------------------------------------------------------------------- /lib/router/aRouter.coffee: -------------------------------------------------------------------------------- 1 | FlowRouter.notFound = action: -> 2 | BlazeLayout.render 'layout', 3 | content: 'notFound' 4 | header: 'header1' 5 | footer: 'footer1' 6 | 7 | FlowRouter.route '/signin', action: -> 8 | BlazeLayout.render 'layoutSignIn', 9 | content: 'signInPage' 10 | header: 'header1' 11 | footer: 'footer1' 12 | 13 | FlowRouter.route '/', action: -> 14 | BlazeLayout.render 'layout', 15 | content: 'welcomePage' 16 | header: 'header1' 17 | footer: 'footer1' 18 | 19 | 20 | ###************************* Other routes ***********************************### 21 | 22 | FlowRouter.route '/about', action: -> 23 | BlazeLayout.render 'layout', 24 | content: 'aboutPage' 25 | header: 'header1' 26 | footer: 'footer1' 27 | 28 | FlowRouter.route '/reports', action: -> 29 | BlazeLayout.render 'layout', 30 | content: 'reportsPage' 31 | header: 'header1' 32 | footer: 'footer1' 33 | 34 | FlowRouter.route '/help', action: -> 35 | BlazeLayout.render 'layout', 36 | content: 'helpPage' 37 | header: 'header1' 38 | footer: 'footer1' 39 | -------------------------------------------------------------------------------- /lib/router/pm.coffee: -------------------------------------------------------------------------------- 1 | pmRoutes = FlowRouter.group( 2 | prefix: '/pm' 3 | name: 'pm') 4 | pmRoutes.route '/', action: -> 5 | BlazeLayout.render 'layoutPM', 6 | content: 'pmPage' 7 | header: 'header1' 8 | footer: 'footer1' 9 | 10 | pmRoutes.route '/view-groups', 11 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 12 | action: -> 13 | BlazeLayout.render 'layoutPM', 14 | content: 'assetGroupsPage' 15 | header: 'header1' 16 | footer: 'footer1' 17 | 18 | pmRoutes.route '/create-group', 19 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 20 | action: -> 21 | BlazeLayout.render 'layoutPM', 22 | content: 'createAssetGroupPage' 23 | header: 'header1' 24 | footer: 'footer1' 25 | 26 | pmRoutes.route '/view-group', 27 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 28 | action: -> 29 | BlazeLayout.render 'layoutPM', 30 | content: 'viewAssetGroupPage' 31 | header: 'header1' 32 | footer: 'footer1' 33 | 34 | pmRoutes.route '/edit-group', 35 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 36 | action: -> 37 | BlazeLayout.render 'layoutPM', 38 | content: 'editAssetGroupPage' 39 | header: 'header1' 40 | footer: 'footer1' 41 | 42 | pmRoutes.route '/create-pm', 43 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 44 | action: -> 45 | BlazeLayout.render 'layoutPM', 46 | content: 'createPMPage' 47 | header: 'header1' 48 | footer: 'footer1' 49 | 50 | pmRoutes.route '/view-pms', 51 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 52 | action: -> 53 | BlazeLayout.render 'layoutPM', 54 | content: 'viewPMsPage' 55 | header: 'header1' 56 | footer: 'footer1' 57 | 58 | pmRoutes.route '/view-pm', 59 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 60 | action: -> 61 | BlazeLayout.render 'layoutPM', 62 | content: 'viewPMPage' 63 | header: 'header1' 64 | footer: 'footer1' 65 | 66 | pmRoutes.route '/edit-pm', 67 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 68 | action: -> 69 | BlazeLayout.render 'layoutPM', 70 | content: 'editPMPage' 71 | header: 'header1' 72 | footer: 'footer1' 73 | 74 | pmRoutes.route '/activate-pm', 75 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 76 | action: -> 77 | BlazeLayout.render 'layoutPM', 78 | content: 'activatePMPage' 79 | header: 'header1' 80 | footer: 'footer1' 81 | -------------------------------------------------------------------------------- /lib/router/resources.coffee: -------------------------------------------------------------------------------- 1 | ###************************* Resources routes ***********************************### 2 | 3 | resourcesRoutes = FlowRouter.group( 4 | prefix: '/resources' 5 | name: 'resources') 6 | resourcesRoutes.route '/', action: -> 7 | BlazeLayout.render 'layout', 8 | content: 'resourcesPage' 9 | header: 'header1' 10 | footer: 'footer1' 11 | 12 | resourcesRoutes.route '/view-people', 13 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 14 | action: -> 15 | BlazeLayout.render 'layout', 16 | content: 'viewPeoplePage' 17 | header: 'header1' 18 | footer: 'footer1' 19 | 20 | resourcesRoutes.route '/edit-people', 21 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 22 | action: -> 23 | BlazeLayout.render 'layout', 24 | content: 'editPeoplePage' 25 | header: 'header1' 26 | footer: 'footer1' 27 | 28 | resourcesRoutes.route '/credentials', 29 | triggersEnter: [ AccountsTemplates.ensureSignedIn ] 30 | action: -> 31 | BlazeLayout.render 'layout', 32 | content: 'credentialsPage' 33 | header: 'header1' 34 | footer: 'footer1' 35 | -------------------------------------------------------------------------------- /public/Birt-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackSpaceTech/lightning-eam/42ff6409c5b91633133eff7d6366665e62a1ea04/public/Birt-logo.png -------------------------------------------------------------------------------- /public/Logo_D3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackSpaceTech/lightning-eam/42ff6409c5b91633133eff7d6366665e62a1ea04/public/Logo_D3.png -------------------------------------------------------------------------------- /public/flowchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackSpaceTech/lightning-eam/42ff6409c5b91633133eff7d6366665e62a1ea04/public/flowchart.png -------------------------------------------------------------------------------- /public/front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackSpaceTech/lightning-eam/42ff6409c5b91633133eff7d6366665e62a1ea04/public/front.jpg -------------------------------------------------------------------------------- /public/laterText.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | LaterJS example 5 | 6 | 7 | 8 |

LaterJS Text Expression Simulator

9 |

Enter text expression:

10 | 11 | 12 |

next 10 executes

13 |
    14 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /server/0Startup.coffee: -------------------------------------------------------------------------------- 1 | Meteor.startup -> 2 | # Start Cron server 3 | SyncedCron.start 4 | -------------------------------------------------------------------------------- /server/methods/general.coffee: -------------------------------------------------------------------------------- 1 | Meteor.methods 2 | createClassification: (doc) -> 3 | # Add date stamp 4 | doc.createdDate = new Date() 5 | # Insert a Classification into the collection 6 | Classification.insert doc , (error,id) -> 7 | if(id) 8 | tempPath = [] 9 | # Get the parent Class tree path 10 | if (doc.parent!='#') 11 | temp = Classification.findOne {'_id':doc.parent} 12 | if(temp) 13 | tempPath = temp.treePath 14 | # Add current doc _id 15 | tempPath.push(id) 16 | Classification.update id, { $set: { treePath: tempPath }} 17 | Classification.update id, { $set: { id: id }} 18 | return 'Created' 19 | else 20 | console.log(error) 21 | return error 22 | deleteClassification: (doc) -> 23 | # Update the parent Classification children list 24 | if (doc.parent!='#') 25 | temp = Classification.findOne {'id':doc.parent} 26 | if (temp) 27 | Classification.update(temp._id, { $pull: { children: doc.id }}) 28 | # Delete a Classification from the collection 29 | Classification.remove doc._id 30 | this.unblock() 31 | return 'Deleted' 32 | -------------------------------------------------------------------------------- /server/methods/locations.coffee: -------------------------------------------------------------------------------- 1 | Meteor.methods 2 | createLoc: (doc) -> 3 | # Add date stamp 4 | doc.createdDate = new Date() 5 | # Insert a location / asset into the collection 6 | Locations.insert doc , (error,id) -> 7 | if(id) 8 | tempPath = [] 9 | # Get the parent asset's tree path 10 | if (doc.parent!='#') 11 | temp = Locations.findOne {'_id':doc.parent} 12 | if(temp) 13 | tempPath = temp.treePath 14 | # Add current doc _id 15 | tempPath.push(id) 16 | Locations.update id, { $set: { treePath: tempPath }} 17 | Locations.update id, { $set: { id: id }} 18 | return 'Created' 19 | else 20 | console.log(error) 21 | return error 22 | deleteLoc: (doc) -> 23 | # Update the parent asset's children list 24 | if (doc.parent!='#') 25 | temp = Locations.findOne {'id':doc.parent} 26 | if (temp) 27 | Locations.update(temp._id, { $pull: { children: doc.id }}) 28 | # Delete a location / asset from the collection 29 | Locations.remove doc 30 | this.unblock() 31 | return 'Deleted' 32 | createMeter: (doc, meter) -> 33 | # Check if meter array already exists 34 | if (doc.meters) 35 | Locations.update(doc._id, { $push: { meters: meter }}) 36 | else 37 | Locations.update(doc._id, { $set: { meters: [meter]} }) 38 | this.unblock() 39 | return 'Created Meter' 40 | updateMeter: (docID, meterIndex, reading) -> 41 | meters = Locations.findOne({'_id': docID}).meters 42 | meters[meterIndex].reading = reading 43 | Locations.update(docID, { $set: { meters: meters} }) 44 | activateMeterPM docID, meters[meterIndex].id, reading 45 | this.unblock() 46 | return 'Updated Meter' 47 | deleteMeter: (docID, meterIndex) -> 48 | meters = Locations.findOne({'_id': docID}).meters 49 | meters.splice(meterIndex,1) 50 | Locations.update(docID, { $set: { meters: meters} }) 51 | this.unblock() 52 | return 'Deleted Meter' 53 | -------------------------------------------------------------------------------- /server/methods/procurement.coffee: -------------------------------------------------------------------------------- 1 | Meteor.methods 2 | createCompany: (doc) -> 3 | # Add date stamp 4 | doc.createdDate = new Date() 5 | # Insert an company into the collection 6 | Companies.insert doc , (error,id) -> 7 | if(id) 8 | return 'Created' 9 | else 10 | console.log(error) 11 | return error 12 | deleteCompany: (doc) -> 13 | # Delete a company from the collection 14 | this.unblock() 15 | Companies.remove doc 16 | return 'Deleted' 17 | createPurchase: (doc) -> 18 | # Add date stamp 19 | doc.createdDate = new Date() 20 | # Insert an Purchase into the collection 21 | Purchases.insert doc , (error,id) -> 22 | if(id) 23 | return 'Created' 24 | else 25 | console.log(error) 26 | return error 27 | deletePurchase: (doc) -> 28 | # Delete a Purchase from the collection 29 | this.unblock() 30 | Purchases.remove doc 31 | return 'Deleted' 32 | goodsReceived: (docID, itemID, qty, invLoc) -> 33 | # Update purchase order 34 | Purchases.update { _id: docID, 'reqItems._id': itemID }, { $inc: { 'reqItems.$.goodsReceived' : qty } } 35 | # Update inventory bin location 36 | # Check if items already in location 37 | temp = Bins.findOne { _id: invLoc, 'stock.item_id': itemID } 38 | if temp 39 | Bins.update { _id: invLoc, 'stock.item_id': itemID }, { $inc: { 'stock.$.stockLevel' : qty } }, (error,result) -> 40 | if(result) 41 | return 'Goods received' 42 | else 43 | console.log(error) 44 | return error 45 | else 46 | stockQty = { 47 | item_id: itemID 48 | itemText: Items.findOne({_id: itemID }).text 49 | stockLevel: qty 50 | } 51 | Bins.update { _id: invLoc }, { $push: { 'stock' : stockQty } }, (error,result) -> 52 | if(result) 53 | return 'Goods received' 54 | else 55 | console.log(error) 56 | return error 57 | -------------------------------------------------------------------------------- /server/methods/resources.coffee: -------------------------------------------------------------------------------- 1 | Meteor.methods 2 | deleteUser: (doc) -> 3 | # Delete a user 4 | Meteor.users.remove doc 5 | this.unblock() 6 | return 'Deleted User' 7 | setRole: (userID, role) -> 8 | Roles.setUserRoles userID, role 9 | return 'Set Role' 10 | -------------------------------------------------------------------------------- /server/methods/work.coffee: -------------------------------------------------------------------------------- 1 | Meteor.methods 2 | createWO: (doc) -> 3 | # Add date stamp to request 4 | doc.reqDate = new Date() 5 | # Insert a work order into the collection 6 | Workorders.insert doc 7 | this.unblock() 8 | return 'Created' 9 | updateWO:(doc, ID) -> 10 | tempWO = Workorders.findOne('_id':ID) 11 | if doc.$set.status > tempWO.status # Status has been progressed 12 | # Add date stamp to upate 13 | switch doc.$set.status 14 | when '3' 15 | doc.$set.reqApprovedDate = new Date() 16 | console.log 'Updated Request approved date' 17 | when '4' 18 | doc.$set.woCreatedDate = new Date() 19 | when '5' 20 | doc.$set.woApprovedDate = new Date() 21 | when '6' 22 | doc.$set.woPlannedDate = new Date() 23 | when '8' 24 | doc.$set.woInProgDate = new Date() 25 | when '9' 26 | doc.$set.woCompletedDate = new Date() 27 | when '10' 28 | doc.$set.woFinancialsDate = new Date() 29 | when '11' 30 | doc.$set.woReviewedDate = new Date() 31 | when '12' 32 | doc.$set.woClosedDate = new Date() 33 | # Insert a work order into the collection 34 | Workorders.update({ _id: ID }, doc) 35 | this.unblock() 36 | return 'Updated' 37 | deleteWO: (docID) -> 38 | Workorders.remove {'_id': docID} 39 | this.unblock() 40 | return 'Deleted' 41 | setWorkQuery: (query) -> 42 | Collections.Workorders.workQuery = query 43 | return 'Querying database...' 44 | createWorkTemplate: (doc) -> 45 | Workplans.insert doc 46 | this.unblock() 47 | return 'Created Work Template' 48 | createSafetyTemplate: (doc) -> 49 | Safetyplans.insert doc 50 | this.unblock() 51 | return 'Created Safety Method' 52 | deleteSafety: (docID) -> 53 | Safetyplans.remove {'_id': docID} 54 | this.unblock() 55 | return 'Deleted Safety Method' 56 | deleteWork: (docID) -> 57 | Workplans.remove {'_id': docID} 58 | this.unblock() 59 | return 'Deleted Work Template' 60 | -------------------------------------------------------------------------------- /video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BackSpaceTech/lightning-eam/42ff6409c5b91633133eff7d6366665e62a1ea04/video.png --------------------------------------------------------------------------------