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) { $scope.valueClass = function(account, value) {
if(!account) {
return
}
if(value < account.authorized_overdraft) { if(value < account.authorized_overdraft) {
return "text-error"; return "text-error";
} else if(value < 0) { } else if(value < 0) {

View File

@ -33,54 +33,54 @@
<link href="{{ url_for('static', filename='css/main.css') }}" rel="stylesheet"> <link href="{{ url_for('static', filename='css/main.css') }}" rel="stylesheet">
</head> </head>
<body> <body style="padding-bottom:21px; padding-top: 40px">
<!-- Navbar with the months of the selected account --> <div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar navbar-fixed-bottom"> <div class="navbar-inner" ng-controller="AccountController">
<div class="navbar-inner" ng-controller="MonthController"> <a class="brand" href="/">&nbsp;Accountant</a>
<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>
<div class="container-fluid"> <!-- Navbar with accounts and menu -->
<div class="row-fluid"> <ul class="nav">
<div class="span2"> <!-- Account list -->
<div class="well well-small"> <li class="dropdown">
<!-- Navbar with accounts and menu --> <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="nav nav-list" ng-controller="AccountController"> <ul class="dropdown-menu">
<li class="nav-header">Navigation</li> <li class="dropdown-submenu" ng-class="accountClass(account)" ng-repeat="account in accounts">
<li class="{% if request.path == '/index.html' %}active{% endif %}"><a href="index.html">Opérations</li> <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>)
<li class="{% if request.path == '/scheduler.html' %}active{% endif %}"><a href="scheduler.html">Planification</li> <ul class="dropdown-menu">
<li><a href="#" ng-click="editAccount(account)" bs-modal="'{{ url_for('static', filename='templates/account_edit.html') }}'">Modifier</a></li>
<!-- Account list --> <li><a href="#" bs-modal="'{{ url_for('static', filename='templates/account_remove.html') }}'">Supprimer</a></li>
<li class="nav-header">Comptes</li> </ul>
<li ng-class="accountClass(account)" ng-repeat="account in accounts"> </a>
<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>
</a>
</li> </li>
<li class="divider"></li> <li class="divider"></li>
<!-- New account button --> <!-- New account button -->
<li><a bs-modal="'{{ url_for('static', filename='templates/account_new.html') }}'" href="#">Ajouter un compte</a></li> <li><a bs-modal="'{{ url_for('static', filename='templates/account_new.html') }}'" href="#">Ajouter un compte</a></li>
</ul><!-- nav --> </ul>
</div> </li>
</div><!-- span2 -->
<div class="span10"> <li class="divider-vertical"></li>
{% block body %}{% endblock %}
</div> <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>
</div>
<!-- Emtpy row with bottom margin to avoid data under the fixed bottom navbar --> <div class="container-fluid">
<div class="row-fluid" style="margin-bottom: 21px"></div> <div class="row-fluid">
{% block body %}{% endblock %}
</div>
</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> </div>
<!-- JQuery Javascript library --> <!-- JQuery Javascript library -->
@ -88,6 +88,7 @@
<!-- Bootstrap Javascript library --> <!-- 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/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<!-- Bootstrap datepicker module --> <!-- Bootstrap datepicker module -->
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.0.2/js/bootstrap-datepicker.min.js"></script> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.0.2/js/bootstrap-datepicker.min.js"></script>