summaryrefslogtreecommitdiff
path: root/archaeological_files/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2014-10-20 20:40:42 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2014-10-20 20:40:42 +0200
commitf87fd09770ab0738855a5efbaff905a7c9f346ac (patch)
tree28c99961d82172cefbc1c2972789e7f647d05e63 /archaeological_files/forms.py
parent5a2f2af0d2eada644241c234494b0d20abf13f85 (diff)
downloadIshtar-f87fd09770ab0738855a5efbaff905a7c9f346ac.tar.bz2
Ishtar-f87fd09770ab0738855a5efbaff905a7c9f346ac.zip
Dashboard: many improvments on graph (refs #2075)
* by default graph is set by month * data are reapeated in a table * ability to save the graph in a file * detail by department with a line by department + total * add a legend * ability to zoom on the graph
Diffstat (limited to 'archaeological_files/forms.py')
-rw-r--r--archaeological_files/forms.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py
index dbbbafbd9..68a004e4f 100644
--- a/archaeological_files/forms.py
+++ b/archaeological_files/forms.py
@@ -122,13 +122,15 @@ class FileFormSelection(forms.Form):
raise forms.ValidationError(_(u"You should select a file."))
return cleaned_data
-SLICING = (('year',_(u"years")), ("month",_(u"months")))
+SLICING = (("month",_(u"months")), ('year',_(u"years")),)
DATE_SOURCE = (('creation',_(u"Creation date")),
("reception",_(u"Reception date")))
class DashboardForm(forms.Form):
slicing = forms.ChoiceField(label=_("Slicing"), choices=SLICING,
required=False)
+ department_detail = forms.BooleanField(label=_("Department detail"),
+ required=False)
date_source = forms.ChoiceField(label=_("Date get from"),
choices=DATE_SOURCE, required=False)
file_type = forms.ChoiceField(label=_("File type"), choices=[],
@@ -145,6 +147,10 @@ class DashboardForm(forms.Form):
self.fields['saisine_type'].choices = models.SaisineType.get_types()
self.fields['file_type'].choices = models.FileType.get_types()
+ def get_show_detail(self):
+ return hasattr(self, 'cleaned_data') and \
+ self.cleaned_data.get('department_detail')
+
def get_date_source(self):
date_source = 'creation'
if hasattr(self, 'cleaned_data') and \