From 48041b7ce853083e0758cd2a878acb0cb089e95e Mon Sep 17 00:00:00 2001 From: Zambom Date: Fri, 20 Jan 2017 17:12:36 -0200 Subject: [PATCH] Adjusting form style --- webpage/forms.py | 4 ++++ webpage/templates/webpages/_form.html | 63 ++++++++++++++++++++++++++++++++++++++++----------------------- 2 files changed, 44 insertions(+), 23 deletions(-) diff --git a/webpage/forms.py b/webpage/forms.py index 8c1d995..26a39e6 100644 --- a/webpage/forms.py +++ b/webpage/forms.py @@ -14,6 +14,10 @@ class WebpageForm(forms.ModelForm): class Meta: model = Webpage fields = ['name', 'content', 'brief_description', 'all_students', 'students', 'groups', 'show_window', 'visible'] + labels = { + 'name': _('Webpage name'), + 'content': _('Webpage content'), + } widgets = { 'content': forms.Textarea, 'brief_description': forms.Textarea, diff --git a/webpage/templates/webpages/_form.html b/webpage/templates/webpages/_form.html index bdf04f7..77253fb 100644 --- a/webpage/templates/webpages/_form.html +++ b/webpage/templates/webpages/_form.html @@ -45,28 +45,43 @@ {% for notify in pendencies_form %}
- {% if notify.instance.pk %}{{ notify.DELETE }}{% endif %} -
- -
-
-
- - {% render_field notify.begin_date class='form-control' %} -
-
-
-
- - {% render_field notify.end_date class='form-control' %} -
-
+
+ {% if notify.instance.pk %}{{ notify.DELETE }}{% endif %} +
+ +
+ {% render_field notify.action class='form-control' %} +
+
+
+
+
+

{% trans 'Wished period' %}:

+
+
+
+
+ +
+
+ {% render_field notify.begin_date class='form-control datetime-picker' %} +
+
+
+
+ +
+
+ {% render_field notify.end_date class='form-control date-picker' %} +
+
+
{% endfor %} @@ -130,8 +145,10 @@ $(function() { $('.notifies').formset({ addText: '{% trans "Add new notification" %}', - deleteText: '{% trans "Remove this" %}' + deleteText: '{% trans "Remove this notification" %}' }); + + }); $('#id_groups').multiSelect({ -- libgit2 0.21.2