Migrated to bootstrap 3.0.x
This commit is contained in:
1 parent
a300db9845
commit
5dd9543b38
12 files changed
+257
-12105
No files matched your search
@@ -112,6 +112,19 @@ var AccountController = function($scope, $http, $rootScope, $window) {
|
||||
|
||||
// Reload accounts to update solds.
|
||||
$scope.loadAccounts();
|
||||
}).error(function(data) {
|
||||
if(data.error_type == 'validation') {
|
||||
angular.forEach(data.errors, function(errors, field) {
|
||||
// $scope.form[field].$setValidity('server', false);
|
||||
//$scope.errors[field] = errors.join(', ');
|
||||
});
|
||||
} else {
|
||||
$.pnotify({
|
||||
type: "error",
|
||||
title: "Save",
|
||||
text: data.errors
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
var EntryController = function($scope, $http, $rootScope, $filter) {
|
||||
// Entry store and selection
|
||||
$scope.entries = [];
|
||||
$scope.categories = [];
|
||||
$scope.chartValues = [];
|
||||
$scope.pieChartValues = [];
|
||||
$scope.selectedItem = null;
|
||||
|
||||
$scope.account = null;
|
||||
@@ -61,15 +64,24 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
|
||||
}
|
||||
});
|
||||
|
||||
$scope.chartValues = chartValues;
|
||||
|
||||
// Second pass: transform to an array readable by jqplot.
|
||||
var pieChartValues = [];
|
||||
angular.forEach(pieChartValuesTmp, function(value, key) {
|
||||
pieChartValues.push([key, value]);
|
||||
});
|
||||
|
||||
$scope.pieChartValues = pieChartValues;
|
||||
|
||||
//$scope.categories.length = 0;
|
||||
//$scope.categories.concat(categories);
|
||||
$scope.categories = categories;
|
||||
|
||||
$scope.drawChart({account: $scope.account, entries: chartValues}, "#entries-chart-placeholder");
|
||||
$scope.drawPieChart(pieChartValues, "#expense-categories-chart-placeholder");
|
||||
nv.addGraph($scope.drawChart);
|
||||
nv.addGraph($scope.drawPieChart);
|
||||
//$scope.drawPieChart(pieChartValues, "#expense-categories-chart-placeholder");
|
||||
//$scope.drawPieChart();
|
||||
};
|
||||
|
||||
$scope.getAccountStatus = function(account, month) {
|
||||
@@ -200,17 +212,17 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
|
||||
|
||||
$scope.iconSaveClass = function(entry) {
|
||||
if(!$scope.isSaved(entry)) {
|
||||
return "icon-plus";
|
||||
return "fa fa-plus";
|
||||
} else if ($scope.isEditing(entry)) {
|
||||
return "icon-ok";
|
||||
return "fa fa-floppy-o";
|
||||
}
|
||||
};
|
||||
|
||||
$scope.iconCancelClass = function(entry) {
|
||||
if($scope.isNew(entry)) {
|
||||
return "icon-remove";
|
||||
return "fa fa-times";
|
||||
} else if ($scope.isEditing(entry)) {
|
||||
return "icon-ban-circle";
|
||||
return "fa fa-ban";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -330,13 +342,13 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
|
||||
};
|
||||
|
||||
// Function to draw the sold evolution chart.
|
||||
$scope.drawChart = function(data, elementId) {
|
||||
$scope.drawChart = function() {
|
||||
// Clear previous chart
|
||||
//var element = angular.element(elementId);
|
||||
//element.html("");
|
||||
//element.css("height", "0px");
|
||||
|
||||
var entries = data.entries;
|
||||
var entries = $scope.chartValues;
|
||||
console.debug("drawChart", entries);
|
||||
|
||||
var width = 700;
|
||||
var height = 300;
|
||||
|
||||
//if(entries && entries.length > 1) {
|
||||
// Prepare for today vertical line.
|
||||
@@ -346,27 +358,35 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
|
||||
|
||||
// Find first and last days to set limits of the x axis.
|
||||
var day = 24 * 60 * 60 * 1000;
|
||||
|
||||
var firstDate = $filter('date')(new Date(Date.parse(entries[0][0]).valueOf() - day), 'yyyy-MM-dd');
|
||||
var lastDate = $filter('date')(new Date(Date.parse(entries[entries.length -1][0]).valueOf() + day), 'yyyy-MM-dd');
|
||||
//var firstDate = new Date(Date.parse(entries[0][0]).valueOf() - day);
|
||||
//var lastDate = new Date(Date.parse(entries[entries.length -1][0]).valueOf() + day);
|
||||
|
||||
// Plot chart, and store it in a window parameter for resize callback (need to be done better than it...)
|
||||
var chart = nv.models.lineChart()
|
||||
.x(function(d) { return d3.time.format("%Y-%m-%d").parse(d[0]); })
|
||||
.y(function(d) { return new Number(d[1]); });
|
||||
|
||||
var chart = nv.models.lineChart().options({
|
||||
x: function(d) { return d3.time.format("%Y-%m-%d").parse(d[0]); },
|
||||
y: function(d) { return new Number(d[1]); },
|
||||
transitionDuration: 250,
|
||||
showXAxis: true,
|
||||
showYAxis: true,
|
||||
width: width,
|
||||
height: height,
|
||||
});
|
||||
|
||||
chart.lines.interpolate("monotone");
|
||||
|
||||
chart.xAxis.axisLabel("Date").tickFormat(function(d) {
|
||||
return d3.time.format("%Y-%m-%d")(new Date(d));
|
||||
});
|
||||
chart.xAxis.scale().range([firstDate, lastDate]);
|
||||
chart.xAxis
|
||||
.axisLabel("Date")
|
||||
.tickFormat(function(d) {
|
||||
return d3.time.format("%Y-%m-%d")(new Date(d));
|
||||
});
|
||||
//chart.xAxis.scale().range([firstDate, lastDate]);
|
||||
|
||||
chart.yAxis.axisLabel("Solde").tickFormat(d3.format('.02f'));
|
||||
chart.yAxis
|
||||
.axisLabel("Solde")
|
||||
.tickFormat(d3.format('.02f'));
|
||||
|
||||
// FIXME add vertical line for today
|
||||
graph = d3.select(elementId + " svg").datum([
|
||||
graph = d3.select("#entries-chart-placeholder").datum([
|
||||
{ color: "orange", key: "Zero", values:[
|
||||
[firstDate, "0"],
|
||||
[lastDate, "0"]
|
||||
@@ -376,23 +396,40 @@ var EntryController = function($scope, $http, $rootScope, $filter) {
|
||||
[lastDate, new Number($scope.account.authorized_overdraft)]
|
||||
]},
|
||||
{ color: "darkblue", key: "Sold evolution", values: entries},
|
||||
]).transition().duration(1200).call(chart);
|
||||
])
|
||||
.transition().duration(1200)
|
||||
.attr("width", width)
|
||||
.attr("height", height)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
|
||||
return chart;
|
||||
};
|
||||
|
||||
// Function to draw the expense category pie chart.
|
||||
$scope.drawPieChart = function(entries, elementId) {
|
||||
//if(entries && entries.length > 1) {
|
||||
$scope.drawPieChart = function() {
|
||||
// FIXME retrieve width and height from DOM
|
||||
var width = 300;
|
||||
var height = 300;
|
||||
|
||||
var chart = nv.models.pieChart()
|
||||
.x(function(d) { return d[0]; })
|
||||
.x(function(d) { console.debug(d); return d[0]; })
|
||||
.y(function(d) { return d[1]; })
|
||||
.width(width)
|
||||
.height(height)
|
||||
.showLabels(true);
|
||||
|
||||
d3.select(elementId + " svg").datum([{key: "Expenses", values: entries}]).transition().duration(1200).call(chart);
|
||||
d3.select("#expense-categories-chart-placeholder")
|
||||
.datum($scope.pieChartValues)
|
||||
.transition().duration(1200)
|
||||
.attr('width', width)
|
||||
.attr('height', height)
|
||||
.call(chart);
|
||||
|
||||
nv.utils.windowResize(chart.update);
|
||||
//}
|
||||
|
||||
return chart
|
||||
};
|
||||
|
||||
$rootScope.$on("monthsLoadedEvent", function(event, args){
|
||||
|
||||
@@ -62,17 +62,17 @@ var SchedulerController = function($scope, $http, $rootScope, $filter) {
|
||||
|
||||
$scope.iconSaveClass = function(operation) {
|
||||
if($scope.isNew(operation)) {
|
||||
return "icon-plus";
|
||||
return "fa fa-plus";
|
||||
} else if ($scope.isEditing(operation)) {
|
||||
return "icon-ok";
|
||||
return "fa fa-floppy-o";
|
||||
}
|
||||
};
|
||||
|
||||
$scope.iconCancelClass = function(operation) {
|
||||
if($scope.isNew(operation)) {
|
||||
return "icon-remove";
|
||||
return "fa fa-times";
|
||||
} else if ($scope.isEditing(operation)) {
|
||||
return "icon-ban-circle";
|
||||
return "fa fa-ban";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -21,18 +21,22 @@
|
||||
|
||||
<!-- Dialog body -->
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal">
|
||||
<div class="control-group">
|
||||
<form class="form-horizontal" role="form">
|
||||
<div class="form-group">
|
||||
<!-- Account name field -->
|
||||
<label class="control-label" for="inputName">Nom du compte</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="inputName" ng-model="account.name"></input>
|
||||
<input type="text" class="form-control" id="inputName" ng-model="account.name"/>
|
||||
|
||||
<div class="errors" ng-show="form.inputName.$dirty && form.inputName.$invalid">
|
||||
<span ng-show="form.inputName.$error.server">{{ errors.name }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Authorized overdraft field -->
|
||||
<label class="control-label" for="inputAuthorizedOverdraft">Découvert authorisé</label>
|
||||
<div class="controls">
|
||||
<input type="text" id="inputAuthorizedOverdraft" ng-model="account.authorized_overdraft"></input>
|
||||
<input type="text" class="form-control" id="inputAuthorizedOverdraft" ng-model="account.authorized_overdraft"/>
|
||||
|
||||
<div class="errors" ng-show="form.inputAuthorizedOverdraft.$dirty && form.inputAuthorizedOverdraft.$invalid">
|
||||
<span ng-show="form.inputAuthorizedOverdraft.$error.server">{{ errors.authorized_overdraft }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
<!--
|
||||
This file is part of Accountant.
|
||||
|
||||
Accountant is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Foobar is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<!-- Dialog header with title -->
|
||||
<div class="modal-header">
|
||||
<h3>Supprimer l'entrée [[entry.label]]</h3>
|
||||
</div>
|
||||
|
||||
<!-- Dialog body -->
|
||||
<div class="modal-body">
|
||||
<p>Confirmez-vous la suppression de cette entrée ?</p>
|
||||
</div>
|
||||
|
||||
<!-- Dialog footer with buttons -->
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-primary" ng-click="dismiss()">Non</a>
|
||||
<a href="#" class="btn" ng-click="removeEntry(entry, this)">Oui</a>
|
||||
</div>
|
||||
|
||||
-656
@@ -1,656 +0,0 @@
|
||||
|
||||
/********************
|
||||
* HTML CSS
|
||||
*/
|
||||
|
||||
|
||||
.chartWrap {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
/********************
|
||||
* TOOLTIP CSS
|
||||
*/
|
||||
|
||||
.nvtooltip {
|
||||
position: absolute;
|
||||
background-color: rgba(255,255,255,1);
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
z-index: 10000;
|
||||
|
||||
font-family: Arial;
|
||||
font-size: 13px;
|
||||
|
||||
transition: opacity 500ms linear;
|
||||
-moz-transition: opacity 500ms linear;
|
||||
-webkit-transition: opacity 500ms linear;
|
||||
|
||||
transition-delay: 500ms;
|
||||
-moz-transition-delay: 500ms;
|
||||
-webkit-transition-delay: 500ms;
|
||||
|
||||
-moz-box-shadow: 4px 4px 8px rgba(0,0,0,.5);
|
||||
-webkit-box-shadow: 4px 4px 8px rgba(0,0,0,.5);
|
||||
box-shadow: 4px 4px 8px rgba(0,0,0,.5);
|
||||
|
||||
-moz-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
|
||||
pointer-events: none;
|
||||
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.nvtooltip h3 {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nvtooltip p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.nvtooltip span {
|
||||
display: inline-block;
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
.nvtooltip-pending-removal {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
/********************
|
||||
* SVG CSS
|
||||
*/
|
||||
|
||||
|
||||
svg {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
/* Trying to get SVG to act like a greedy block in all browsers */
|
||||
display: block;
|
||||
width:100%;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
|
||||
svg text {
|
||||
font: normal 12px Arial;
|
||||
}
|
||||
|
||||
svg .title {
|
||||
font: bold 14px Arial;
|
||||
}
|
||||
|
||||
.nvd3 .nv-background {
|
||||
fill: white;
|
||||
fill-opacity: 0;
|
||||
/*
|
||||
pointer-events: none;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3.nv-noData {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
/**********
|
||||
* Brush
|
||||
*/
|
||||
|
||||
.nv-brush .extent {
|
||||
fill-opacity: .125;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Legend
|
||||
*/
|
||||
|
||||
.nvd3 .nv-legend .nv-series {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nvd3 .nv-legend .disabled circle {
|
||||
fill-opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Axes
|
||||
*/
|
||||
|
||||
.nvd3 .nv-axis path {
|
||||
fill: none;
|
||||
stroke: #000;
|
||||
stroke-opacity: .75;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis path.domain {
|
||||
stroke-opacity: .75;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis.nv-x path.domain {
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis line {
|
||||
fill: none;
|
||||
stroke: #000;
|
||||
stroke-opacity: .25;
|
||||
shape-rendering: crispEdges;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis line.zero {
|
||||
stroke-opacity: .75;
|
||||
}
|
||||
|
||||
.nvd3 .nv-axis .nv-axisMaxMin text {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nvd3 .x .nv-axis .nv-axisMaxMin text,
|
||||
.nvd3 .x2 .nv-axis .nv-axisMaxMin text,
|
||||
.nvd3 .x3 .nv-axis .nv-axisMaxMin text {
|
||||
text-anchor: middle
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Brush
|
||||
*/
|
||||
|
||||
.nv-brush .resize path {
|
||||
fill: #eee;
|
||||
stroke: #666;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Bars
|
||||
*/
|
||||
|
||||
.nvd3 .nv-bars .negative rect {
|
||||
zfill: brown;
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars rect {
|
||||
zfill: steelblue;
|
||||
fill-opacity: .75;
|
||||
|
||||
transition: fill-opacity 250ms linear;
|
||||
-moz-transition: fill-opacity 250ms linear;
|
||||
-webkit-transition: fill-opacity 250ms linear;
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars rect:hover {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars .hover rect {
|
||||
fill: lightblue;
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars text {
|
||||
fill: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
.nvd3 .nv-bars .hover text {
|
||||
fill: rgba(0,0,0,1);
|
||||
}
|
||||
|
||||
|
||||
/**********
|
||||
* Bars
|
||||
*/
|
||||
|
||||
.nvd3 .nv-multibar .nv-groups rect,
|
||||
.nvd3 .nv-multibarHorizontal .nv-groups rect,
|
||||
.nvd3 .nv-discretebar .nv-groups rect {
|
||||
stroke-opacity: 0;
|
||||
|
||||
transition: fill-opacity 250ms linear;
|
||||
-moz-transition: fill-opacity 250ms linear;
|
||||
-webkit-transition: fill-opacity 250ms linear;
|
||||
}
|
||||
|
||||
.nvd3 .nv-multibar .nv-groups rect:hover,
|
||||
.nvd3 .nv-multibarHorizontal .nv-groups rect:hover,
|
||||
.nvd3 .nv-discretebar .nv-groups rect:hover {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
.nvd3 .nv-discretebar .nv-groups text,
|
||||
.nvd3 .nv-multibarHorizontal .nv-groups text {
|
||||
font-weight: bold;
|
||||
fill: rgba(0,0,0,1);
|
||||
stroke: rgba(0,0,0,0);
|
||||
}
|
||||
|
||||
/***********
|
||||
* Pie Chart
|
||||
*/
|
||||
|
||||
.nvd3.nv-pie path {
|
||||
stroke-opacity: 0;
|
||||
|
||||
transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
-moz-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
-webkit-transition: fill-opacity 250ms linear, stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
|
||||
}
|
||||
|
||||
.nvd3.nv-pie .nv-slice text {
|
||||
stroke: #000;
|
||||
stroke-width: 0;
|
||||
}
|
||||
|
||||
.nvd3.nv-pie path {
|
||||
stroke: #fff;
|
||||
stroke-width: 1px;
|
||||
stroke-opacity: 1;
|
||||
}
|
||||
|
||||
.nvd3.nv-pie .hover path {
|
||||
fill-opacity: .7;
|
||||
/*
|
||||
stroke-width: 6px;
|
||||
stroke-opacity: 1;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3.nv-pie .nv-label rect {
|
||||
fill-opacity: 0;
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
|
||||
/**********
|
||||
* Lines
|
||||
*/
|
||||
|
||||
.nvd3 .nv-groups path.nv-line {
|
||||
fill: none;
|
||||
stroke-width: 2.5px;
|
||||
/*
|
||||
stroke-linecap: round;
|
||||
shape-rendering: geometricPrecision;
|
||||
|
||||
transition: stroke-width 250ms linear;
|
||||
-moz-transition: stroke-width 250ms linear;
|
||||
-webkit-transition: stroke-width 250ms linear;
|
||||
|
||||
transition-delay: 250ms
|
||||
-moz-transition-delay: 250ms;
|
||||
-webkit-transition-delay: 250ms;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3 .nv-groups path.nv-area {
|
||||
stroke: none;
|
||||
/*
|
||||
stroke-linecap: round;
|
||||
shape-rendering: geometricPrecision;
|
||||
|
||||
stroke-width: 2.5px;
|
||||
transition: stroke-width 250ms linear;
|
||||
-moz-transition: stroke-width 250ms linear;
|
||||
-webkit-transition: stroke-width 250ms linear;
|
||||
|
||||
transition-delay: 250ms
|
||||
-moz-transition-delay: 250ms;
|
||||
-webkit-transition-delay: 250ms;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3 .nv-line.hover path {
|
||||
stroke-width: 6px;
|
||||
}
|
||||
|
||||
/*
|
||||
.nvd3.scatter .groups .point {
|
||||
fill-opacity: 0.1;
|
||||
stroke-opacity: 0.1;
|
||||
}
|
||||
*/
|
||||
|
||||
.nvd3.nv-line .nvd3.nv-scatter .nv-groups .nv-point {
|
||||
fill-opacity: 0;
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
|
||||
.nvd3.nv-scatter.nv-single-point .nv-groups .nv-point {
|
||||
fill-opacity: .5 !important;
|
||||
stroke-opacity: .5 !important;
|
||||
}
|
||||
|
||||
|
||||
.nvd3 .nv-groups .nv-point {
|
||||
transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
-moz-transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
-webkit-transition: stroke-width 250ms linear, stroke-opacity 250ms linear;
|
||||
}
|
||||
|
||||
.nvd3.nv-scatter .nv-groups .nv-point.hover,
|
||||
.nvd3 .nv-groups .nv-point.hover {
|
||||
stroke-width: 20px;
|
||||
fill-opacity: .5 !important;
|
||||
stroke-opacity: .5 !important;
|
||||
}
|
||||
|
||||
|
||||
.nvd3 .nv-point-paths path {
|
||||
stroke: #aaa;
|
||||
stroke-opacity: 0;
|
||||
fill: #eee;
|
||||
fill-opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.nvd3 .nv-indexLine {
|
||||
cursor: ew-resize;
|
||||
}
|
||||
|
||||
|
||||
/**********
|
||||
* Distribution
|
||||
*/
|
||||
|
||||
.nvd3 .nv-distribution {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Scatter
|
||||
*/
|
||||
|
||||
/* **Attempting to remove this for useVoronoi(false), need to see if it's required anywhere
|
||||
.nvd3 .nv-groups .nv-point {
|
||||
pointer-events: none;
|
||||
}
|
||||
*/
|
||||
|
||||
.nvd3 .nv-groups .nv-point.hover {
|
||||
stroke-width: 20px;
|
||||
stroke-opacity: .5;
|
||||
}
|
||||
|
||||
.nvd3 .nv-scatter .nv-point.hover {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
/*
|
||||
.nv-group.hover .nv-point {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/**********
|
||||
* Stacked Area
|
||||
*/
|
||||
|
||||
.nvd3.nv-stackedarea path.nv-area {
|
||||
fill-opacity: .7;
|
||||
/*
|
||||
stroke-opacity: .65;
|
||||
fill-opacity: 1;
|
||||
*/
|
||||
stroke-opacity: 0;
|
||||
|
||||
transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
|
||||
-moz-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
|
||||
-webkit-transition: fill-opacity 250ms linear, stroke-opacity 250ms linear;
|
||||
|
||||
/*
|
||||
transition-delay: 500ms;
|
||||
-moz-transition-delay: 500ms;
|
||||
-webkit-transition-delay: 500ms;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
.nvd3.nv-stackedarea path.nv-area.hover {
|
||||
fill-opacity: .9;
|
||||
/*
|
||||
stroke-opacity: .85;
|
||||
*/
|
||||
}
|
||||
/*
|
||||
.d3stackedarea .groups path {
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
.nvd3.nv-stackedarea .nv-groups .nv-point {
|
||||
stroke-opacity: 0;
|
||||
fill-opacity: 0;
|
||||
}
|
||||
|
||||
.nvd3.nv-stackedarea .nv-groups .nv-point.hover {
|
||||
stroke-width: 20px;
|
||||
stroke-opacity: .75;
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Line Plus Bar
|
||||
*/
|
||||
|
||||
.nvd3.nv-linePlusBar .nv-bar rect {
|
||||
fill-opacity: .75;
|
||||
}
|
||||
|
||||
.nvd3.nv-linePlusBar .nv-bar rect:hover {
|
||||
fill-opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
/**********
|
||||
* Bullet
|
||||
*/
|
||||
|
||||
.nvd3.nv-bullet { font: 10px sans-serif; }
|
||||
.nvd3.nv-bullet .nv-measure { fill-opacity: .8; }
|
||||
.nvd3.nv-bullet .nv-measure:hover { fill-opacity: 1; }
|
||||
.nvd3.nv-bullet .nv-marker { stroke: #000; stroke-width: 2px; }
|
||||
.nvd3.nv-bullet .nv-markerTriangle { stroke: #000; fill: #fff; stroke-width: 1.5px; }
|
||||
.nvd3.nv-bullet .nv-tick line { stroke: #666; stroke-width: .5px; }
|
||||
.nvd3.nv-bullet .nv-range.nv-s0 { fill: #eee; }
|
||||
.nvd3.nv-bullet .nv-range.nv-s1 { fill: #ddd; }
|
||||
.nvd3.nv-bullet .nv-range.nv-s2 { fill: #ccc; }
|
||||
.nvd3.nv-bullet .nv-title { font-size: 14px; font-weight: bold; }
|
||||
.nvd3.nv-bullet .nv-subtitle { fill: #999; }
|
||||
|
||||
|
||||
.nvd3.nv-bullet .nv-range {
|
||||
fill: #999;
|
||||
fill-opacity: .4;
|
||||
}
|
||||
.nvd3.nv-bullet .nv-range:hover {
|
||||
fill-opacity: .7;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Sparkline
|
||||
*/
|
||||
|
||||
.nvd3.nv-sparkline path {
|
||||
fill: none;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus g.nv-hoverValue {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-hoverValue line {
|
||||
stroke: #333;
|
||||
stroke-width: 1.5px;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus,
|
||||
.nvd3.nv-sparklineplus g {
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
.nvd3 .nv-hoverArea {
|
||||
fill-opacity: 0;
|
||||
stroke-opacity: 0;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-xValue,
|
||||
.nvd3.nv-sparklineplus .nv-yValue {
|
||||
/*
|
||||
stroke: #666;
|
||||
*/
|
||||
stroke-width: 0;
|
||||
font-size: .9em;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-yValue {
|
||||
stroke: #f66;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-maxValue {
|
||||
stroke: #2ca02c;
|
||||
fill: #2ca02c;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-minValue {
|
||||
stroke: #d62728;
|
||||
fill: #d62728;
|
||||
}
|
||||
|
||||
.nvd3.nv-sparklineplus .nv-currentValue {
|
||||
/*
|
||||
stroke: #444;
|
||||
fill: #000;
|
||||
*/
|
||||
font-weight: bold;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
/**********
|
||||
* historical stock
|
||||
*/
|
||||
|
||||
.nvd3.nv-ohlcBar .nv-ticks .nv-tick {
|
||||
stroke-width: 2px;
|
||||
}
|
||||
|
||||
.nvd3.nv-ohlcBar .nv-ticks .nv-tick.hover {
|
||||
stroke-width: 4px;
|
||||
}
|
||||
|
||||
.nvd3.nv-ohlcBar .nv-ticks .nv-tick.positive {
|
||||
stroke: #2ca02c;
|
||||
}
|
||||
|
||||
.nvd3.nv-ohlcBar .nv-ticks .nv-tick.negative {
|
||||
stroke: #d62728;
|
||||
}
|
||||
|
||||
.nvd3.nv-historicalStockChart .nv-axis .nv-axislabel {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.nvd3.nv-historicalStockChart .nv-dragTarget {
|
||||
fill-opacity: 0;
|
||||
stroke: none;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.nvd3 .nv-brush .extent {
|
||||
/*
|
||||
cursor: ew-resize !important;
|
||||
*/
|
||||
fill-opacity: 0 !important;
|
||||
}
|
||||
|
||||
.nvd3 .nv-brushBackground rect {
|
||||
stroke: #000;
|
||||
stroke-width: .4;
|
||||
fill: #fff;
|
||||
fill-opacity: .7;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********
|
||||
* Indented Tree
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* TODO: the following 3 selectors are based on classes used in the example. I should either make them standard and leave them here, or move to a CSS file not included in the library
|
||||
*/
|
||||
.nvd3.nv-indentedtree .name {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.nvd3.nv-indentedtree .clickable {
|
||||
color: #08C;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nvd3.nv-indentedtree span.clickable:hover {
|
||||
color: #005580;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
.nvd3.nv-indentedtree .nv-childrenCount {
|
||||
display: inline-block;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.nvd3.nv-indentedtree .nv-treeicon {
|
||||
cursor: pointer;
|
||||
/*
|
||||
cursor: n-resize;
|
||||
*/
|
||||
}
|
||||
|
||||
.nvd3.nv-indentedtree .nv-treeicon.nv-folded {
|
||||
cursor: pointer;
|
||||
/*
|
||||
cursor: s-resize;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
-11307
File diff suppressed because it is too large.
Load diff
@@ -1,5 +0,0 @@
|
||||
(function(){function t(e,t){return(new Date(t,e+1,0)).getDate()}function n(e,t,n){return function(r,i,s){var o=e(r),u=[];o<r&&t(o);if(s>1)while(o<i){var a=new Date(+o);n(a)%s===0&&u.push(a),t(o)}else while(o<i)u.push(new Date(+o)),t(o);return u}}var e=window.nv||{};e.version="0.0.1a",e.dev=!0,window.nv=e,e.tooltip={},e.utils={},e.models={},e.charts={},e.graphs=[],e.logs={},e.dispatch=d3.dispatch("render_start","render_end"),e.dev&&(e.dispatch.on("render_start",function(t){e.logs.startTime=+(new Date)}),e.dispatch.on("render_end",function(t){e.logs.endTime=+(new Date),e.logs.totalTime=e.logs.endTime-e.logs.startTime,e.log("total",e.logs.totalTime)})),e.log=function(){if(e.dev&&console.log&&console.log.apply)console.log.apply(console,arguments);else if(e.dev&&console.log&&Function.prototype.bind){var t=Function.prototype.bind.call(console.log,console);t.apply(console,arguments)}return arguments[arguments.length-1]},e.render=function(n){n=n||1,e.render.active=!0,e.dispatch.render_start(),setTimeout(function(){var t,r;for(var i=0;i<n&&(r=e.render.queue[i]);i++)t=r.generate(),typeof r.callback==typeof Function&&r.callback(t),e.graphs.push(t);e.render.queue.splice(0,i),e.render.queue.length?setTimeout(arguments.callee,0):(e.render.active=!1,e.dispatch.render_end())},0)},e.render.active=!1,e.render.queue=[],e.addGraph=function(t){typeof arguments[0]==typeof Function&&(t={generate:arguments[0],callback:arguments[1]}),e.render.queue.push(t),e.render.active||e.render()},e.identity=function(e){return e},e.strip=function(e){return e.replace(/(\s|&)/g,"")},d3.time.monthEnd=function(e){return new Date(e.getFullYear(),e.getMonth(),0)},d3.time.monthEnds=n(d3.time.monthEnd,function(e){e.setUTCDate(e.getUTCDate()+1),e.setDate(t(e.getMonth()+1,e.getFullYear()))},function(e){return e.getMonth()}),function(){var t=window.nv.tooltip={};t.show=function(t,n,r,i,s,o){var u=document.createElement("div");u.className="nvtooltip "+(o?o:"xy-tooltip"),r=r||"s",i=i||20;var a=s?s:document.getElementsByTagName("body")[0];u.innerHTML=n,u.style.left=0,u.style.top=0,u.style.opacity=0,a.appendChild(u);var f=parseInt(u.offsetHeight),l=parseInt(u.offsetWidth),c=e.utils.windowSize().width,h=e.utils.windowSize().height,p=window.scrollY,d=window.scrollX,v,m;h=window.innerWidth>=document.body.scrollWidth?h:h-16,c=window.innerHeight>=document.body.scrollHeight?c:c-16;var g=function(e){var t=m;do isNaN(e.offsetTop)||(t+=e.offsetTop);while(e=e.offsetParent);return t},y=function(e){var t=v;do isNaN(e.offsetLeft)||(t+=e.offsetLeft);while(e=e.offsetParent);return t};switch(r){case"e":v=t[0]-l-i,m=t[1]-f/2;var b=y(u),w=g(u);b<d&&(v=t[0]+i>d?t[0]+i:d-b+v),w<p&&(m=p-w+m),w+f>p+h&&(m=p+h-w+m-f);break;case"w":v=t[0]+i,m=t[1]-f/2,b+l>c&&(v=t[0]-l-i),w<p&&(m=p+5),w+f>p+h&&(m=p-f-5);break;case"n":v=t[0]-l/2-5,m=t[1]+i;var b=y(u),w=g(u);b<d&&(v=d+5),b+l>c&&(v=v-l/2+5),w+f>p+h&&(m=p+h-w+m-f);break;case"s":v=t[0]-l/2,m=t[1]-f-i;var b=y(u),w=g(u);b<d&&(v=d+5),b+l>c&&(v=v-l/2+5),p>w&&(m=p)}return u.style.left=v+"px",u.style.top=m+"px",u.style.opacity=1,u.style.position="absolute",u.style.pointerEvents="none",u},t.cleanup=function(){var e=document.getElementsByClassName("nvtooltip"),t=[];while(e.length)t.push(e[0]),e[0].style.transitionDelay="0 !important",e[0].style.opacity=0,e[0].className="nvtooltip-pending-removal";setTimeout(function(){while(t.length){var e=t.pop();e.parentNode.removeChild(e)}},500)}}(),e.utils.windowSize=function(){var e={width:640,height:480};return document.body&&document.body.offsetWidth&&(e.width=document.body.offsetWidth,e.height=document.body.offsetHeight),document.compatMode=="CSS1Compat"&&document.documentElement&&document.documentElement.offsetWidth&&(e.width=document.documentElement.offsetWidth,e.height=document.documentElement.offsetHeight),window.innerWidth&&window.innerHeight&&(e.width=window.innerWidth,e.height=window.innerHeight),e},e.utils.windowResize=function(e){var t=window.onresize;window.onresize=function(n){typeof t=="function"&&t(n),e(n)}},e.utils.getColor=function(t){return arguments.length?Object.prototype.toString.call(t)==="[object Array]"?function(e,n){return e.color||t[n%t.length]}:t:e.utils.defaultColor()},e.utils.defaultColor=function(){var e=d3.scale.category20().range();return function(t,n){return t.color||e[n%e.length]}},e.utils.customTheme=function(e,t,n){t=t||function(e){return e.key},n=n||d3.scale.category20().range();var r=n.length;return function(i,s){var o=t(i);return r||(r=n.length),typeof e[o]!="undefined"?typeof e[o]=="function"?e[o]():e[o]:n[--r]}},e.utils.pjax=function(t,n){function r(r){d3.html(r,function(r){var i=d3.select(n).node();i.parentNode.replaceChild(d3.select(r).select(n).node(),i),e.utils.pjax(t,n)})}d3.selectAll(t).on("click",function(){history.pushState(this.href,this.textContent,this.href),r(this.href),d3.event.preventDefault()}),d3.select(window).on("popstate",function(){d3.event.state&&r(d3.event.state)})},e.models.axis=function(){function d(r){return r.each(function(r){var d=d3.selectLine truncated
|
||||
e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,b):t},b.width=function(e){return arguments.length?(n=e,b):n},b.height=function(e){return arguments.length?(r=e,b):r},b.xScale=function(e){return arguments.length?(s=e,b):s},b.yScale=function(e){return arguments.length?(o=e,b):o},b.xDomain=function(e){return arguments.length?(p=e,b):p},b.yDomain=function(e){return arguments.length?(d=e,b):d},b.forceY=function(e){return arguments.length?(f=e,b):f},b.color=function(t){return arguments.length?(l=e.utils.getColor(t),b):l},b.id=function(e){return arguments.length?(i=e,b):i},b.showValues=function(e){return arguments.length?(c=e,b):c},b.valueFormat=function(e){return arguments.length?(h=e,b):h},b.rectClass=function(e){return arguments.length?(m=e,b):m},b},e.models.discreteBarChart=function(){function m(e){return e.each(function(u){var l=d3.select(this),g=this,b=(s||parseInt(l.style("width"))||960)-i.left-i.right,w=(o||parseInt(l.style("height"))||400)-i.top-i.bottom;m.update=function(){d.beforeUpdate(),e.transition().call(m)},m.container=this;if(!u||!u.length||!u.filter(function(e){return e.values.length}).length){var E=l.selectAll(".nv-noData").data([p]);return E.enter().append("text").attr("class","nvd3 nv-noData").attr("dy","-.7em").style("text-anchor","middle"),E.attr("x",i.left+b/2).attr("y",i.top+w/2).text(function(e){return e}),m}l.selectAll(".nv-noData").remove(),c=t.xScale(),h=t.yScale();var S=l.selectAll("g.nv-wrap.nv-discreteBarWithAxes").data([u]),T=S.enter().append("g").attr("class","nvd3 nv-wrap nv-discreteBarWithAxes").append("g"),N=T.append("defs"),C=S.select("g");T.append("g").attr("class","nv-x nv-axis"),T.append("g").attr("class","nv-y nv-axis"),T.append("g").attr("class","nv-barsWrap"),C.attr("transform","translate("+i.left+","+i.top+")"),t.width(b).height(w);var k=C.select(".nv-barsWrap").datum(u.filter(function(e){return!e.disabled}));d3.transition(k).call(t),N.append("clipPath").attr("id","nv-x-label-clip-"+t.id()).append("rect"),C.select("#nv-x-label-clip-"+t.id()+" rect").attr("width",c.rangeBand()*(a?2:1)).attr("height",16).attr("x",-c.rangeBand()/(a?1:2)),n.scale(c).ticks(b/100).tickSize(-w,0),C.select(".nv-x.nv-axis").attr("transform","translate(0,"+(h.range()[0]+(t.showValues()&&h.domain()[0]<0?16:0))+")"),C.select(".nv-x.nv-axis").transition().duration(0).call(n);var L=C.select(".nv-x.nv-axis").selectAll("g");a&&L.selectAll("text").attr("transform",function(e,t,n){return"translate(0,"+(n%2==0?"5":"17")+")"}),r.scale(h).ticks(w/36).tickSize(-b,0),d3.transition(C.select(".nv-y.nv-axis")).call(r),d.on("tooltipShow",function(e){f&&v(e,g.parentNode)})}),m}var t=e.models.discreteBar(),n=e.models.axis(),r=e.models.axis(),i={top:15,right:10,bottom:50,left:60},s=null,o=null,u=e.utils.getColor(),a=!1,f=!0,l=function(e,t,n,r,i){return"<h3>"+t+"</h3>"+"<p>"+n+"</p>"},c,h,p="No Data Available.",d=d3.dispatch("tooltipShow","tooltipHide","beforeUpdate");n.orient("bottom").highlightZero(!1).showMaxMin(!1).tickFormat(function(e){return e}),r.orient("left").tickFormat(d3.format(",.1f"));var v=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),a=n.tickFormat()(t.x()(i.point,i.pointIndex)),f=r.tickFormat()(t.y()(i.point,i.pointIndex)),c=l(i.series.key,a,f,i,m);e.tooltip.show([o,u],c,i.value<0?"n":"s",null,s)};return t.dispatch.on("elementMouseover.tooltip",function(e){e.pos=[e.pos[0]+i.left,e.pos[1]+i.top],d.tooltipShow(e)}),t.dispatch.on("elementMouseout.tooltip",function(e){d.tooltipHide(e)}),d.on("tooltipHide",function(){f&&e.tooltip.cleanup()}),m.dispatch=d,m.discretebar=t,m.xAxis=n,m.yAxis=r,d3.rebind(m,t,"x","y","xDomain","yDomain","forceX","forceY","id","showValues","valueFormat"),m.margin=function(e){return arguments.length?(i.top=typeof e.top!="undefined"?e.top:i.top,i.right=typeof e.right!="undefined"?e.right:i.right,i.bottom=typeof e.bottom!="undefined"?e.bottom:i.bottom,i.left=typeof e.left!="undefined"?e.left:i.left,m):i},m.width=function(e){return arguments.length?(s=e,m):s},m.height=function(e){return arguments.length?(o=e,m):o},m.color=function(n){return arguments.length?(u=e.utils.getColor(n),t.color(u),m):u},m.staggerLabels=function(e){return arguments.length?(a=e,m):a},m.tooltips=function(e){return arguments.length?(f=e,m):f},m.tooltipContent=function(e){return arguments.length?(l=e,m):l},m.noData=function(e){return arguments.length?(p=e,m):p},m},e.models.distribution=function(){function l(e){return e.each(function(e){var a=n-(i==="x"?t.left+t.right:t.top+t.bottom),l=i=="x"?"y":"x",c=d3.select(this);f=f||u;var h=c.selectAll("g.nv-distribution").data([e]),p=h.enter().append("g").attr("class","nvd3 nv-distribution"),d=p.append("g"),v=h.select("g");h.attr("transform","translate("+t.left+","+t.top+")");var m=v.selectAll("g.nv-dist").data(function(e){return e},function(e){return e.key});m.enteLine truncated
|
||||
e,C):b},C.tooltips=function(e){return arguments.length?(E=e,C):E},C.tooltipContent=function(e){return arguments.length?(S=e,C):S},C.interpolate=function(e){return arguments.length?(t.interpolate(e),n.interpolate(e),C):t.interpolate()},C.noData=function(e){return arguments.length?(x=e,C):x},C.xTickFormat=function(e){return arguments.length?(r.tickFormat(e),s.tickFormat(e),C):r.tickFormat()},C.yTickFormat=function(e){return arguments.length?(i.tickFormat(e),o.tickFormat(e),C):i.tickFormat()},C},e.models.multiBar=function(){function b(e){return e.each(function(e){var b=n-t.left-t.right,w=r-t.top-t.bottom,E=d3.select(this);c&&(e=d3.layout.stack().offset("zero").values(function(e){return e.values}).y(a)(e)),e=e.map(function(e,t){return e.values=e.values.map(function(e){return e.series=t,e}),e}),c&&e[0].values.map(function(t,n){var r=0,i=0;e.map(function(e){var t=e.values[n];t.size=Math.abs(t.y),t.y<0?(t.y1=i,i-=t.size):(t.y1=t.size+r,r+=t.size)})});var S=d&&v?[]:e.map(function(e){return e.values.map(function(e,t){return{x:u(e,t),y:a(e,t),y0:e.y0,y1:e.y1}})});i.domain(d3.merge(S).map(function(e){return e.x})).rangeBands([0,b],.1),s.domain(v||d3.extent(d3.merge(S).map(function(e){return e.y+(c?e.y1:0)}).concat(f))).range([w,0]);if(i.domain()[0]===i.domain()[1]||s.domain()[0]===s.domain()[1])singlePoint=!0;i.domain()[0]===i.domain()[1]&&(i.domain()[0]?i.domain([i.domain()[0]-i.domain()[0]*.01,i.domain()[1]+i.domain()[1]*.01]):i.domain([-1,1])),s.domain()[0]===s.domain()[1]&&(s.domain()[0]?s.domain([s.domain()[0]+s.domain()[0]*.01,s.domain()[1]-s.domain()[1]*.01]):s.domain([-1,1])),g=g||i,y=y||s;var T=E.selectAll("g.nv-wrap.nv-multibar").data([e]),N=T.enter().append("g").attr("class","nvd3 nv-wrap nv-multibar"),C=N.append("defs"),k=N.append("g"),L=T.select("g");k.append("g").attr("class","nv-groups"),T.attr("transform","translate("+t.left+","+t.top+")"),C.append("clipPath").attr("id","nv-edge-clip-"+o).append("rect"),T.select("#nv-edge-clip-"+o+" rect").attr("width",b).attr("height",w),L.attr("clip-path",l?"url(#nv-edge-clip-"+o+")":"");var A=T.select(".nv-groups").selectAll(".nv-group").data(function(e){return e},function(e){return e.key});A.enter().append("g").style("stroke-opacity",1e-6).style("fill-opacity",1e-6),d3.transition(A.exit()).selectAll("rect.nv-bar").delay(function(t,n){return n*p/e[0].values.length}).attr("y",function(e){return c?y(e.y0):y(0)}).attr("height",0).remove(),A.attr("class",function(e,t){return"nv-group nv-series-"+t}).classed("hover",function(e){return e.hover}).style("fill",function(e,t){return h(e,t)}).style("stroke",function(e,t){return h(e,t)}),d3.transition(A).style("stroke-opacity",1).style("fill-opacity",.75);var O=A.selectAll("rect.nv-bar").data(function(e){return e.values});O.exit().remove();var M=O.enter().append("rect").attr("class",function(e,t){return a(e,t)<0?"nv-bar negative":"nv-bar positive"}).attr("x",function(t,n,r){return c?0:r*i.rangeBand()/e.length}).attr("y",function(e){return y(c?e.y0:0)}).attr("height",0).attr("width",i.rangeBand()/(c?1:e.length));O.style("fill",function(e,t,n){return h(e,n,t)}).style("stroke",function(e,t,n){return h(e,n,t)}).on("mouseover",function(t,n){d3.select(this).classed("hover",!0),m.elementMouseover({value:a(t,n),point:t,series:e[t.series],pos:[i(u(t,n))+i.rangeBand()*(c?e.length/2:t.series+.5)/e.length,s(a(t,n)+(c?t.y0:0))],pointIndex:n,seriesIndex:t.series,e:d3.event})}).on("mouseout",function(t,n){d3.select(this).classed("hover",!1),m.elementMouseout({value:a(t,n),point:t,series:e[t.series],pointIndex:n,seriesIndex:t.series,e:d3.event})}).on("click",function(t,n){m.elementClick({value:a(t,n),point:t,series:e[t.series],pos:[i(u(t,n))+i.rangeBand()*(c?e.length/2:t.series+.5)/e.length,s(a(t,n)+(c?t.y0:0))],pointIndex:n,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()}).on("dblclick",function(t,n){m.elementDblClick({value:a(t,n),point:t,series:e[t.series],pos:[i(u(t,n))+i.rangeBand()*(c?e.length/2:t.series+.5)/e.length,s(a(t,n)+(c?t.y0:0))],pointIndex:n,seriesIndex:t.series,e:d3.event}),d3.event.stopPropagation()}),O.attr("class",function(e,t){return a(e,t)<0?"nv-bar negative":"nv-bar positive"}).attr("transform",function(e,t){return"translate("+i(u(e,t))+",0)"}),c?d3.transition(O).delay(function(t,n){return n*p/e[0].values.length}).attr("y",function(e,t){return s(c?e.y1:0)}).attr("height",function(e,t){return Math.max(Math.abs(s(e.y+(c?e.y0:0))-s(c?e.y0:0)),1)}).each("end",function(){d3.transition(d3.select(this)).attr("x",function(t,n){return c?0:t.series*i.rangeBand()/e.length}).attr("width",i.rangeBand()/(c?1:e.length))}):d3.transition(O).delay(function(t,n){return n*p/e[0].values.length}).attr("x",function(t,n){return t.series*i.rangeBand()/e.length}).attr("width",i.rangeBand()/e.length).each("end",function(){d3.transition(d3.select(this)).attr("y",function(e,t){return a(e,t)<0?s(0):s(0)-s(a(e,t))<1?s(0)-1:s(a(e,t))}).attr("height",function(e,t){return Math.max(Math.abs(s(a(e,t))-s(0)),1)})}),g=i.copy(),y=s.copy()}),b}vaLine truncated
|
||||
;return"m0,0l0,"+(o(f(t,n))-o(c(t,n)))+"l"+ -r/2+",0l"+r/2+",0l0,"+(o(h(t,n))-o(f(t,n)))+"l0,"+(o(l(t,n))-o(h(t,n)))+"l"+r/2+",0l"+ -r/2+",0z"})}),E}var t={top:0,right:0,bottom:0,left:0},n=960,r=500,i=Math.floor(Math.random()*1e4),s=d3.scale.linear(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=function(e){return e.open},l=function(e){return e.close},c=function(e){return e.high},h=function(e){return e.low},p=[],d=[],v=!1,m=!0,g=e.utils.defaultColor(),y,b,w=d3.dispatch("chartClick","elementClick","elementDblClick","elementMouseover","elementMouseout");return E.dispatch=w,E.x=function(e){return arguments.length?(u=e,E):u},E.y=function(e){return arguments.length?(a=e,E):a},E.open=function(e){return arguments.length?(f=e,E):f},E.close=function(e){return arguments.length?(l=e,E):l},E.high=function(e){return arguments.length?(c=e,E):c},E.low=function(e){return arguments.length?(h=e,E):h},E.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,E):t},E.width=function(e){return arguments.length?(n=e,E):n},E.height=function(e){return arguments.length?(r=e,E):r},E.xScale=function(e){return arguments.length?(s=e,E):s},E.yScale=function(e){return arguments.length?(o=e,E):o},E.xDomain=function(e){return arguments.length?(y=e,E):y},E.yDomain=function(e){return arguments.length?(b=e,E):b},E.forceX=function(e){return arguments.length?(p=e,E):p},E.forceY=function(e){return arguments.length?(d=e,E):d},E.padData=function(e){return arguments.length?(v=e,E):v},E.clipEdge=function(e){return arguments.length?(m=e,E):m},E.color=function(t){return arguments.length?(g=e.utils.getColor(t),E):g},E.id=function(e){return arguments.length?(i=e,E):i},E},e.models.pie=function(){function m(e){return e.each(function(e){function O(e){var t=(e.startAngle+e.endAngle)*90/Math.PI-90;return t>90?t-180:t}function M(e){p||(e.innerRadius=0);var t=d3.interpolate(this._current,e);return this._current=t(0),function(e){return T(t(e))}}function _(e){e.innerRadius=0;var t=d3.interpolate({startAngle:0,endAngle:0},e);return function(e){return T(t(e))}}var f=n-t.left-t.right,m=r-t.top-t.bottom,g=Math.min(f,m)/2,y=g-g/5,b=d3.select(this),w=b.selectAll(".nv-wrap.nv-pie").data([i(e[0])]),E=w.enter().append("g").attr("class","nvd3 nv-wrap nv-pie nv-chart-"+u),S=E.append("g"),x=w.select("g");S.append("g").attr("class","nv-pie"),w.attr("transform","translate("+t.left+","+t.top+")"),x.select(".nv-pie").attr("transform","translate("+f/2+","+m/2+")"),b.on("click",function(e,t){v.chartClick({data:e,index:t,pos:d3.event,id:u})});var T=d3.svg.arc().outerRadius(y);p&&T.innerRadius(g/2);var N=d3.layout.pie().sort(null).value(function(e){return e.disabled?0:o(e)}),C=w.select(".nv-pie").selectAll(".nv-slice").data(N);C.exit().remove();var k=C.enter().append("g").attr("class","nv-slice").on("mouseover",function(e,t){d3.select(this).classed("hover",!0),v.elementMouseover({label:s(e.data),value:o(e.data),point:e.data,pointIndex:t,pos:[d3.event.pageX,d3.event.pageY],id:u})}).on("mouseout",function(e,t){d3.select(this).classed("hover",!1),v.elementMouseout({label:s(e.data),value:o(e.data),point:e.data,index:t,id:u})}).on("click",function(e,t){v.elementClick({label:s(e.data),value:o(e.data),point:e.data,index:t,pos:d3.event,id:u}),d3.event.stopPropagation()}).on("dblclick",function(e,t){v.elementDblClick({label:s(e.data),value:o(e.data),point:e.data,index:t,pos:d3.event,id:u}),d3.event.stopPropagation()});C.attr("fill",function(e,t){return a(e,t)}).attr("stroke",function(e,t){return a(e,t)});var L=k.append("path").each(function(e){this._current=e});d3.transition(C.select("path")).attr("d",T).attrTween("d",M);if(l){var A=T;c&&(A=d3.svg.arc().outerRadius(T.outerRadius())),k.append("g").classed("nv-label",!0).each(function(e,t){var n=d3.select(this);n.attr("transform",function(e){if(d){e.outerRadius=y+10,e.innerRadius=y+15;var t=(e.startAngle+e.endAngle)/2*(180/Math.PI);return(e.startAngle+e.endAngle)/2<Math.PI?t-=90:t+=90,"translate("+A.centroid(e)+") rotate("+t+")"}return e.outerRadius=g+10,e.innerRadius=g+15,"translate("+A.centroid(e)+")"}),n.append("rect").style("stroke","#fff").style("fill","#fff").attr("rx",3).attr("ry",3),n.append("text").style("text-anchor",d?(e.startAngle+e.endAngle)/2<Math.PI?"start":"end":"middle").style("fill","#000")}),C.select(".nv-label").transition().attr("transform",function(e){if(d){e.outerRadius=y+10,e.innerRadius=y+15;var t=(e.startAngle+e.endAngle)/2*(180/Math.PI);return(e.startAngle+e.endAngle)/2<Math.PI?t-=90:t+=90,"translate("+A.centroid(e)+") rotate("+t+")"}return e.outerRadius=g+10,e.innerRadius=g+15,"translate("+A.centroid(e)+")"}),C.each(function(e,t){var n=d3.select(this);n.select(".nv-label text").style("text-anchor",d?(e.startAngle+e.endAngle)/2<Math.PI?"start":"end":"middle").text(function(e,t){var n=(e.endAngle-e.startALine truncated
|
||||
);var C={},k,L,A=function(i,s){var o=i.pos[0]+(s.offsetLeft||0),u=i.pos[1]+(s.offsetTop||0),f=i.pos[0]+(s.offsetLeft||0),l=p.range()[0]+a.top+(s.offsetTop||0),c=h.range()[0]+a.left+(s.offsetLeft||0),d=i.pos[1]+(s.offsetTop||0),v=n.tickFormat()(t.x()(i.point,i.pointIndex)),m=r.tickFormat()(t.y()(i.point,i.pointIndex));E!=null&&e.tooltip.show([f,l],E(i.series.key,v,m,i,M),"n",1,s,"x-nvtooltip"),S!=null&&e.tooltip.show([c,d],S(i.series.key,v,m,i,M),"e",1,s,"y-nvtooltip"),x!=null&&e.tooltip.show([o,u],x(i.series.key,v,m,i.point.tooltip,i,M),i.value<0?"n":"s",null,s)},O=[{key:"Magnify",disabled:!0}];return t.dispatch.on("elementMouseout.tooltip",function(e){T.tooltipHide(e),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-distx-"+e.pointIndex).attr("y1",0),d3.select(".nv-chart-"+t.id()+" .nv-series-"+e.seriesIndex+" .nv-disty-"+e.pointIndex).attr("x2",u.size())}),T.on("tooltipHide",function(){w&&e.tooltip.cleanup()}),M.dispatch=T,M.scatter=t,M.legend=i,M.controls=s,M.xAxis=n,M.yAxis=r,M.distX=o,M.distY=u,d3.rebind(M,t,"id","interactive","pointActive","x","y","shape","size","xScale","yScale","zScale","xDomain","yDomain","sizeDomain","sizeRange","forceX","forceY","forceSize","clipVoronoi","clipRadius","useVoronoi"),M.margin=function(e){return arguments.length?(a.top=typeof e.top!="undefined"?e.top:a.top,a.right=typeof e.right!="undefined"?e.right:a.right,a.bottom=typeof e.bottom!="undefined"?e.bottom:a.bottom,a.left=typeof e.left!="undefined"?e.left:a.left,M):a},M.width=function(e){return arguments.length?(f=e,M):f},M.height=function(e){return arguments.length?(l=e,M):l},M.color=function(t){return arguments.length?(c=e.utils.getColor(t),i.color(c),o.color(c),u.color(c),M):c},M.showDistX=function(e){return arguments.length?(d=e,M):d},M.showDistY=function(e){return arguments.length?(v=e,M):v},M.showControls=function(e){return arguments.length?(g=e,M):g},M.showLegend=function(e){return arguments.length?(m=e,M):m},M.fisheye=function(e){return arguments.length?(y=e,M):y},M.tooltips=function(e){return arguments.length?(w=e,M):w},M.tooltipContent=function(e){return arguments.length?(x=e,M):x},M.tooltipXContent=function(e){return arguments.length?(E=e,M):E},M.tooltipYContent=function(e){return arguments.length?(S=e,M):S},M.state=function(e){return arguments.length?(C=e,M):C},M.noData=function(e){return arguments.length?(N=e,M):N},M},e.models.sparkline=function(){function h(e){return e.each(function(e){var i=n-t.left-t.right,h=r-t.top-t.bottom,p=d3.select(this);s.domain(l||d3.extent(e,u)).range([0,i]),o.domain(c||d3.extent(e,a)).range([h,0]);var d=p.selectAll("g.nv-wrap.nv-sparkline").data([e]),v=d.enter().append("g").attr("class","nvd3 nv-wrap nv-sparkline"),m=v.append("g"),g=d.select("g");d.attr("transform","translate("+t.left+","+t.top+")");var b=d.selectAll("path").data(function(e){return[e]});b.enter().append("path"),b.exit().remove(),b.style("stroke",function(e,t){return e.color||f(e,t)}).attr("d",d3.svg.line().x(function(e,t){return s(u(e,t))}).y(function(e,t){return o(a(e,t))}));var w=d.selectAll("circle.nv-point").data(function(e){function n(t){if(t!=-1){var n=e[t];return n.pointIndex=t,n}return null}var t=e.map(function(e,t){return a(e,t)}),r=n(t.lastIndexOf(o.domain()[1])),i=n(t.indexOf(o.domain()[0])),s=n(t.length-1);return[i,r,s].filter(function(e){return e!=null})});w.enter().append("circle"),w.exit().remove(),w.attr("cx",function(e,t){return s(u(e,e.pointIndex))}).attr("cy",function(e,t){return o(a(e,e.pointIndex))}).attr("r",2).attr("class",function(e,t){return u(e,e.pointIndex)==s.domain()[1]?"nv-point nv-currentValue":a(e,e.pointIndex)==o.domain()[0]?"nv-point nv-minValue":"nv-point nv-maxValue"})}),h}var t={top:2,right:0,bottom:2,left:0},n=400,r=32,i=!0,s=d3.scale.linear(),o=d3.scale.linear(),u=function(e){return e.x},a=function(e){return e.y},f=e.utils.getColor(["#000"]),l,c;return h.margin=function(e){return arguments.length?(t.top=typeof e.top!="undefined"?e.top:t.top,t.right=typeof e.right!="undefined"?e.right:t.right,t.bottom=typeof e.bottom!="undefined"?e.bottom:t.bottom,t.left=typeof e.left!="undefined"?e.left:t.left,h):t},h.width=function(e){return arguments.length?(n=e,h):n},h.height=function(e){return arguments.length?(r=e,h):r},h.x=function(e){return arguments.length?(u=d3.functor(e),h):u},h.y=function(e){return arguments.length?(a=d3.functor(e),h):a},h.xScale=function(e){return arguments.length?(s=e,h):s},h.yScale=function(e){return arguments.length?(o=e,h):o},h.xDomain=function(e){return arguments.length?(l=e,h):l},h.yDomain=function(e){return arguments.length?(c=e,h):c},h.animate=function(e){return arguments.length?(i=e,h):i},h.color=function(t){return arguments.length?(f=e.utils.getColor(t),h):f},h},e.models.sparklinePlus=function(){function v(e){return e.each(function(c){function O(){if(a)return;var e=C.selectAll(".nv-hoverValue").data(u),r=e.enter().append("g").attr("class","nv-hoverValue").style("stroke-opacity",0).style("fill-opacity",0);e.exit().transition().duration(Line truncated
|
||||
@@ -16,25 +16,22 @@
|
||||
#}
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<div ng-controller="EntryController">
|
||||
<!-- Chart row -->
|
||||
<div class="row-fluid">
|
||||
<div class="row">
|
||||
<!-- Sold evolution chart placeholder -->
|
||||
<div class="span7">
|
||||
<div id="entries-chart-placeholder">
|
||||
<svg style='height:300px'/>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<svg id="entries-chart-placeholder" style="stroke-width: 1px"/>
|
||||
</div>
|
||||
|
||||
<!-- Expense category piechart -->
|
||||
<div class="span3">
|
||||
<div id="expense-categories-chart-placeholder">
|
||||
<svg style='height:300px'/>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<svg id="expense-categories-chart-placeholder" style='height:300px'/>
|
||||
</div>
|
||||
|
||||
<!-- Balance -->
|
||||
<div class="span2" ng-controller="EntryController">
|
||||
<div class="row-fluid">
|
||||
<div class="col-md-2">
|
||||
<div class="row">
|
||||
<table class="table">
|
||||
<tr><td>Dépenses :</td><td>[[accountStatus.expenses]]</td></tr>
|
||||
<tr><td>Recettes :</td><td>[[accountStatus.revenues]]</td></tr>
|
||||
@@ -45,8 +42,8 @@
|
||||
</div>
|
||||
|
||||
<!-- Row with entry table -->
|
||||
<div class="row-fluid">
|
||||
<table class="table table-striped table-condensed table-hover" ng-controller="EntryController">
|
||||
<div class="row">
|
||||
<table class="table table-condensed table-hover">
|
||||
<!-- Head of the table containing column headers and size -->
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -55,7 +52,7 @@
|
||||
<th style="width: 50px">Montant</th>
|
||||
<th style="width: 50px">Solde</th>
|
||||
<th style="width: 100px">Catégorie</th>
|
||||
<th style="width: 60px">Actions</th>
|
||||
<th style="width: 80px">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -64,67 +61,102 @@
|
||||
<tr id="entry_[[entry.id]]" class="form-inline" ng-class="entryRowClass(entry)" ng-repeat="entry in entries">
|
||||
<td>
|
||||
<small>
|
||||
<input ng-show="isEditing(entry)" type="text" class="input-small" ng-model="entry.operation_date" data-date-format="yyyy-mm-dd" bs-datepicker/>
|
||||
<input ng-show="isEditing(entry)" type="text" class="form-control input-sm" ng-model="entry.operation_date" data-date-format="yyyy-mm-dd" bs-datepicker/>
|
||||
<span ng-show="isDisplaying(entry)">[[entry.operation_date]]</span>
|
||||
</small>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<small>
|
||||
<input ng-show="isEditing(entry)" type="text" class="input-xxlarge" ng-model="entry.label"/>
|
||||
<input ng-show="isEditing(entry)" type="text" class="form-control input-sm" ng-model="entry.label"/>
|
||||
<span ng-show="isDisplaying(entry)">[[entry.label]]</span>
|
||||
</small>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<small>
|
||||
<input ng-show="isEditing(entry)" type="text" class="input-mini" ng-model="entry.value"/>
|
||||
<input ng-show="isEditing(entry)" type="text" class="form-control input-sm" ng-model="entry.value"/>
|
||||
<span ng-show="isDisplaying(entry)">[[entry.value]]</span>
|
||||
</small>
|
||||
</td>
|
||||
|
||||
<td ng-class="entryValueClass(entry.sold)">
|
||||
<small>
|
||||
[[entry.sold]]
|
||||
</small>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<small>
|
||||
<input ng-show="isEditing(entry)" type="text" class="input-small" ng-model="entry.category" bs-typeahead="categories"/>
|
||||
<!--<input ng-show="isEditing(entry)" type="text" class="form-control input-sm" ng-model="entry.category" bs-typeahead="categories"/>-->
|
||||
<input ng-show="isEditing(entry)" type="text" class="form-control input-sm" ng-model="entry.category"/>
|
||||
<span ng-show="isDisplaying(entry)">[[entry.category]]</span>
|
||||
</small>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="btn-group" ng-show="isEditing(entry)">
|
||||
<a class="btn btn-mini btn-success" ng-click="saveEntry(entry)" href="#" title="Save"><i ng-class="iconSaveClass(entry)"><span style="display: none">Save</span></i></a>
|
||||
<a class="btn btn-mini" ng-click="cancelEditEntry(entry)" href="#" title="Cancel"><i ng-class="iconCancelClass(entry)"><span style="display: none">Cancel</span></i></a>
|
||||
<a class="btn btn-mini" ng-click="pointEntry(entry)" ng-class="pointedEntryClass(entry)" href="#" title="point"><i class="icon-pencil"><span style="display: none">Point</span></i></a>
|
||||
<button type="button" class="btn btn-xs btn-success" ng-click="saveEntry(entry)" title="Save">
|
||||
<span ng-class="iconSaveClass(entry)"></span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-xs btn-default" ng-click="cancelEditEntry(entry)" title="Cancel">
|
||||
<span ng-class="iconCancelClass(entry)"></span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="btn btn-xs btn-default" ng-click="pointEntry(entry)" ng-class="pointedEntryClass(entry)" title="point">
|
||||
<span class="fa fa-check"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" ng-show="isDisplaying(entry) && isSaved(entry)">
|
||||
<a class="btn btn-mini" ng-click="editEntry(entry)" href="#" title="edit"><i class="icon-edit"><span style="display: none">Edit</span></i></a>
|
||||
<a class="btn btn-mini" bs-modal="'{{ url_for('frontend.static', filename='templates/entry_remove.html') }}'" href="#" title="remove"><i class="icon-trash"><span style="display: none">Remove</span></i></a>
|
||||
<a class="btn btn-mini" ng-click="pointEntry(entry)" ng-class="pointedEntryClass(entry)" href="#" title="point"><i class="icon-pencil"><span style="display: none">Point</span></i></a>
|
||||
<button class="btn btn-xs btn-default" ng-click="editEntry(entry)" title="edit">
|
||||
<span class="fa fa-pencil-square-o"></span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-xs btn-default" data-toggle="modal" data-target="#remove_entry" title="remove">
|
||||
<span class="fa fa-trash-o"></span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-xs btn-default" ng-click="pointEntry(entry)" ng-class="pointedEntryClass(entry)" title="point">
|
||||
<span class="fa fa-check"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" ng-show="isDisplaying(entry) && !isSaved(entry)">
|
||||
<a class="btn btn-mini btn-success" ng-click="saveEntry(entry)" href="#" title="Save"><i ng-class="iconSaveClass(entry)"><span style="display: none">Save</span></i></a>
|
||||
<a class="btn btn-mini" ng-click="editEntry(entry)" href="#" title="edit"><i class="icon-edit"><span style="display: none">Edit</span></i></a>
|
||||
<a class="btn btn-mini" ng-click="pointEntry(entry)" ng-class="pointedEntryClass(entry)" href="#" title="point"><i class="icon-pencil"><span style="display: none">Point</span></i></a>
|
||||
<button class="btn btn-xs btn-success" ng-click="saveEntry(entry)" title="Save">
|
||||
<span ng-class="iconSaveClass(entry)"></span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-xs btn-default" ng-click="editEntry(entry)" title="edit">
|
||||
<span class="fa fa-pencil-square-o"></span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-xs btn-default" ng-click="pointEntry(entry)" ng-class="pointedEntryClass(entry)" title="point">
|
||||
<span class="fa fa-check"></span>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% include "remove_entry.html" %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
<!-- Navbar with the months of the selected account -->
|
||||
<div class="navbar navbar-fixed-bottom">
|
||||
<div class="navbar-inner" ng-controller="MonthController">
|
||||
<ul class="nav">
|
||||
<li ng-repeat="month in months" ng-class="monthClass(month)"><a href="#" ng-click="selectMonth(month)">[[month.year]]-[[month.month]]</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="navbar navbar-default navbar-fixed-bottom" role="navigation" ng-controller="MonthController">
|
||||
<ul class="nav navbar-nav">
|
||||
<li ng-repeat="month in months" ng-class="monthClass(month)"><a href="#" ng-click="selectMonth(month)">[[month.year]]-[[month.month]]</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
<!-- Custom Javascript library for entries -->
|
||||
{% block js %}
|
||||
<script type="text/javascript" src="{{ url_for('frontend.static', filename='js/months.js') }}"></script>
|
||||
|
||||
@@ -20,14 +20,18 @@
|
||||
<!-- Title -->
|
||||
<title>Entries</title>
|
||||
|
||||
<!-- Awesome fonts -->
|
||||
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
|
||||
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Bootstrap datepicker plugin CSS -->
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.1.3/css/bootstrap-datepicker.min.css" rel="stylesheet">
|
||||
|
||||
<!-- NVD3 CSS -->
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.0.0-beta/nv.d3.css" rel="stylesheet">
|
||||
<link href="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.13-beta/nv.d3.css" rel="stylesheet">
|
||||
|
||||
<!-- Pines Notify JQuery plugin -->
|
||||
<link href="{{ url_for('frontend.static', filename='third-party/pines-notify/jquery.pnotify.default.css') }}" rel="stylesheet">
|
||||
@@ -36,13 +40,14 @@
|
||||
<link href="{{ url_for('frontend.static', filename='css/main.css') }}" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body style="padding-bottom:21px; padding-top: 40px">
|
||||
<div class="navbar navbar-fixed-top navbar-inverse">
|
||||
<div class="navbar-inner" ng-controller="AccountController">
|
||||
<a class="brand" href="/"> Accountant</a>
|
||||
<body style="padding-bottom: 50px; padding-top: 70px">
|
||||
<div class="navbar navbar-fixed-top navbar-inverse" role="navigation" ng-controller="AccountController">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="/"> Accountant</a>
|
||||
</div>
|
||||
|
||||
<!-- Navbar with accounts and menu -->
|
||||
<ul class="nav">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="{% if request.path == '/index.html' %}active{% endif %}"><a href="index.html">Opérations</a></li>
|
||||
<li class="{% if request.path == '/scheduler.html' %}active{% endif %}"><a href="scheduler.html">Planification</a></li>
|
||||
|
||||
@@ -71,8 +76,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -82,22 +87,20 @@
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
|
||||
|
||||
<!-- Bootstrap Javascript library -->
|
||||
<script type="text/javascript" src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Bootstrap datepicker module -->
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.0.2/js/bootstrap-datepicker.min.js"></script>
|
||||
|
||||
<!-- Angular Javascript library -->
|
||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
|
||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.3/angular.min.js"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/angular-strap/0.7.4/angular-strap.js"></script>
|
||||
|
||||
<!-- D3 Plotting framework -->
|
||||
<!--script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/3.2.2/d3.v3.js"></script-->
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/d3/2.10.0/d3.v2.js"></script>
|
||||
<script type="text/javascript" src="//d3js.org/d3.v3.min.js"></script>
|
||||
|
||||
<!-- NVD3 framework -->
|
||||
<!--script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.0.0-beta/nv.d3.js"></script-->
|
||||
<script type="text/javascript" src="{{ url_for('frontend.static', filename='third-party/nv.d3/nv.d3.js') }}"></script>
|
||||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.13-beta/nv.d3.js"></script>
|
||||
|
||||
<!-- Pines Notify JQuery plugin -->
|
||||
<script type="text/javascript" src="{{ url_for('frontend.static', filename='third-party/pines-notify/jquery.pnotify.min.js') }}"></script>
|
||||
@@ -112,10 +115,16 @@ angular.module('$strap').config(function($interpolateProvider, $httpProvider) {
|
||||
|
||||
$httpProvider.responseInterceptors.push(['$rootScope', '$q', function(scope, $q) {
|
||||
function success(response) {
|
||||
console.debug(response)
|
||||
if(response.data.ok == false) {
|
||||
return $q.reject(response)
|
||||
}
|
||||
// TODO Intercept validation error.
|
||||
return response;
|
||||
}
|
||||
|
||||
function error(response) {
|
||||
// TODO Intercept Authentication Required error
|
||||
$.pnotify({
|
||||
type: "error",
|
||||
title: response.data.title,
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<!--
|
||||
This file is part of Accountant.
|
||||
|
||||
Accountant is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Foobar is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<div class="modal fade" id="remove_entry" role="dialog" aria-labeled-by="remove_entry_header" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<!-- Dialog header with title -->
|
||||
<div class="modal-header">
|
||||
<button class="close" ng-click="dismiss()" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title" id="remove_entry_header">Supprimer l'entrée [[entry.label]]</h4>
|
||||
</div>
|
||||
|
||||
<!-- Dialog body -->
|
||||
<div class="modal-body">
|
||||
<p>Confirmez-vous la suppression de cette entrée ?</p>
|
||||
</div>
|
||||
|
||||
<!-- Dialog footer with buttons -->
|
||||
<div class="modal-footer">
|
||||
<button href="#" class="btn btn-primary" ng-click="dismiss()">Non</button>
|
||||
<button href="#" class="btn btn-default" ng-click="removeEntry(entry, this)">Oui</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -17,15 +17,15 @@
|
||||
{% extends "layout.html" %}
|
||||
{% block body %}
|
||||
<!-- Row with entry table -->
|
||||
<div class="row-fluid" ng-controller="SchedulerController">
|
||||
<div class="row" ng-controller="SchedulerController">
|
||||
<table class="table table-striped table-condensed table-hover">
|
||||
<!-- Head of the table containing column headers and size -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 100px">Date de début</th>
|
||||
<th style="width: 100px">Date de fin</th>
|
||||
<th style="width: 50px">Jour</th>
|
||||
<th style="width: 50px">Fréq.</th>
|
||||
<th style="width: 120px">Date de début</th>
|
||||
<th style="width: 120px">Date de fin</th>
|
||||
<th style="width: 20px">Jour</th>
|
||||
<th style="width: 20px">Fréq.</th>
|
||||
<th>Libellé de l'opération</th>
|
||||
<th style="width: 50px">Montant</th>
|
||||
<th style="width: 100px">Catégorie</th>
|
||||
@@ -37,41 +37,59 @@
|
||||
<tbody>
|
||||
<tr id="operation_[[operation.id]]" class="form-inline" ng-class="operationRowClass(operation.sold)" ng-repeat="operation in operations">
|
||||
<td>
|
||||
<input ng-show="isEditing(operation)" type="text" class="input-small" ng-model="operation.start_date" data-date-format="yyyy-mm-dd" bs-datepicker/>
|
||||
<input ng-show="isEditing(operation)" type="text" class="form-control input-sm" ng-model="operation.start_date" data-date-format="yyyy-mm-dd" bs-datepicker/>
|
||||
<span ng-show="isDisplaying(operation)">[[operation.start_date]]</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input ng-show="isEditing(operation)" type="text" class="input-small" ng-model="operation.stop_date" data-date-format="yyyy-mm-dd" bs-datepicker/>
|
||||
<input ng-show="isEditing(operation)" type="text" class="form-control input-sm" ng-model="operation.stop_date" data-date-format="yyyy-mm-dd" bs-datepicker/>
|
||||
<span ng-show="isDisplaying(operation)">[[operation.stop_date]]</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input ng-show="isEditing(operation)" type="text" class="input-mini" ng-model="operation.day"/>
|
||||
<input ng-show="isEditing(operation)" type="text" class="form-control input-sm" ng-model="operation.day"/>
|
||||
<span ng-show="isDisplaying(operation)">[[operation.day]]</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input ng-show="isEditing(operation)" type="text" class="input-mini" ng-model="operation.frequency"/>
|
||||
<input ng-show="isEditing(operation)" type="text" class="form-control input-sm" ng-model="operation.frequency"/>
|
||||
<span ng-show="isDisplaying(operation)">[[operation.frequency]]</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input ng-show="isEditing(operation)" type="text" class="input-xxlarge" ng-model="operation.label"/>
|
||||
<input ng-show="isEditing(operation)" type="text" class="form-control input-sm" ng-model="operation.label"/>
|
||||
<span ng-show="isDisplaying(operation)">[[operation.label]]</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input ng-show="isEditing(operation)" type="text" class="input-mini" ng-model="operation.value"/>
|
||||
<input ng-show="isEditing(operation)" type="text" class="form-control input-sm" ng-model="operation.value"/>
|
||||
<span ng-show="isDisplaying(operation)">[[operation.value]]</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input ng-show="isEditing(operation)" type="text" class="input-small" ng-model="operation.category" bs-typeahead="categories"/>
|
||||
<input ng-show="isEditing(operation)" type="text" class="form-control input-sm" ng-model="operation.category" bs-typeahead="categories"/>
|
||||
<span ng-show="isDisplaying(operation)">[[operation.category]]</span>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="btn-group" ng-show="isEditing(operation)">
|
||||
<a class="btn btn-mini btn-success" ng-click="saveOperation(operation)" href="#operation_[[operation.id]]" title="Save"><i ng-class="iconSaveClass(operation)"><span style="display: none">Save</span></i></a>
|
||||
<a class="btn btn-mini" ng-click="cancelEditOperation(operation)" href="#operation_[[operation.id]]" title="Cancel"><i ng-class="iconCancelClass(operation)"><span style="display: none">Cancel</span></i></a>
|
||||
<button class="btn btn-xs btn-success" ng-click="saveOperation(operation)" title="Save">
|
||||
<span ng-class="iconSaveClass(operation)"></span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-xs btn-default" ng-click="cancelEditOperation(operation)" title="Cancel">
|
||||
<span ng-class="iconCancelClass(operation)"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" ng-show="isDisplaying(operation)">
|
||||
<a class="btn btn-mini" ng-click="editOperation(operation)" href="#operation_[[operation.id]]" title="edit"><i class="icon-edit"><span style="display: none">Edit</span></i></a>
|
||||
<a class="btn btn-mini" bs-modal="'{{ url_for('frontend.static', filename='templates/operation_remove.html') }}'" href="#operation_[[operation.id]]" title="remove"><i class="icon-trash"><span style="display: none">Remove</span></i></a>
|
||||
<button class="btn btn-xs btn-default" ng-click="editOperation(operation)" title="edit">
|
||||
<span class="fa fa-pencil-square-o"></span>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-xs btn-default" bs-modal="'{{ url_for('frontend.static', filename='templates/operation_remove.html') }}'" title="remove">
|
||||
<span class="fa fa-trash-o"></span>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in new issue
Block a user