Log form enhancements (button layout)

This commit is contained in:
Sebastian Lohff 2017-01-24 12:23:28 +01:00
parent 90bff8cddf
commit e73ad743c5
3 changed files with 11 additions and 4 deletions

View File

@ -48,12 +48,15 @@ class QSOForm(forms.ModelForm):
self.helper = FormHelper()
self.helper.form_id = "qso-log-form"
self.helper.form_class = "form-inline"
#self.helper.form_class = "form-inline "
#self.helper.form_class = "form-horizontal"
self.helper.form_style = 'inline'
self.helper.field_template = "bootstrap3/layout/inline_field.html"
#self.helper.form_style = 'inline'
#self.helper.field_template = "bootstrap3/layout/inline_field.html"
self.helper.action = reverse("contest:log")
self.helper.add_input(Submit('submit', 'Log'))
#self.helper.layout = Layout(
# #*(QSOForm.Meta.fields + [ButtonHolder(Submit('submit', 'Submit', css_class='button white'))]))
# *(QSOForm.Meta.fields + [FormActions(Submit('submit', 'Log!'))]))
def clean_call(self):

View File

@ -26,6 +26,10 @@
width: 100px;
}
#qso-log-form .form-group:last-child {
vertical-align: bottom;
}
</style>
<form method="post" id="qso-log-form" class="form-inline" action="{% url "contest:log" %}">

View File

@ -11,7 +11,7 @@
<form method="post" action="{% url "contest:logEdit" qso.id %}">
{% csrf_token %}
{{ form|crispy }}
<input type="submit" value="Save">
<input type="submit" value="Save" class="btn btn-primary">
</form>
</div>
</div>