Browse Source

Indenta foto com restante dos campos

pull/271/head
Eduardo Edson Batista Cordeiro Alves 9 years ago
parent
commit
bee6414744
  1. 11
      base/forms.py
  2. 13
      parlamentares/forms.py

11
base/forms.py

@ -36,6 +36,7 @@ class CasaLegislativaTabelaAuxForm(ModelForm):
'cep': forms.TextInput(attrs={'class': 'cep'}), 'cep': forms.TextInput(attrs={'class': 'cep'}),
'telefone': forms.TextInput(attrs={'class': 'telefone'}), 'telefone': forms.TextInput(attrs={'class': 'telefone'}),
'fax': forms.TextInput(attrs={'class': 'telefone'}), 'fax': forms.TextInput(attrs={'class': 'telefone'}),
'logotipo': forms.FileInput,
'informacao_geral': forms.Textarea( 'informacao_geral': forms.Textarea(
attrs={'id': 'casa-informacoes'}) attrs={'id': 'casa-informacoes'})
} }
@ -87,16 +88,18 @@ class CasaLegislativaTabelaAuxForm(ModelForm):
row3, row3,
row4, row4,
row5, row5,
HTML("""{% if form.logotipo.value %} HTML("""<div class="col-md-12">
{% if form.logotipo.value %}
<img class="img-responsive" width="225" height="300" <img class="img-responsive" width="225" height="300"
src="{{ MEDIA_URL }}{{ form.logotipo.value }}"> src="{{ MEDIA_URL }}{{ form.logotipo.value }}">
<br /><br /> <br />
<input type="submit" <input type="submit"
name="remover" name="remover"
id="remover" id="remover"
class="button primary" class="btn btn-warning"
value="Remover Logo"/> value="Remover Logo"/>
{% endif %}""", ), {% endif %}
</div>"""),
row6, row6,
row7, row7,
row8, row8,

13
parlamentares/forms.py

@ -131,16 +131,19 @@ class ParlamentaresForm (ModelForm):
row1, row2, row3, row4, row5, row1, row2, row3, row4, row5,
row6, row7, row8, row9, row10, row6, row7, row8, row9, row10,
row11, row12, row13, row11, row12, row13,
HTML("""{% if form.fotografia.value %} HTML("""<div class="col-md-12">
<img class="img-responsive" width="225" height="300" {% if form.fotografia.value %}
src="{{ MEDIA_URL }}{{ form.fotografia.value }}"> <img class="img-responsive"
<br /><br /> width="225" height="300"
src="{{MEDIA_URL}}{{form.fotografia.value}}">
<br />
<input type="submit" <input type="submit"
name="remover" name="remover"
id="remover" id="remover"
class="btn btn-warning" class="btn btn-warning"
value="Remover Foto"/> value="Remover Foto"/>
{% endif %}""", ), {% endif %}
</div>""", ),
row14, row14,
form_actions()) form_actions())

Loading…
Cancel
Save