Browse Source

Adiciona preview de imagem na edição da casa legislativa

pull/336/head
Eduardo Edson Batista Cordeiro Alves 9 years ago
parent
commit
36be92b567
  1. 7
      base/forms.py

7
base/forms.py

@ -8,10 +8,15 @@ from django.utils.translation import ugettext_lazy as _
import crispy_layout_mixin import crispy_layout_mixin
from crispy_layout_mixin import form_actions from crispy_layout_mixin import form_actions
from sapl.settings import MAX_IMAGE_UPLOAD_SIZE from sapl.settings import MAX_IMAGE_UPLOAD_SIZE
from floppyforms import ClearableFileInput
from .models import CasaLegislativa from .models import CasaLegislativa
class ImageThumbnailFileInput(ClearableFileInput):
template_name = 'floppyforms/image_thumbnail.html'
class CasaLegislativaTabelaAuxForm(ModelForm): class CasaLegislativaTabelaAuxForm(ModelForm):
class Meta: class Meta:
@ -36,7 +41,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, 'logotipo': ImageThumbnailFileInput,
'informacao_geral': forms.Textarea( 'informacao_geral': forms.Textarea(
attrs={'id': 'casa-informacoes'}) attrs={'id': 'casa-informacoes'})
} }

Loading…
Cancel
Save