Commit 58840b40 authored by Michal Čihař's avatar Michal Čihař

Fix rendering of letter form for dicitonary

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 0e0d282c
{% load crispy_forms_field %}
{% if field.is_hidden %}
{{ field }}
{% else %}
{% if field|is_checkbox %}
<div id="div_{{ field.auto_id }}" class="checkbox">
<label for="{{ field.id_for_label }}" class="{% if field.field.required %} requiredField{% endif %}">
{% crispy_field field 'class' 'checkbox' %}
{{ field.label|safe }}
</label>
</div>
{% else %}
<div id="div_{{ field.auto_id }}" class="form-group">
<label for="{{ field.id_for_label }}" class="{% if field.field.required %} requiredField{% endif %}">
{{ field.label|safe }}
</label>
{% crispy_field field 'placeholder' field.label %}
</div>
{% endif %}
{% endif %}
......@@ -29,7 +29,7 @@
{% include "paginator.html" %}
<form class="autosubmit paginatoraddon">
{{ letterform|crispy }}
{% crispy letterform %}
</form>
{% if page_obj.object_list %}
......
......@@ -26,6 +26,8 @@ from django.utils.safestring import mark_safe
from django.utils.encoding import smart_unicode
from django.forms import ValidationError
from django.core.urlresolvers import reverse
from crispy_forms.helper import FormHelper
from django.forms import ValidationError
from weblate.lang.models import Language
from weblate.trans.models import Unit
from weblate.trans.models.source import PRIORITY_CHOICES
......@@ -571,6 +573,12 @@ class LetterForm(forms.Form):
required=False
)
def __init__(self, *args, **kwargs):
super(LetterForm, self).__init__(*args, **kwargs)
self.helper = FormHelper(self)
self.helper.form_class = 'form-inline'
self.helper.field_template = 'bootstrap3/layout/inline_field.html'
class CommentForm(forms.Form):
'''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment