Fixed bugs and updated to latest meteor.
This commit is contained in:
@@ -6,7 +6,7 @@ import {SimpleSchema} from 'meteor/aldeed:simple-schema';
|
||||
const TYPES = ['Retail', "Farmer's Market", "Restaurant", "Mail"];
|
||||
const FREQUENCIES = ['Daily', 'Weekly'];
|
||||
|
||||
Venues = new Mongo.Collection('Venues');
|
||||
let Venues = new Mongo.Collection('Venues');
|
||||
let VenuesSchema = new SimpleSchema({
|
||||
name: {
|
||||
type: String,
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<template name="MeasureEditor">
|
||||
<td colspan="2" class="measureEditorTd">
|
||||
<div class="editorDiv"><label>Name:</label><input name="name" class="form-control" type="text" value="{{name}}" autocomplete="off" required></div>
|
||||
<div class="editorDiv"><label>Postfix:</label><input name="postfix" class="form-control" type="text" value="{{name}}" autocomplete="off" required></div>
|
||||
<div class="editorDiv"><label>Postfix:</label><input name="postfix" class="form-control" type="text" value="{{postfix}}" autocomplete="off" required></div>
|
||||
</td>
|
||||
<td class="center measureEditorTd actions"><i class="editorApply fa fa-check-square-o fa-lg noselect clickable" aria-hidden="true"></i> / <i class="editorCancel fa fa-times-circle fa-lg noselect clickable" aria-hidden="true"></i></td>
|
||||
</template>
|
||||
|
||||
@@ -38,7 +38,7 @@ Template.Production.onCreated(function() {
|
||||
query.deletedAt = {$exists: false};
|
||||
}
|
||||
|
||||
Template.Production.batchesSubscription = Meteor.subscribe("batches", query, sort, QUERY_LIMIT, Session.get(PREFIX + 'skipCount'));
|
||||
Template.Production.batchesSubscription = Meteor.subscribe("batches", query, sort, Session.get(PREFIX + "queryLimit"), Session.get(PREFIX + 'skipCount'));
|
||||
Session.set(PREFIX + 'batchCount', Meteor.call('getBatchCount', Session.get(PREFIX + 'searchQuery')));
|
||||
});
|
||||
});
|
||||
@@ -463,4 +463,4 @@ Template.BatchDateRangeSearch.dateChanged = function(isStart, event, template) {
|
||||
Session.set(PREFIX + 'searchFields', searchFields);
|
||||
Session.set(PREFIX + 'skipCount', 0); //Reset the paging of the results.
|
||||
Session.set(PREFIX + "queryLimit", QUERY_LIMIT); //Reset the query limit in case we loaded more
|
||||
};
|
||||
};
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class='control-label'>Product</label>
|
||||
<input name="product" class="form-control" type="text" required/>
|
||||
<div class="form-group-line"><input name="product" class="form-control" type="text" required/><span class="spacer"></span><span class='speechBtn'><a class="speechLink"><i class="fa fa-microphone" aria-hidden="true"></i></a></span></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class='control-label'>Venue</label>
|
||||
|
||||
234
imports/ui/Sales.import.styl
vendored
234
imports/ui/Sales.import.styl
vendored
@@ -1,159 +1,183 @@
|
||||
#salesMain
|
||||
display: table
|
||||
content-box: border-box
|
||||
padding: 10px 20px
|
||||
height: 100%
|
||||
width: 100%
|
||||
text-align: left
|
||||
display table
|
||||
content-box border-box
|
||||
padding 10px 20px
|
||||
height 100%
|
||||
width 100%
|
||||
text-align left
|
||||
.controls
|
||||
text-align: left
|
||||
display: table
|
||||
width: 100%
|
||||
text-align left
|
||||
display table
|
||||
width 100%
|
||||
.pageControls
|
||||
padding: 4px 8px
|
||||
margin: 4px 8px
|
||||
display: table-cell
|
||||
width: 240px
|
||||
padding 4px 8px
|
||||
margin 4px 8px
|
||||
display table-cell
|
||||
width 240px
|
||||
.tableControls
|
||||
text-align: right
|
||||
padding: 4px 8px
|
||||
margin: 4px 12px 4px 8px
|
||||
display: table-cell
|
||||
text-align right
|
||||
padding 4px 8px
|
||||
margin 4px 12px 4px 8px
|
||||
display table-cell
|
||||
.table
|
||||
table-layout: fixed
|
||||
min-width: 100%
|
||||
table-layout fixed
|
||||
min-width 100%
|
||||
thead, tbody
|
||||
> tr
|
||||
> .amount
|
||||
width: 90px
|
||||
min-width: 90px
|
||||
width 90px
|
||||
min-width 90px
|
||||
> .product
|
||||
width: 100%
|
||||
min-width: 140px
|
||||
width 100%
|
||||
min-width 140px
|
||||
> .price
|
||||
width: 140px
|
||||
min-width: 140px
|
||||
width 140px
|
||||
min-width 140px
|
||||
> .measure
|
||||
width: 100px
|
||||
min-width: 100px
|
||||
width 100px
|
||||
min-width 100px
|
||||
> .saleDate
|
||||
width: 150px
|
||||
min-width: 150px
|
||||
width 150px
|
||||
min-width 150px
|
||||
> .createdDate
|
||||
width: 100px
|
||||
min-width: 100px
|
||||
width 100px
|
||||
min-width 100px
|
||||
> .venue
|
||||
width: 160px
|
||||
min-width: 160px
|
||||
width 160px
|
||||
min-width 160px
|
||||
> .actions
|
||||
width: 90px
|
||||
min-width: 90px
|
||||
width 90px
|
||||
min-width 90px
|
||||
.separatedTableHeader
|
||||
table
|
||||
thead
|
||||
> tr
|
||||
> th.actions
|
||||
.newSaleButton
|
||||
padding: 0 12px
|
||||
padding 0 12px
|
||||
.fa-plus-circle
|
||||
display: inline-block
|
||||
display inline-block
|
||||
.fa-times-circle
|
||||
display: none
|
||||
display none
|
||||
.newSaleButton.active
|
||||
background-color: #fb557b
|
||||
color: black
|
||||
background-color #fb557b
|
||||
color black
|
||||
.fa-times-circle
|
||||
display: inline-block
|
||||
display inline-block
|
||||
.fa-plus-circle
|
||||
display: none
|
||||
display none
|
||||
.showOnlyComments
|
||||
color: #bcb95f
|
||||
padding: 4px 8px
|
||||
.showOnlyComments:hover
|
||||
color: white
|
||||
text-shadow: 0px 0px 10px #ff6d1f
|
||||
color #bcb95f
|
||||
padding 4px 8px
|
||||
.showOnlyCommentshover
|
||||
color white
|
||||
text-shadow 0px 0px 10px #ff6d1f
|
||||
.showOnlyComments.on
|
||||
color: white
|
||||
color white
|
||||
> th.saleDate
|
||||
input
|
||||
width: 130px
|
||||
width 130px
|
||||
.listRow
|
||||
display: table-row
|
||||
display table-row
|
||||
.listCell
|
||||
display: table-cell
|
||||
position: relative
|
||||
height: 100%
|
||||
width: 100%
|
||||
display table-cell
|
||||
position relative
|
||||
height 100%
|
||||
width 100%
|
||||
.tableContainer
|
||||
position: absolute
|
||||
top: 0
|
||||
bottom: 0
|
||||
left: 0
|
||||
right: 0
|
||||
width: auto
|
||||
height: auto
|
||||
border: 0
|
||||
font-size: 12.5px
|
||||
overflow-y: scroll
|
||||
position absolute
|
||||
top 0
|
||||
bottom 0
|
||||
left 0
|
||||
right 0
|
||||
width auto
|
||||
height auto
|
||||
border 0
|
||||
font-size 12.5px
|
||||
overflow-y scroll
|
||||
label
|
||||
font-size: 10px
|
||||
font-weight: 800
|
||||
font-size 10px
|
||||
font-weight 800
|
||||
table
|
||||
thead
|
||||
visibility: hidden
|
||||
display: none
|
||||
visibility hidden
|
||||
display none
|
||||
.saleRemove
|
||||
color: red
|
||||
margin-left: 8px
|
||||
color red
|
||||
margin-left 8px
|
||||
.saleEdit
|
||||
color: darkblue
|
||||
margin-right: 8px
|
||||
color darkblue
|
||||
margin-right 8px
|
||||
.editorApply
|
||||
color: green
|
||||
color green
|
||||
.editorCancel
|
||||
color: red
|
||||
color red
|
||||
.saleDate
|
||||
text-align: left
|
||||
text-align left
|
||||
.createdDate
|
||||
text-align: left
|
||||
text-align left
|
||||
.editComment
|
||||
color: grey
|
||||
color grey
|
||||
.hasComment
|
||||
color: black
|
||||
color black
|
||||
.actionEdit
|
||||
margin-right: 6px
|
||||
color: #44F
|
||||
margin-right 6px
|
||||
color #44F
|
||||
.saleEditor
|
||||
.heading
|
||||
font-size: 2em
|
||||
font-family: verdana, arial, helvetica, sans-serif
|
||||
text-transform: uppercase
|
||||
font-weight: 800
|
||||
margin: 6px 0 14px 0
|
||||
font-size 2em
|
||||
font-family verdana, arial, helvetica, sans-serif
|
||||
text-transform uppercase
|
||||
font-weight 800
|
||||
margin 6px 0 14px 0
|
||||
.priceContainer
|
||||
display: table
|
||||
width: 100%
|
||||
display table
|
||||
width 100%
|
||||
.price
|
||||
display: table-cell
|
||||
padding-right: 10px
|
||||
display table-cell
|
||||
padding-right 10px
|
||||
.priceButtons
|
||||
display: table-cell
|
||||
width: 1.5em
|
||||
display table-cell
|
||||
width 1.5em
|
||||
.setDefaultPrice
|
||||
font-size: 1.5em
|
||||
padding: 6px 8px
|
||||
margin-left: 8px
|
||||
border-radius: 8px
|
||||
.setDefaultPrice:hover
|
||||
text-shadow: 0px 0px 6px #00b900
|
||||
.setDefaultPrice:active
|
||||
text-shadow: 0px 0px 6px grey
|
||||
font-size 1.5em
|
||||
padding 6px 8px
|
||||
margin-left 8px
|
||||
border-radius 8px
|
||||
.setDefaultPricehover
|
||||
text-shadow 0px 0px 6px #00b900
|
||||
.setDefaultPriceactive
|
||||
text-shadow 0px 0px 6px grey
|
||||
.insertSaleForm
|
||||
.form-group, label
|
||||
text-align: left
|
||||
text-align left
|
||||
.formGroupHeading
|
||||
font-size: 1.6em
|
||||
font-family: "Arial Black", "Arial Bold", Gadget, sans-serif
|
||||
font-style: normal
|
||||
font-variant: normal
|
||||
font-weight: 500
|
||||
font-size 1.6em
|
||||
font-family "Arial Black", "Arial Bold", Gadget, sans-serif
|
||||
font-style normal
|
||||
font-variant normal
|
||||
font-weight 500
|
||||
input[name='product']
|
||||
display table-cell
|
||||
width 100%
|
||||
.speechBtn
|
||||
display table-cell
|
||||
width 1px
|
||||
.speechLink
|
||||
width 6px
|
||||
margin 3px
|
||||
margin-left 6px
|
||||
margin-right 0
|
||||
padding 6px
|
||||
border 2px solid black
|
||||
border-radius 4px
|
||||
.speechLink:hover
|
||||
background-color #cbcbcb
|
||||
border-color #4b4b4b
|
||||
.speechLink:active
|
||||
background-color #b0b0b0
|
||||
border-color #000000
|
||||
.form-group-line
|
||||
display table
|
||||
width 100%
|
||||
white-space nowrap
|
||||
@@ -457,6 +457,30 @@ Template.InsertSale.events({
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
"click .speechLink": function(event, template) {
|
||||
try {
|
||||
let SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
||||
let r = new SpeechRecognition();
|
||||
|
||||
r.lang='en-US';
|
||||
r.interimResult = false;
|
||||
r.maxAlternatives = 0;
|
||||
r.start();
|
||||
r.onresult = function(event) {
|
||||
let product = template.$('input[name="product"]');
|
||||
product.val(event.results[0][0].transcript);
|
||||
let combo = product.data("de.combo");
|
||||
|
||||
combo.show();
|
||||
combo.filter();
|
||||
//Count the number of leaf nodes that are visible.
|
||||
combo.$list.find('li.visible[role="leaf"]').length
|
||||
}
|
||||
}
|
||||
catch(e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
Template.InsertSale.helpers({
|
||||
|
||||
Reference in New Issue
Block a user