Reviewed layout.

This commit is contained in:
Alexis Lahouze 2013-07-29 01:01:49 +02:00
parent 25bdf9dbb8
commit 51ee97f020
2 changed files with 46 additions and 41 deletions

View File

@ -41,6 +41,10 @@ var AccountController = function($scope, $http, $rootScope, $window) {
};
$scope.valueClass = function(account, value) {
if(!account) {
return
}
if(value < account.authorized_overdraft) {
return "text-error";
} else if(value < 0) {

View File

@ -33,36 +33,23 @@
<link href="{{ url_for('static', filename='css/main.css') }}" rel="stylesheet">
</head>
<body>
<!-- Navbar with the months of the selected account -->
<div class="navbar navbar-fixed-bottom">
<div class="navbar-inner" ng-controller="MonthController">
<ul ng-repeat="month in months" class="nav">
<li ng-class="monthClass(month)"><a href="#" ng-click="selectMonth(month)">[[month.year]]-[[month.month]]</a></li>
</ul>
</div>
</div>
<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>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well well-small">
<!-- Navbar with accounts and menu -->
<ul class="nav nav-list" ng-controller="AccountController">
<li class="nav-header">Navigation</li>
<li class="{% if request.path == '/index.html' %}active{% endif %}"><a href="index.html">Opérations</li>
<li class="{% if request.path == '/scheduler.html' %}active{% endif %}"><a href="scheduler.html">Planification</li>
<ul class="nav">
<!-- Account list -->
<li class="nav-header">Comptes</li>
<li ng-class="accountClass(account)" ng-repeat="account in accounts">
<a ng-click="selectAccount(account)" href="#">[[account.name]]
<br />
(<span ng-class="valueClass(account, account.current)">[[account.current]]</span>&nbsp;/&nbsp;<span ng-class="valueClass(account, account.pointed)">[[account.pointed]]</span>)
<div class="btn-group">
<button class="btn btn-mini" ng-click="editAccount(account)" bs-modal="'{{ url_for('static', filename='templates/account_edit.html') }}'"><i class="icon-edit"></i></button>
<button class="btn btn-mini" bs-modal="'{{ url_for('static', filename='templates/account_remove.html') }}'"><i class="icon-trash"></i></button>
</div>
<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>
@ -70,17 +57,30 @@
<!-- New account button -->
<li><a bs-modal="'{{ url_for('static', filename='templates/account_new.html') }}'" href="#">Ajouter un compte</a></li>
</ul>
</li>
<li class="divider-vertical"></li>
<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>
</ul><!-- nav -->
</div>
</div><!-- span2 -->
</div>
<div class="span10">
<div class="container-fluid">
<div class="row-fluid">
{% block body %}{% endblock %}
</div>
</div>
<!-- Emtpy row with bottom margin to avoid data under the fixed bottom navbar -->
<div class="row-fluid" style="margin-bottom: 21px"></div>
<!-- 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>
<!-- JQuery Javascript library -->
@ -88,6 +88,7 @@
<!-- 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>