From 57cdf8896f854de7ba573cfe8d5040155df1e656 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 20 Oct 2014 20:40:42 +0200 Subject: 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 --- archaeological_files/forms.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'archaeological_files/forms.py') 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 \ -- cgit v1.2.3