Commit 48041b7ce853083e0758cd2a878acb0cb089e95e
1 parent
93b76fff
Exists in
master
and in
3 other branches
Adjusting form style
Showing
2 changed files
with
44 additions
and
23 deletions
Show diff stats
webpage/forms.py
... | ... | @@ -14,6 +14,10 @@ class WebpageForm(forms.ModelForm): |
14 | 14 | class Meta: |
15 | 15 | model = Webpage |
16 | 16 | fields = ['name', 'content', 'brief_description', 'all_students', 'students', 'groups', 'show_window', 'visible'] |
17 | + labels = { | |
18 | + 'name': _('Webpage name'), | |
19 | + 'content': _('Webpage content'), | |
20 | + } | |
17 | 21 | widgets = { |
18 | 22 | 'content': forms.Textarea, |
19 | 23 | 'brief_description': forms.Textarea, | ... | ... |
webpage/templates/webpages/_form.html
... | ... | @@ -45,28 +45,43 @@ |
45 | 45 | |
46 | 46 | {% for notify in pendencies_form %} |
47 | 47 | <div class="notifies"> |
48 | - {% if notify.instance.pk %}{{ notify.DELETE }}{% endif %} | |
49 | - <div class="form-group{% if form.has_error %} has-error {% endif %}"> | |
50 | - <label for="{{ notify.action.auto_id }}"> | |
51 | - {{ notify.action.label }} {% render_field notify.action class='form-control' %} | |
52 | - </label> | |
53 | - </div> | |
54 | - <div class="form-group{% if form.has_error %} has-error {% endif %}"> | |
55 | - <div class=" checkbox"> | |
56 | - <label> | |
57 | - <input type="checkbox" class="begin_date" /> {{ notify.begin_date.label }} | |
58 | - </label> | |
59 | - {% render_field notify.begin_date class='form-control' %} | |
60 | - </div> | |
61 | - </div> | |
62 | - <div class="form-group{% if form.has_error %} has-error {% endif %}"> | |
63 | - <div class=" checkbox"> | |
64 | - <label> | |
65 | - <input type="checkbox" class="end_date" /> {{ notify.end_date.label }} | |
66 | - </label> | |
67 | - {% render_field notify.end_date class='form-control' %} | |
68 | - </div> | |
69 | - </div> | |
48 | + <div style="text-align:left"> | |
49 | + {% if notify.instance.pk %}{{ notify.DELETE }}{% endif %} | |
50 | + <div class="form-group{% if form.has_error %} has-error {% endif %} row"> | |
51 | + <label for="{{ notify.action.auto_id }}" class="pull-left action_label contol-label"> | |
52 | + {% trans 'Action not performed by the user' %}: | |
53 | + </label> | |
54 | + <div class="col-md-3"> | |
55 | + {% render_field notify.action class='form-control' %} | |
56 | + </div> | |
57 | + </div> | |
58 | + <br clear="all" /> | |
59 | + <div class="row"> | |
60 | + <div class="col-md-offset-2"> | |
61 | + <p>{% trans 'Wished period' %}: </p> | |
62 | + </div> | |
63 | + </div> | |
64 | + <div class="form-group{% if form.has_error %} has-error {% endif %} row"> | |
65 | + <div class="col-lg-offset-3 col-md-offset-3 col-sm-offset-3 col-lg-2 col-md-2 col-sm-2 col-xs-3 checkbox"> | |
66 | + <label> | |
67 | + <input type="checkbox" class="begin_date" /> {{ notify.begin_date.label }} | |
68 | + </label> | |
69 | + </div> | |
70 | + <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4"> | |
71 | + {% render_field notify.begin_date class='form-control datetime-picker' %} | |
72 | + </div> | |
73 | + </div> | |
74 | + <div class="form-group{% if form.has_error %} has-error {% endif %} row"> | |
75 | + <div class="col-lg-offset-3 col-md-offset-3 col-sm-offset-3 col-lg-2 col-md-2 col-sm-2 col-xs-3 checkbox"> | |
76 | + <label> | |
77 | + <input type="checkbox" class="end_date" /> {{ notify.end_date.label }} | |
78 | + </label> | |
79 | + </div> | |
80 | + <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4"> | |
81 | + {% render_field notify.end_date class='form-control date-picker' %} | |
82 | + </div> | |
83 | + </div> | |
84 | + </div> | |
70 | 85 | </div> |
71 | 86 | {% endfor %} |
72 | 87 | </div> |
... | ... | @@ -130,8 +145,10 @@ |
130 | 145 | $(function() { |
131 | 146 | $('.notifies').formset({ |
132 | 147 | addText: '{% trans "Add new notification" %}', |
133 | - deleteText: '{% trans "Remove this" %}' | |
148 | + deleteText: '{% trans "Remove this notification" %}' | |
134 | 149 | }); |
150 | + | |
151 | + | |
135 | 152 | }); |
136 | 153 | |
137 | 154 | $('#id_groups').multiSelect({ | ... | ... |