From b5ac9fd249e00d46e08eb5d814cfab25c669a77d Mon Sep 17 00:00:00 2001 From: Wynne Crisman Date: Sun, 8 Oct 2017 08:56:15 -0700 Subject: [PATCH] Added custom scroll bars and separated the table header from the tables for Sales and the Graphs tables. --- .gitignore | 1 + .meteor/.finished-upgraders | 1 + .meteor/packages | 28 +- .meteor/release | 2 +- .meteor/versions | 131 +- client/client.js | 1 + client/main.styl | 3 +- imports/api/Logs.js | 2 + imports/api/Product.js | 13 + imports/api/Sale.js | 31 +- imports/startup/client/routes.js | 7 + imports/startup/server/index.js | 3 +- imports/ui/Graphs.html | 62 +- imports/ui/Graphs.import.styl | 67 +- imports/ui/Graphs.js | 11 +- imports/ui/MiscManagement.html | 1 + imports/ui/MiscManagement.js | 3 + imports/ui/Products.html | 50 +- imports/ui/Products.import.styl | 2 + imports/ui/Products.js | 46 +- imports/ui/Sales.html | 34 +- imports/ui/Sales.import.styl | 93 +- imports/ui/Sales.js | 17 + imports/ui/SalesSheetEditor.html | 39 +- imports/ui/SalesSheetEditor.import.styl | 69 +- imports/ui/SalesSheetEditor.js | 76 +- imports/ui/SalesSheetForm.js | 1 - imports/ui/TestList.html | 27 + imports/ui/TestList.import.styl | 4 + imports/ui/TestList.js | 266 ++ imports/ui/layouts/Body.import.styl | 2 +- imports/util/polyfills/array.js | 2 +- imports/util/polyfills/date.js | 33 +- imports/util/scrollWidth.js | 7 + package.json | 4 +- packages/jquery-custom-scrollbar/README.md | 0 .../jquery-custom-scrollbar-tests.js | 11 + .../jquery-custom-scrollbar.js | 7 + .../jquery.mCustomScrollbar.css | 1267 +++++++++ .../jquery.mCustomScrollbar.js | 2458 +++++++++++++++++ .../jquery.mousewheel.js | 221 ++ packages/jquery-custom-scrollbar/package.js | 29 + .../jquery-custom-scrollbar/versions.json | 19 + server/enhanceSaleDateFields.js | 33 + 44 files changed, 4939 insertions(+), 245 deletions(-) create mode 100644 imports/ui/TestList.html create mode 100644 imports/ui/TestList.import.styl create mode 100644 imports/ui/TestList.js create mode 100644 imports/util/scrollWidth.js create mode 100644 packages/jquery-custom-scrollbar/README.md create mode 100644 packages/jquery-custom-scrollbar/jquery-custom-scrollbar-tests.js create mode 100644 packages/jquery-custom-scrollbar/jquery-custom-scrollbar.js create mode 100644 packages/jquery-custom-scrollbar/jquery.mCustomScrollbar.css create mode 100644 packages/jquery-custom-scrollbar/jquery.mCustomScrollbar.js create mode 100644 packages/jquery-custom-scrollbar/jquery.mousewheel.js create mode 100644 packages/jquery-custom-scrollbar/package.js create mode 100644 packages/jquery-custom-scrollbar/versions.json create mode 100644 server/enhanceSaleDateFields.js diff --git a/.gitignore b/.gitignore index a3f85d4..9fda002 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules +.idea private \ No newline at end of file diff --git a/.meteor/.finished-upgraders b/.meteor/.finished-upgraders index ce276f3..910574c 100644 --- a/.meteor/.finished-upgraders +++ b/.meteor/.finished-upgraders @@ -14,3 +14,4 @@ notices-for-facebook-graph-api-2 1.4.0-remove-old-dev-bundle-link 1.4.1-add-shell-server-package 1.4.3-split-account-service-packages +1.5-add-dynamic-import-package diff --git a/.meteor/packages b/.meteor/packages index 632b802..bea91c2 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -4,26 +4,25 @@ # 'meteor add' and 'meteor remove' will edit this file for you, # but you can also edit it by hand. -meteor-base@1.0.4 # Packages every Meteor app needs to have -mobile-experience@1.0.4 # Packages for a great mobile UX -mongo@1.1.17 # The database Meteor supports right now +meteor-base@1.1.0 # Packages every Meteor app needs to have +mobile-experience@1.0.5 # Packages for a great mobile UX +mongo@1.2.2 # The database Meteor supports right now blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views reactive-var@1.0.11 # Reactive variable for tracker -reactive-dict@1.1.8 # ??? -jquery@1.11.10 # Helpful client-side library +reactive-dict@1.1.9 # ??? tracker@1.1.3 # Meteor's client-side reactive programming library tomwasd:history-polyfill # Adds IE 8/9 support for HTML5 history. -email@1.2.1 # Adds the Meteor/Email package for sending lost password emails +email@1.2.3 # Adds the Meteor/Email package for sending lost password emails -standard-minifier-css@1.3.4 # CSS minifier run for production mode -standard-minifier-js@2.0.0 # JS minifier run for production mode +standard-minifier-css@1.3.5 # CSS minifier run for production mode +standard-minifier-js@2.1.2 # JS minifier run for production mode es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers. poorvavyas:es6-shim -ecmascript@0.7.3 # Enable ECMAScript2015+ syntax in app code +ecmascript@0.8.3 # Enable ECMAScript2015+ syntax in app code #accounts-ui #accounts-base -accounts-password@1.3.6 +accounts-password@1.4.0 useraccounts:core useraccounts:bootstrap useraccounts:flow-routing # Configures email flows. Used for AccountsTemplates class. @@ -34,7 +33,7 @@ arillo:flow-router-helpers # Provides various template helpers such as {{pathFo #tomwasd:flow-router-seo kadira:blaze-layout -shell-server@0.2.3 # ??? +shell-server@0.2.4 # ??? meteortoys:allthings stylus@2.513.9 session@1.1.7 @@ -43,12 +42,12 @@ check@1.2.5 # Allows for checking the structure and types of arguments pas #audit-argument-checks # Used in combination with the Check package for checking the structure and types of arguments passed to Meteor methods and publications. Automatically alerts when a method or publication does not use a check() call. aldeed:simple-schema@1.5.3 -aldeed:collection2@2.10.0 +aldeed:collection2 #matb33:collection-hooks # Allows the collections to register handlers that run before or after database interactions. #zimme:collection-softremovable #aldeed:autoform@5.8.1 -#aldeed:collection2-core@2.0.0 +#aldeed:collection2-core@2.0.1 #aldeed:schema-deny # Addon for Collection2-core to use denyInsert or denyUpdate options. #aldeed:schema-index # Addon for Collection2-core to use index or unique options. #skehoe1989:autoform-relations # Adds relations to autoform @@ -62,3 +61,6 @@ juliancwirko:s-alert # Client error/alert handling jcbernack:reactive-aggregate # Allows us to create a new client collection (from the server) with the contents being an aggregate of server data. Note that aggregation can only be done on the server currently as mini-mongo does not support it. ostrio:logger ostrio:loggermongo +dynamic-import@0.1.3 +markdown@1.0.12 +wcrisman:jquery-custom-scrollbar diff --git a/.meteor/release b/.meteor/release index fb6f3bc..099d5b9 100644 --- a/.meteor/release +++ b/.meteor/release @@ -1 +1 @@ -METEOR@1.4.4.2 +METEOR@1.5.2.2 diff --git a/.meteor/versions b/.meteor/versions index 9a2af42..979e17b 100644 --- a/.meteor/versions +++ b/.meteor/versions @@ -1,41 +1,43 @@ -accounts-base@1.2.17 -accounts-password@1.3.6 -alanning:roles@1.2.15 +accounts-base@1.3.4 +accounts-password@1.4.0 +alanning:roles@1.2.16 aldeed:collection2@2.10.0 aldeed:collection2-core@1.2.0 aldeed:schema-deny@1.1.0 aldeed:schema-index@1.1.1 aldeed:simple-schema@1.5.3 -aldeed:template-extension@4.0.0 -allow-deny@1.0.5 +aldeed:template-extension@4.1.0 +allow-deny@1.0.9 arillo:flow-router-helpers@0.5.2 autoupdate@1.3.12 -babel-compiler@6.18.2 +babel-compiler@6.20.0 babel-runtime@1.0.1 base64@1.0.10 binary-heap@1.0.10 blaze@2.3.2 -blaze-html-templates@1.0.5 +blaze-html-templates@1.1.2 blaze-tools@1.0.10 -boilerplate-generator@1.0.11 +boilerplate-generator@1.2.0 caching-compiler@1.1.9 -caching-html-compiler@1.0.7 +caching-html-compiler@1.1.2 callback-hook@1.0.10 check@1.2.5 coffeescript@1.0.17 -ddp@1.2.5 -ddp-client@1.3.4 -ddp-common@1.2.8 +ddp@1.3.1 +ddp-client@2.1.3 +ddp-common@1.2.9 ddp-rate-limiter@1.0.7 -ddp-server@1.3.14 +ddp-server@2.0.2 deps@1.0.12 diff-sequence@1.0.7 -ecmascript@0.7.3 -ecmascript-runtime@0.3.15 -ejson@1.0.13 -email@1.2.1 +dynamic-import@0.1.3 +ecmascript@0.8.3 +ecmascript-runtime@0.4.1 +ecmascript-runtime-client@0.4.3 +ecmascript-runtime-server@0.4.1 +ejson@1.0.14 +email@1.2.3 es5-shim@4.6.15 -fastclick@1.0.13 fortawesome:fontawesome@4.7.0 geojson-utils@1.0.10 hot-code-push@1.0.4 @@ -50,54 +52,58 @@ kadira:blaze-layout@2.3.0 kadira:flow-router@2.12.1 launch-screen@1.1.1 livedata@1.0.18 -localstorage@1.0.12 +localstorage@1.1.1 logging@1.1.17 +markdown@1.0.12 mdg:validation-error@0.2.0 -meteor@1.6.1 -meteor-base@1.0.4 +meteor@1.7.2 +meteor-base@1.1.0 meteorhacks:aggregate@1.3.0 meteorhacks:collection-utils@1.2.0 -meteortoys:allthings@3.0.0 -meteortoys:authenticate@3.0.0 -meteortoys:autopub@3.0.0 -meteortoys:blueprint@3.0.0 -meteortoys:email@3.0.0 -meteortoys:hotreload@3.0.0 -meteortoys:listen@3.0.0 -meteortoys:method@3.0.4 -meteortoys:pub@3.0.4 -meteortoys:result@3.0.0 -meteortoys:shell@3.0.0 -meteortoys:status@3.0.0 -meteortoys:sub@3.0.0 -meteortoys:throttle@3.0.0 -meteortoys:toykit@3.0.4 +meteortoys:allthings@4.0.0 +meteortoys:authenticate@4.0.0 +meteortoys:autopub@4.0.0 +meteortoys:blueprint@4.0.0 +meteortoys:email@4.0.0 +meteortoys:hotreload@4.0.0 +meteortoys:listen@4.0.0 +meteortoys:method@4.0.0 +meteortoys:mobile@4.0.0 +meteortoys:pub@4.0.0 +meteortoys:result@4.0.0 +meteortoys:shell@4.0.0 +meteortoys:status@4.0.0 +meteortoys:sub@4.0.0 +meteortoys:throttle@4.0.0 +meteortoys:toggle@4.0.0 +meteortoys:toykit@4.0.1 minifier-css@1.2.16 -minifier-js@2.0.0 -minimongo@1.0.23 +minifier-js@2.1.4 +minimongo@1.3.2 mizzao:bootboxjs@4.4.0 -mobile-experience@1.0.4 +mobile-experience@1.0.5 mobile-status-bar@1.0.14 -modules@0.8.2 -modules-runtime@0.7.10 +modules@0.10.0 +modules-runtime@0.8.0 momentjs:moment@2.18.1 -mongo@1.1.17 +mongo@1.2.2 +mongo-dev-server@1.0.1 mongo-id@1.0.6 mongo-livedata@1.0.12 -msavin:jetsetter@2.0.0 -msavin:mongol@2.0.1 -npm-bcrypt@0.9.2 -npm-mongo@2.2.24 +msavin:jetsetter@4.0.0 +msavin:mongol@4.0.1 +npm-bcrypt@0.9.3 +npm-mongo@2.2.30 observe-sequence@1.0.16 ordered-dict@1.0.9 -ostrio:logger@1.1.2 -ostrio:loggermongo@1.1.3 +ostrio:logger@2.0.3 +ostrio:loggermongo@2.0.1 poorvavyas:es6-shim@0.21.1 -promise@0.8.8 +promise@0.9.0 raix:eventemitter@0.1.3 random@1.0.10 rate-limit@1.0.8 -reactive-dict@1.1.8 +reactive-dict@1.1.9 reactive-var@1.0.11 reload@1.1.11 retry@1.0.9 @@ -105,26 +111,27 @@ routepolicy@1.0.12 service-configuration@1.0.11 session@1.1.7 sha@1.0.9 -shell-server@0.2.3 -softwarerero:accounts-t9n@1.3.6 -spacebars@1.0.13 -spacebars-compiler@1.1.1 +shell-server@0.2.4 +softwarerero:accounts-t9n@1.3.11 +spacebars@1.0.15 +spacebars-compiler@1.1.3 srp@1.0.10 -standard-minifier-css@1.3.4 -standard-minifier-js@2.0.0 +standard-minifier-css@1.3.5 +standard-minifier-js@2.1.2 stylus@2.513.9 -templating@1.2.15 -templating-compiler@1.2.15 -templating-runtime@1.2.15 -templating-tools@1.1.1 +templating@1.3.2 +templating-compiler@1.3.3 +templating-runtime@1.3.2 +templating-tools@1.1.2 tomwasd:history-polyfill@0.0.1 tracker@1.1.3 -ui@1.0.12 +ui@1.0.13 underscore@1.0.10 url@1.1.0 useraccounts:bootstrap@1.14.2 useraccounts:core@1.14.2 useraccounts:flow-routing@1.14.2 -webapp@1.3.15 +wcrisman:jquery-custom-scrollbar@3.0.0 +webapp@1.3.19 webapp-hashing@1.0.9 zimme:active-route@2.3.2 diff --git a/client/client.js b/client/client.js index 9295e8e..8e33b86 100644 --- a/client/client.js +++ b/client/client.js @@ -21,6 +21,7 @@ import '/imports/util/select2/select2.full.js'; import 'sweetalert2/dist/sweetalert2.min.css'; import '/imports/util/simplegrid.css'; import 'dragula/dist/dragula.css'; +//import 'malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css'; Blaze._allowJavascriptUrls(); diff --git a/client/main.styl b/client/main.styl index 7ee401c..836e2ee 100644 --- a/client/main.styl +++ b/client/main.styl @@ -180,4 +180,5 @@ body @import "../imports/ui/SalesSheetEditor.import.styl" @import "../imports/ui/Pricing.import.styl" @import "../imports/ui/Production.import.styl" -@import "../imports/ui/Graphs.import.styl" \ No newline at end of file +@import "../imports/ui/Graphs.import.styl" +@import "../imports/ui/TestList.import.styl" \ No newline at end of file diff --git a/imports/api/Logs.js b/imports/api/Logs.js index 3cb318d..61acc12 100644 --- a/imports/api/Logs.js +++ b/imports/api/Logs.js @@ -1,5 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { Mongo } from 'meteor/mongo'; +import { Logger } from 'meteor/ostrio:logger'; +import { LoggerMongo } from 'meteor/ostrio:loggermongo'; // The logging tool is primarily for managing administrative functions such that administrators can view the app logs and issue commands that might generate administrative logging. diff --git a/imports/api/Product.js b/imports/api/Product.js index de0367a..9309488 100644 --- a/imports/api/Product.js +++ b/imports/api/Product.js @@ -8,6 +8,10 @@ import {SimpleSchema} from 'meteor/aldeed:simple-schema'; * The Product object has a prices field which is an object whose fields names are Measure ID's. Each field value (for each Measure ID) is an object that has a 'price', 'effectiveDate', and 'previousPrice'. * The effectiveDate field stores the date as a number in the format YYYYMMDD. Converting this number into a local date is done with moment(sale.date.toString(), "YYYYMMDD").toDate(), and converting it to a number from a date can be accomplished with ~~(moment(date).format("YYYYMMDD")), where the ~~ is a bitwise not and converts a string to a number quickly and reliably. * Because the structure of the Product object is so complicated, the normal checking that is done by the framework cannot be used. + * + * A product is first deactivated, then hidden. + * A deactivated product is one that is no longer intended to be used (produced), but needs to show up in some lists because there may be some still floating around in inventory (needing to be sold). It should show with a yellow indicator if displayed. + * A product that is hidden is one that exists in the system as a historical artifact due to there still being data attached to it (sales for example). It should not normally show in lists, and should show up with a red indicator if it is displayed. */ Products = new Mongo.Collection('Products'); @@ -190,6 +194,15 @@ if(Meteor.isServer) { } else throw new Meteor.Error(403, "Not authorized."); }, + convertProduct: function(productId, alternateProductId) { + if(Roles.userIsInRole(this.userId, [Meteor.UserRoles.ROLE_UPDATE])) { + check(productId, String); + check(alternateProductId, String); + // Replace all sale references to the given ID with the provided alternate product ID. + Meteor.collections.Sales.update({productId: productId}, {$set: {productId: alternateProductId}}, {multi: true}); + } + else throw new Meteor.Error(403, "Not authorized."); + }, deactivateProduct: function(id) { if(Roles.userIsInRole(this.userId, [Meteor.UserRoles.ROLE_UPDATE])) { //Products.remove(id); diff --git a/imports/api/Sale.js b/imports/api/Sale.js index 1d5a288..4e6e5a1 100644 --- a/imports/api/Sale.js +++ b/imports/api/Sale.js @@ -16,6 +16,16 @@ let SalesSchema = new SimpleSchema({ optional: false, index: 1 }, + timestamp: { + type: Date, + label: "Timestamp", + optional: true + }, + weekOfYear: { + type: Number, + label: "Week Of Year", + optional: true + }, amount: { type: Number, label: "Amount", @@ -189,7 +199,8 @@ if(Meteor.isServer) { let group = { $group: { _id: { - year: {$dateToString: {format: '%Y', date: '$date'}}//{$year: '$date'} + //year: {$dateToString: {format: '%Y', date: '$date'}}//{$year: '$date'} + year: {$substr: ['$date', 0, 4]} }, 'total': { $sum: { @@ -212,13 +223,13 @@ if(Meteor.isServer) { //Annual is assumed if not week or month. if(time === 'weekly') { - group.$group._id.week = {$dateToString: {format: '%U', date: '$date'}}; //{$week: '$date'}; + group.$group._id.week = '$weekOfYear'; //{$dateToString: {format: '%U', date: new Date({$concat: [{$substr: ['$date', 0, 4]}, '-', {$substr: ['$date', 4, 2]}, '-', {$substr: ['$date', 6, 2]}]}) }}; //{$week: '$date'}; project.$project.week = '$_id.week'; - project.$project.date = {$concat: ['$_id.week', '-', '$_id.year']}; - project.$project._id.$concat.push('$_id.week'); + project.$project.date = {$concat: [{$substr: ['$_id.week', 0, 2]}, '-', '$_id.year']}; + project.$project._id.$concat.push({$substr: ['$_id.week', 0, 2]}); } else if(time === 'monthly') { - group.$group._id.month = {$dateToString: {format: '%m', date: '$date'}}; //{$month: '$date'}; + group.$group._id.month = {$substr: ['$date', 4, 6]}; //{$dateToString: {format: '%m', date: new Date({$concat: [{$substr: ['$date', 0, 4]}, '-', {$substr: ['$date', 4, 2]}, '-', {$substr: ['$date', 6, 2]}]}) }}; //{$month: '$date'}; project.$project.month = '$_id.month'; project.$project.date = {$concat: ['$_id.month', '-', '$_id.year']}; project.$project._id.$concat.push('$_id.month'); @@ -285,7 +296,11 @@ if(Meteor.isServer) { comment: Match.Optional(String) }); + let dateString = date.toString(); + sale.createdAt = new Date(); + sale.timestamp = new Date(dateString.substring(0, 4) + "-" + dateString.substring(4, 6) + "-" + dateString.substring(6, 8) + "T00:00:00Z"); + sale.weekOfYear = sale.timestamp.getWeek().toString(); if(Roles.userIsInRole(this.userId, [Meteor.UserRoles.ROLE_UPDATE])) { Sales.insert(sale, function(err, id) { @@ -332,8 +347,12 @@ if(Meteor.isServer) { check(price, Number); check(amount, Number); + let dateString = date.toString(); + let timestamp = new Date(dateString.substring(0, 4) + "-" + dateString.substring(4, 6) + "-" + dateString.substring(6, 8) + "T00:00:00Z"); + let weekOfYear = sale.timestamp.getWeek().toString(); + if(Roles.userIsInRole(this.userId, [Meteor.UserRoles.ROLE_UPDATE])) { - Sales.update(id, {$set: {date, venueId, price, amount}}, function(err, id) { + Sales.update(id, {$set: {date, venueId, price, amount, timestamp, weekOfYear}}, function(err, id) { if(err) console.log(err); }, {bypassCollection2: true}); } diff --git a/imports/startup/client/routes.js b/imports/startup/client/routes.js index b16eefe..28eefcf 100644 --- a/imports/startup/client/routes.js +++ b/imports/startup/client/routes.js @@ -101,4 +101,11 @@ pri.route('/graphTest', { require("/imports/ui/GraphTest.js"); BlazeLayout.render('Body', {content: 'GraphTest'}); } +}); +pri.route('/testList', { + name: 'TestList', + action: function(params, queryParams) { + require("/imports/ui/TestList.js"); + BlazeLayout.render('Body', {content: 'TestList'}); + } }); \ No newline at end of file diff --git a/imports/startup/server/index.js b/imports/startup/server/index.js index 7b3e30d..8bf6f7e 100644 --- a/imports/startup/server/index.js +++ b/imports/startup/server/index.js @@ -1 +1,2 @@ -import "./email.js" \ No newline at end of file +import "./email.js" +import "./../../util/polyfills/date.js" \ No newline at end of file diff --git a/imports/ui/Graphs.html b/imports/ui/Graphs.html index ed1f1f9..03e561a 100644 --- a/imports/ui/Graphs.html +++ b/imports/ui/Graphs.html @@ -13,7 +13,7 @@ -
+
@@ -30,24 +30,50 @@ - - {{#each sales}} - - - {{#if showTime "monthly"}} - - {{/if}} - {{#if showTime "weekly"}} - - {{/if}} - {{#if showOption "markets"}} - - {{/if}} - - - {{/each}} -
Total
{{year}}{{month}}{{week}}{{venue}}{{formatTotal total}}
+
+
+
+ + + + + {{#if showTime "monthly"}} + + {{/if}} + {{#if showTime "weekly"}} + + {{/if}} + {{#if showOption "markets"}} + + {{/if}} + + + + + {{#each sales}} + + + {{#if showTime "monthly"}} + + {{/if}} + {{#if showTime "weekly"}} + + {{/if}} + {{#if showOption "markets"}} + + {{/if}} + + + {{/each}} + +
{{year}}{{month}}{{week}}{{venue}}{{formatTotal total}}
+
+
+
+ +
+
\ No newline at end of file diff --git a/imports/ui/Graphs.import.styl b/imports/ui/Graphs.import.styl index 2d6068c..8d6abb5 100644 --- a/imports/ui/Graphs.import.styl +++ b/imports/ui/Graphs.import.styl @@ -1,6 +1,10 @@ #graphs - margin: 10px 20px + display: table + content-box: border-box + padding: 10px 20px height: 100% + width: 100% + text-align: left svg width: 100% .bar @@ -17,22 +21,47 @@ font-size: 14px font-family: "Arial Black", "Arial Bold", Gadget, sans-serif font-weight: 800 - table + .table table-layout: fixed - > thead - > tr - > th.total - width: 200px - > th.market - width: 200px - > th.week - width: 200px - > th.month - width: 200px - > th.year - width: 200px - > tbody - > tr.deactivated - background-color: #fac0d1 - > tr.deactivated:hover - background-color: #ffcadb + .total + width: 200px + .market + width: 200px + .week + width: 200px + .month + width: 200px + .year + width: 200px + .listRow + display: table-row + .listCell + display: table-cell + position: relative + height: 100% + width: auto + min-width: 300px + .salesTable + position: absolute + top: 0 + bottom: 0 + left: 0 + right: 0 + width: auto + height: auto + border: 0 + font-size: 12.5px + overflow-y: scroll + .table + > thead + display: none + > tbody + > tr.deactivated + background-color: #fac0d1 + > tr.deactivated:hover + background-color: #ffcadb + .spacerCell + display: table-cell + position: relative + width: 100% + height: 100% \ No newline at end of file diff --git a/imports/ui/Graphs.js b/imports/ui/Graphs.js index 1cdafef..12f52cc 100644 --- a/imports/ui/Graphs.js +++ b/imports/ui/Graphs.js @@ -28,6 +28,13 @@ Template.Graphs.onCreated(function() { }); }); Template.Graphs.onRendered(function() { + + $(".salesTable").mCustomScrollbar({ + scrollButtons:{enable:true}, + theme:"light-thick", + scrollbarPosition:"outside" + }); + //Reset the pull downs to their former states. Template.instance().$('select[name="time"]').val(time); Template.instance().$('select[name="options"]').val(options); @@ -35,12 +42,12 @@ Template.Graphs.onRendered(function() { //Build the SVG Graphs let margin = {top: 10, right: 0, bottom: 30, left: 40}; let width = 960 - margin.left - margin.right; - let height = 500 - margin.top - margin.bottom; + let height = 200 - margin.top - margin.bottom; let x0Scale = d3.scaleBand().range([0, width]).padding(0.05); let x1Scale = d3.scaleBand().padding(0.05); let yScale = d3.scaleLinear().range([height, 0]); let svg = d3.select('svg.salesGraph') - .attr("viewBox", "0 0 960 500") + .attr("viewBox", "0 0 960 200") .attr("perserveAspectRatio", "xMidYMid meet") .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); diff --git a/imports/ui/MiscManagement.html b/imports/ui/MiscManagement.html index 4e29438..dc96a41 100644 --- a/imports/ui/MiscManagement.html +++ b/imports/ui/MiscManagement.html @@ -7,6 +7,7 @@ Clear Logs
Count Duplicate Sales
Delete Duplicate Sales
+ Enhance Sale Dates (adds timestamp and weekOfYear to every Sale)
{{logCount}}
diff --git a/imports/ui/MiscManagement.js b/imports/ui/MiscManagement.js index e32b03e..935cf2d 100644 --- a/imports/ui/MiscManagement.js +++ b/imports/ui/MiscManagement.js @@ -72,5 +72,8 @@ Template.MiscManagement.events({ }, "click .deleteDuplicateSales": function(event, template) { Meteor.call("deleteDuplicateSales"); + }, + "click .enhanceSaleDates": function(event, template) { + Meteor.call("enhanceSalesDateFields"); } }); diff --git a/imports/ui/Products.html b/imports/ui/Products.html index 859f854..371c1fc 100644 --- a/imports/ui/Products.html +++ b/imports/ui/Products.html @@ -49,17 +49,21 @@ {{#if editing}} {{> ProductEditor}} {{else}} - {{name}} - {{tags}} - {{aliases}} - {{measures}} - {{#if hidden}} -  /  + {{#if converting}} + {{> ConvertProduct}} {{else}} - {{#if deactivated}} -  /  /  + {{name}} + {{tags}} + {{aliases}} + {{measures}} + {{#if hidden}} +  /  /  {{else}} -  /  + {{#if deactivated}} +  /  /  + {{else}} +  /  + {{/if}} {{/if}} {{/if}} {{/if}} @@ -71,29 +75,39 @@
 /  + +