diff --git a/amadeus/static/css/base/amadeus.css b/amadeus/static/css/base/amadeus.css index c4313ce..929a1bb 100755 --- a/amadeus/static/css/base/amadeus.css +++ b/amadeus/static/css/base/amadeus.css @@ -1227,6 +1227,22 @@ div.dataTables_wrapper div.dataTables_paginate { display: inline; margin-right: 30px; } + +.delete-row{ + float: right; + background-color: gray; + color: white; + padding: 5px 20px; + font-size: 12px; + text-decoration: none; + border: none; + border-radius: 2px; + position: relative; + margin: 10px 20px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 0; +} /* End Reports */ /* Chat */ diff --git a/reports/forms.py b/reports/forms.py index 38de186..d243b70 100644 --- a/reports/forms.py +++ b/reports/forms.py @@ -6,7 +6,7 @@ from django.forms.formsets import BaseFormSet class ResourceAndTagForm(forms.Form): - resource = forms.ChoiceField(label=_("Resources"), required=True) + resource = forms.ChoiceField(label=_("Kind Of Resource"), required=True) tag = forms.ChoiceField(label=_('Tag'), required=True) def __init__(self, *args, **kwargs): @@ -37,15 +37,22 @@ class CreateInteractionReportForm(forms.Form): self.fields['topic'].choices.append((_("All"), _("All"))) + def clean(self): + cleaned_data = super(CreateInteractionReportForm, self).clean() + init_date = cleaned_data.get("init_date") + end_date = cleaned_data.get("end_date") + if init_date and end_date: + if init_date > end_date: + raise forms.ValidationError(_("The initial date can't be after the end one.")) def clean_init_date(self): - init_date = self.cleaned_data.get('init_date') + init_date = self.cleaned_data['init_date'] if init_date < self.subject.init_date: self._errors['init_date'] = [_('This date should be right or after ' + str(self.subject.init_date) + ', which is when the subject started. ')] return init_date def clean_end_date(self): - end_date = self.cleaned_data.get('init_date') + end_date = self.cleaned_data['end_date'] if end_date > self.subject.end_date: self._errors['end_date'] = [_('This date should be right or before ' + str(self.subject.end_date) + ', which is when the subject finishes. ')] return end_date \ No newline at end of file diff --git a/reports/templates/reports/_form.html b/reports/templates/reports/_form.html index 0f8b060..8dbb330 100644 --- a/reports/templates/reports/_form.html +++ b/reports/templates/reports/_form.html @@ -2,7 +2,21 @@
{% csrf_token %}

{% trans "General Parameters" %}


+ {% if form.errors %} + + {% endif %} {% for field in form %} + + {% if field.auto_id == 'id_init_date' or field.auto_id == 'id_end_date' %} {% render_field field class='form-control date-picker' %} -- libgit2 0.21.2