aboutsummaryrefslogtreecommitdiff
path: root/budget/templates
diff options
context:
space:
mode:
Diffstat (limited to 'budget/templates')
-rw-r--r--budget/templates/forms.html8
-rw-r--r--budget/templates/layout.html3
-rw-r--r--budget/templates/list_bills.html9
3 files changed, 15 insertions, 5 deletions
diff --git a/budget/templates/forms.html b/budget/templates/forms.html
index 3a3d5ba..8c0cda3 100644
--- a/budget/templates/forms.html
+++ b/budget/templates/forms.html
@@ -1,4 +1,4 @@
-{% macro input(field, multiple=False) -%}
+{% macro input(field, multiple=False, class=None) -%}
<div class="clearfix">
{% if field.type != "SubmitField" %}
@@ -6,9 +6,9 @@
{% endif %}
<div class="input">
{% if multiple == True %}
- {{ field(multiple=True) }}
+ {{ field(multiple=True, class=class) }}
{% else %}
- {{ field }}
+ {{ field(class=class) | safe }}
{% endif %}
{% if field.description %}
<span class="help-inline">{{ field.description }}</span>
@@ -75,7 +75,7 @@
<legend>{% if edit %}{{ _("Edit this bill") }} {% else %}{{ _("Add a bill") }} {% endif %}</legend>
{% include "display_errors.html" %}
{{ form.hidden_tag() }}
- {{ input(form.date) }}
+ {{ input(form.date, class="datepicker") }}
{{ input(form.what) }}
{{ input(form.payer) }}
{{ input(form.amount) }}
diff --git a/budget/templates/layout.html b/budget/templates/layout.html
index 72b6ee8..e6614d8 100644
--- a/budget/templates/layout.html
+++ b/budget/templates/layout.html
@@ -5,7 +5,8 @@
<title>{{ _("Account manager") }}{% block title %}{% endblock %}</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel=stylesheet type=text/css href="{{ url_for("static", filename='main.css') }}">
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
+ <script src="{{ url_for("static", filename="jquery/js/jquery-1.6.2.min.js") }}"></script>
+ {% block head %}{% endblock %}
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
setTimeout(function(){
diff --git a/budget/templates/list_bills.html b/budget/templates/list_bills.html
index 895bb37..a6ab5fc 100644
--- a/budget/templates/list_bills.html
+++ b/budget/templates/list_bills.html
@@ -1,6 +1,12 @@
{% extends "layout.html" %}
{% block title %}- {{ g.project.name }}{% endblock %}
+{% block head %}
+ <script src="{{ url_for("static", filename="jquery/js/jquery-ui.js") }}"></script>
+ {% if g.lang != "en" %}
+ <script src="{{ url_for("static", filename="jquery/i18n/jquery.ui.datepicker-%s.js" % g.lang ) }}"></script>
+ {% endif %}
+{% endblock %}
{% block js %}
// display the form when clicking on the "add bill" button
var show_form = function(){
@@ -40,6 +46,9 @@
}, function(){
$(this).find('.remove').hide();
});
+
+ $.datepicker.setDefaults({'dateFormat': 'yy-mm-dd'});
+ $(".datepicker").datepicker($.datepicker.regional['{{ g.lang }}']);
{% endblock %}
{% block sidebar %}