Skip to content

Commit

Permalink
more crap before on case tout
Browse files Browse the repository at this point in the history
  • Loading branch information
thesam73 committed Apr 12, 2014
1 parent 778a90a commit a8a2ff9
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 97 deletions.
47 changes: 39 additions & 8 deletions iou-meteor.css
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ html, button, input, textarea, select {
font-size: 1.2em;
/* color: #313140!important;*/
}
.summary__table tr td:last-child{
.summary__table tr td:nth-child(2){
text-align: left;
font-size: 1.2em;
font-weight: 700;
Expand All @@ -140,6 +140,33 @@ html, button, input, textarea, select {
display: inline-block;
height: 3em;
}
.summary__progress__bar {
position: relative;
display: inline-block;
padding: 0!important;
outline: none;
border: none;
color: #fff;
text-transform: uppercase;
letter-spacing: 2px;
font-size: 1em;
line-height: 1.5;
width: 175px;
}

.summary__progress__bar .progress {
/*background: #148544;*/
}

.summary__progress__bar .progress-inner {
position: absolute;
left: 0;
width: 75%;
height: 100%;
}
.summary__progress__bar{
background-color: #bababa;
}
.depenses{
width: 100%;
/* background-color: #FFF;
Expand All @@ -156,25 +183,29 @@ html, button, input, textarea, select {
text-align:center;
width: 95%;
}
.class__rent {

.class__total, .table__total .summary__progress__bar .progress-inner {
background-color: #313140;
}
.class__rent, .table__rent .summary__progress__bar .progress-inner {
background-color: #7f8c8d;
}
.class__bills {
.class__bills, .table__bills .summary__progress__bar .progress-inner {
background-color: #2ecc71;
}
.class__food {
.class__food, .table__food .summary__progress__bar .progress-inner {
background-color: #3498db;
}
.class__shopping {
.class__shopping, .table__shopping .summary__progress__bar .progress-inner {
background-color: #9b59b6;
}
.class__supermarket {
.class__supermarket, .table__supermarket .summary__progress__bar .progress-inner {
background-color: #00CCC1;
}
.class__activity {
.class__activity, .table__activity .summary__progress__bar .progress-inner {
background-color: #e67e22;
}
.class__car {
.class__car, .table__car .summary__progress__bar .progress-inner {
background-color: #34495e;
}

Expand Down
Binary file modified iou-meteor.esproj/user.sam.espressostorage
Binary file not shown.
68 changes: 68 additions & 0 deletions iou-meteor.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,74 @@ <h2>{{nameDebt}}</h2>
</template>

<template name="summary">

<table class="summary__table">
<tr class="table__total">
<td class="icon-list"></td>
<td class="money">$ {{totalAmount}} {{totalRatio}}</td>
<td class="summary__progress__bar">
<span class="content">Total</span>
<span class="progress"><span class="progress-inner"></span></span>
</td>
</tr>
<tr class="table__rent">
<td class="icon-home"></td>
<td class="money">$ {{rentAmount}}</td>
<td class="summary__progress__bar">
<span class="content">Rent</span>
<span class="progress"><span class="progress-inner"></span></span>
</td>
</tr>
<tr class="table__bills">
<td class="icon-setting-1"></td>
<td class="money">$ {{billsAmount}}</td>
<td class="summary__progress__bar">
<span class="content">Bills</span>
<span class="progress"><span class="progress-inner"></span></span>
</td>
</tr>
<tr class="table__food">
<td class="icon-fast-food"></td>
<td class="money">$ {{foodAmount}}</td>
<td class="summary__progress__bar">
<span class="content">Food</span>
<span class="progress"><span class="progress-inner"></span></span>
</td>
</tr>
<tr class="table__supermarket">
<td class="icon-shopping-cart"></td>
<td class="money">$ {{supermarketAmount}}</td>
<td class="summary__progress__bar">
<span class="content">SuperMarket</span>
<span class="progress"><span class="progress-inner"></span></span>
</td>
</tr>
<tr class="table__shopping">
<td class="icon-tshirt"></td>
<td class="money">$ {{shoppingAmount}}</td>
<td class="summary__progress__bar">
<span class="content">Shopping</span>
<span class="progress"><span class="progress-inner"></span></span>
</td>
</tr>
<tr class="table__activity">
<td class="icon-ticket"></td>
<td class="money">$ {{activityAmount}}</td>
<td class="summary__progress__bar">
<span class="content">Activity</span>
<span class="progress"><span class="progress-inner"></span></span>
</td>
</tr>
<tr class="table__car">
<td class="icon-boat"></td>
<td class="money">$ {{carAmount}}</td>
<td class="summary__progress__bar">
<span class="content">Car</span>
<span class="progress"><span class="progress-inner"></span></span>
</td>
</tr>
</table>

<div class="chartdonut">
<canvas id="myChart" width="200px" height="200px"></canvas>
</div>
Expand Down
179 changes: 90 additions & 89 deletions iou-meteor.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,69 +57,69 @@ function drawChartCurrent(){
fillColor : "#9b59b6",
strokeColor : "#7f8c8d",
data: [
totalCat(Depenses.find({
category: 'rent',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'bills',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'food',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'supermarket',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'shopping',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'activity',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'car',
timestamp: {$gte: startmonth, $lte: endmonth}
}))
]
totalCat(Depenses.find({
category: 'rent',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'bills',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'food',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'supermarket',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'shopping',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'activity',
timestamp: {$gte: startmonth, $lte: endmonth}
})),
totalCat(Depenses.find({
category: 'car',
timestamp: {$gte: startmonth, $lte: endmonth}
}))
]
},
{
fillColor : "#2ecc71",
strokeColor : "#7f8c8d",
data: [
totalCat(Depenses.find({
category: 'rent',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'bills',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'food',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'supermarket',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'shopping',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'activity',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'car',
timestamp: {$gte: startlastmonth, $lte: startmonth}
}))
]
totalCat(Depenses.find({
category: 'rent',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'bills',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'food',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'supermarket',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'shopping',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'activity',
timestamp: {$gte: startlastmonth, $lte: startmonth}
})),
totalCat(Depenses.find({
category: 'car',
timestamp: {$gte: startlastmonth, $lte: startmonth}
}))
]
}
]
};
Expand Down Expand Up @@ -268,38 +268,39 @@ if (Meteor.isClient) {
drawChart();
}
Template.summary.totalAmount = function() {

var ds = new Date();
var curr_dates = ds.getDate();
var curr_months = ds.getMonth() + 1; //Months are zero based
var curr_years = ds.getFullYear();
var dates = '' + curr_years + ', ' + (curr_months<=9 ? '0' + curr_months : curr_months) + ', ' + '00';

//Items.find({timestamp: { $lt: new Date(), $gt: new Date(curr_date+','+curr_month) }});
// return totalmonthCat(Depenses.find({timestamp: { $lt: new Date(), $gte: new Date(curr_years, curr_months, 0) }}));
return totalCat(Depenses.find({}));
return totalCat(Depenses.find({}));
}
Template.summary.rentAmount = function() {
return totalCat(Depenses.find({category: 'rent'}));
}
Template.summary.billsAmount = function() {
return totalCat(Depenses.find({category: 'bills'}));
}
Template.summary.foodAmount = function() {
return totalCat(Depenses.find({category: 'food'}));
}
Template.summary.shoppingAmount = function() {
return totalCat(Depenses.find({category: 'shopping'}));
}
Template.summary.supermarketAmount = function() {
return totalCat(Depenses.find({category: 'supermarket'}));
}
Template.summary.activityAmount = function() {
return totalCat(Depenses.find({category: 'activity'}));
}
Template.summary.carAmount = function() {
return totalCat(Depenses.find({category: 'car'}));
}
Template.summary.totalRatio = function() {
var d = new Date();
var curr_month = d.getMonth() + 1; //Months are zero based
var curr_year = d.getFullYear();
var startmonth = curr_year + '-' + (curr_month<=9 ? '0' + curr_month : curr_month) + '-01';
var endmonth = curr_year + '-' + (curr_month<=9 ? '0' + curr_month : curr_month) + '-31';
curr_month = curr_month - 1;
var startlastmonth = curr_year + '-' + (curr_month<=9 ? '0' + curr_month : curr_month) + '-01';
return totalCat(Depenses.find({timestamp: {$gte: startlastmonth, $lte: startmonth}}));
}
Template.summary.rentAmount = function() {
return totalCat(Depenses.find({category: 'rent'}));
}
Template.summary.billsAmount = function() {
return totalCat(Depenses.find({category: 'bills'}));
}
Template.summary.foodAmount = function() {
return totalCat(Depenses.find({category: 'food'}));
}
Template.summary.shoppingAmount = function() {
return totalCat(Depenses.find({category: 'shopping'}));
}
Template.summary.supermarketAmount = function() {
return totalCat(Depenses.find({category: 'supermarket'}));
}
Template.summary.activityAmount = function() {
return totalCat(Depenses.find({category: 'activity'}));
}
Template.summary.carAmount = function() {
return totalCat(Depenses.find({category: 'car'}));
}

Template.summaryall.rendered = function() {
drawChartCurrent();
Expand Down

0 comments on commit a8a2ff9

Please sign in to comment.