Browse Source

Refatora botão de submit de tela de pesquisa formulário para utilizar

crispy form

E comenta radio button com problema devido ao Bootstrap até encontrar
solução.
pull/202/head
Edward Ribeiro 9 years ago
parent
commit
dbcce4ad83
  1. 6
      protocoloadm/views.py
  2. 11
      templates/protocoloadm/protocolo_pesquisa.html

6
protocoloadm/views.py

@ -149,8 +149,8 @@ class ProtocoloForm(forms.Form):
('0', 'Administrativo'), ('0', 'Administrativo'),
('1', 'Legislativo'), ('1', 'Legislativo'),
('', 'Ambos')], ('', 'Ambos')],
widget=forms.RadioSelect( # widget=forms.RadioSelect(
renderer=HorizontalRadioRenderer) # renderer=HorizontalRadioRenderer)
) )
@ -203,7 +203,7 @@ class ProtocoloForm(forms.Form):
[('natureza_processo', 12)]) [('natureza_processo', 12)])
self.helper = FormHelper() self.helper = FormHelper()
self.helper.layout = Layout(row1, row2, row3, row4, row5) self.helper.layout = Layout(row1, row2, row3, row4, row5, form_actions(save_label='Pesquisar'))
super(ProtocoloForm, self).__init__( super(ProtocoloForm, self).__init__(
*args, **kwargs) *args, **kwargs)

11
templates/protocoloadm/protocolo_pesquisa.html

@ -3,12 +3,7 @@
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
{% block detail_content %} {% block detail_content %}
<form method="post"> <legend>Pesquisa Avançada</legend>
{% csrf_token %} {% crispy form %}
<fieldset> </fieldset>
<legend>Pesquisa Avançada</legend>
{% crispy form %}
<input type="submit" value="Pesquisar" name="pesquisa" class="button primary"/>
</fieldset>
</form>
{% endblock detail_content %} {% endblock detail_content %}

Loading…
Cancel
Save