summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-21 19:07:09 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-08-21 19:07:09 +0200
commit8e7b31d2ac9e17d988eaa0733bc1a01bacdaa17e (patch)
tree830452b7b659fb595a25c0ab07cc82543ad5e957
parent5a1f5af005507f6f7883ddc079b52086ef9baff5 (diff)
downloadIshtar-8e7b31d2ac9e17d988eaa0733bc1a01bacdaa17e.tar.bz2
Ishtar-8e7b31d2ac9e17d988eaa0733bc1a01bacdaa17e.zip
Closing operation or archaelogical file: today by default (refs #2212)
-rw-r--r--archaeological_files/templates/ishtar/sheet_file.html4
-rw-r--r--ishtar_common/forms.py3
-rw-r--r--ishtar_common/widgets.py2
3 files changed, 6 insertions, 3 deletions
diff --git a/archaeological_files/templates/ishtar/sheet_file.html b/archaeological_files/templates/ishtar/sheet_file.html
index 7a6120e42..a5879b3ec 100644
--- a/archaeological_files/templates/ishtar/sheet_file.html
+++ b/archaeological_files/templates/ishtar/sheet_file.html
@@ -37,8 +37,8 @@
<p><label>{%trans "Edition date:"%}</label> <span class='value'>{% if item.history_date %}{{ item.history_date }}{% else %}{{ item.history.all.0.history_date }}{% endif %}</span></p> <!-- date = now -->
-{% field "Reception date" item.reception_date %}
-{% field "Creation date" item.creation_date %}
+{% field "Reception date" item.reception_date|date:"DATE_FORMAT" %}
+{% field "Creation date" item.creation_date|date:"DATE_FORMAT" %}
{% field "Created by" item.history_creator.ishtaruser.full_label %}
{% comment %}
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py
index 2e170fd1e..bf19dbc49 100644
--- a/ishtar_common/forms.py
+++ b/ishtar_common/forms.py
@@ -122,7 +122,8 @@ def get_now():
class ClosingDateFormSelection(forms.Form):
form_label = _("Closing date")
end_date = forms.DateField(label=_(u"Closing date"),
- widget=widgets.JQueryDate)
+ widget=widgets.JQueryDate,
+ initial=datetime.date.today)
def get_form_selection(
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py
index 83fb23caf..89eead988 100644
--- a/ishtar_common/widgets.py
+++ b/ishtar_common/widgets.py
@@ -144,6 +144,8 @@ class JQueryDate(forms.TextInput):
self.attrs['class'] = 'date-pickup'
def render(self, name, value=None, attrs=None):
+ if value:
+ value = unicode(value)
# very specific...
if settings.COUNTRY == 'fr' and value and '/' in value:
values = value.split('/')