Continued refactoring.

This commit is contained in:
Alexis Lahouze
2013-12-03 20:47:59 +01:00
parent ab4df80963
commit 9b287945b6
27 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,134 @@
{#
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/>.
#}
{% extends "layout.html" %}
{% block body %}
<!-- Chart row -->
<div class="row-fluid">
<!-- Sold evolution chart placeholder -->
<div class="span7">
<div id="entries-chart-placeholder">
<svg style='height:300px'/>
</div>
</div>
<!-- Expense category piechart -->
<div class="span3">
<div id="expense-categories-chart-placeholder">
<svg style='height:300px'/>
</div>
</div>
<!-- Balance -->
<div class="span2" ng-controller="EntryController">
<div class="row-fluid">
<table class="table">
<tr><td>Dépenses&nbsp;:</td><td>[[accountStatus.expenses]]</td></tr>
<tr><td>Recettes&nbsp;:</td><td>[[accountStatus.revenues]]</td></tr>
<tr><td>Balance&nbsp;:</td><td><span ng-class="entryValueClass(accountStatus.balance)">[[accountStatus.balance]]</span></td></tr>
</table>
</div>
</div>
</div>
<!-- Row with entry table -->
<div class="row-fluid">
<table class="table table-striped table-condensed table-hover" ng-controller="EntryController">
<!-- Head of the table containing column headers and size -->
<thead>
<tr>
<th style="width: 100px">Date d'op.</th>
<th>Libell&eacute; de l'op&eacute;ration</th>
<th style="width: 50px">Montant</th>
<th style="width: 50px">Solde</th>
<th style="width: 100px">Cat&eacute;gorie</th>
<th style="width: 60px">Actions</th>
</tr>
</thead>
<!-- Body of the table containing the entries -->
<tbody>
<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/>
<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"/>
<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"/>
<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"/>
<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>
</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('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>
</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>
</div>
</td>
</tr>
</tbody>
</table>
</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>
{% endblock %}
<!-- Custom Javascript library for entries -->
{% block js %}
<script type="text/javascript" src="{{ url_for('static', filename='js/months.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/accounts.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/entries.js') }}"></script>
{% endblock %}

View File

@ -0,0 +1,137 @@
{#
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/>.
#}
<!DOCTYPE html>
<html lang="fr" ng-app="$strap">
<head>
<!-- Title -->
<title>Entries</title>
<!-- Bootstrap CSS -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.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">
<!-- Pines Notify JQuery plugin -->
<link href="{{ url_for('static', filename='third-party/pines-notify/jquery.pnotify.default.css') }}" rel="stylesheet">
<!-- main css -->
<link href="{{ url_for('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="/">&nbsp;Accountant</a>
<!-- Navbar with accounts and menu -->
<ul class="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>
<li class="divider-vertical"></li>
<!-- Account list -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">[[account.name]]&nbsp;(<span ng-class="valueClass(account, account.current)">[[account.current]]</span>&nbsp;/&nbsp;<span ng-class="valueClass(account, account.pointed)">[[account.pointed]]</span>)<b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-submenu" ng-class="accountClass(account)" ng-repeat="account in accounts">
<a ng-click="selectAccount(account)" href="#">[[account.name]](<span ng-class="valueClass(account, account.current)">[[account.current]]</span>&nbsp;/&nbsp;<span ng-class="valueClass(account, account.pointed)">[[account.pointed]]</span>)
<ul class="dropdown-menu">
<li><a href="#" ng-click="editAccount(account)" bs-modal="'{{ url_for('static', filename='templates/account_edit.html') }}'">Modifier</a></li>
<li><a href="#" bs-modal="'{{ url_for('static', filename='templates/account_remove.html') }}'">Supprimer</a></li>
</ul>
</a>
</li>
<li class="divider"></li>
<!-- New account button -->
<li><a bs-modal="'{{ url_for('static', filename='templates/account_new.html') }}'" href="#">Ajouter un compte</a></li>
</ul>
</li>
</ul><!-- nav -->
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
{% block body %}{% endblock %}
</div>
</div>
{% block footer %}{% endblock %}
<!-- JQuery Javascript library -->
<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>
<!-- 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="//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>
<!-- 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('static', filename='third-party/nv.d3/nv.d3.js') }}"></script>
<!-- Pines Notify JQuery plugin -->
<script type="text/javascript" src="{{ url_for('static', filename='third-party/pines-notify/jquery.pnotify.min.js') }}"></script>
<!-- Custom Javascript library for entries -->
{% block js %}{% endblock %}
<script type="text/javascript">
angular.module('$strap').config(function($interpolateProvider, $httpProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
$httpProvider.responseInterceptors.push(['$rootScope', '$q', function(scope, $q) {
function success(response) {
return response;
}
function error(response) {
$.pnotify({
type: "error",
title: response.data.title,
text: response.data.text,
width: 300
})
return $q.reject(response);
}
return function(promise) {
return promise.then(success, error);
}
}]);
});
</script>
</body>
</html>

View File

@ -0,0 +1,88 @@
{#
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/>.
#}
{% extends "layout.html" %}
{% block body %}
<!-- Row with entry table -->
<div class="row-fluid" 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&eacute;but</th>
<th style="width: 100px">Date de fin</th>
<th style="width: 50px">Jour</th>
<th style="width: 50px">Fr&eacute;q.</th>
<th>Libell&eacute; de l'op&eacute;ration</th>
<th style="width: 50px">Montant</th>
<th style="width: 100px">Cat&eacute;gorie</th>
<th style="width: 60px">Actions</th>
</tr>
</thead>
<!-- Body of the table containing the entries -->
<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/>
<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/>
<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"/>
<span ng-show="isDisplaying(operation)">[[operation.day]]</span>
</td>
<td>
<input ng-show="isEditing(operation)" type="text" class="input-mini" 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"/>
<span ng-show="isDisplaying(operation)">[[operation.label]]</span>
</td>
<td>
<input ng-show="isEditing(operation)" type="text" class="input-mini" 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"/>
<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>
</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('static', filename='templates/operation_remove.html') }}'" href="#operation_[[operation.id]]" title="remove"><i class="icon-trash"><span style="display: none">Remove</span></i></a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
{% endblock %}
{% block js %}
<script type="text/javascript" src="{{ url_for('static', filename='js/months.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/accounts.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='js/scheduler.js') }}"></script>
{% endblock %}