Added a reports page with a set of links to download CSV reports.

This commit is contained in:
Wynne Crisman
2019-01-01 11:48:56 -08:00
parent 6c17639e0c
commit 5ccb8e6a44
16 changed files with 910 additions and 1588 deletions

7
imports/ui/Reports.html Normal file
View File

@@ -0,0 +1,7 @@
<template name="Reports">
<div id="reports">
<a download="AnnualTotals.csv" href="/reports/AnnualTotals">Annual Totals (csv)</a><br/>
<a download="MonthlyTotals.csv" href="/reports/MonthlyTotals">Monthly Totals (csv)</a><br/>
<a download="TagTotals.csv" href="/reports/TagTotals">Tag Totals (csv)</a><br/>
</div>
</template>

8
imports/ui/Reports.import.styl vendored Normal file
View File

@@ -0,0 +1,8 @@
#reports
display: table
content-box: border-box
padding: 10px 20px
height: 100%
width: 100%
text-align: left
margin-left:20px

54
imports/ui/Reports.js Normal file
View File

@@ -0,0 +1,54 @@
import './Reports.html';
let PREFIX = "reports.";
//let SalesTotals = new Meteor.Collection("salesTotals");
//
//Meteor.subscribe("venues");
//Meteor.subscribe("productTags");
let salesTotalsSubscription;
Template.Reports.onCreated(function() {
//let template = Template.instance();
//Tracker.autorun(function() {
// salesTotalsSubscription = template.subscribe("salesTotals", Session.get(PREFIX + "time"), Session.get(PREFIX + "options"));
//});
});
Template.Reports.onRendered(function() {
//Template.instance()
//Tracker.autorun(function() {
// if(salesTotalsSubscription.ready()) {
//
// }
//});
});
//Template.Reports.helpers({
// sales: function() {
// let sort = [];
//
// sort.push(['year', 'asc']);// year = 1;
// if(Session.get(PREFIX + "time") === 'weekly') sort.push(['week', 'asc']); // .week = 1;
// if(Session.get(PREFIX + "time") === 'monthly') sort.push(['month', 'asc']); // .month = 1;
// if(Session.get(PREFIX + "options") === 'markets') sort.push(['venue', 'asc']); // .month = 1;
//
// return SalesTotals.find({}, {sort: sort});
// },
// showTime: function(time) {
// return Session.get(PREFIX + "time") === time;
// },
// showOption: function(option) {
// return Session.get(PREFIX + "options") === option;
// },
// formatTotal: function(total) {
// return "$" + total.toFixed(2);
// }
//});
//Template.Reports.events({
// 'click annualNumbers': function(event, template) {
//
// }
//});

View File

@@ -51,6 +51,13 @@
</a>
</li>
</ul>
<ul>
<li class="{{isActiveRoute 'Reports'}}">
<a href="{{pathFor 'Reports'}}">
Reports
</a>
</li>
</ul>
</div>
<div class="footer">
&copy; Petit Teton LLC 2017