From 36be92b56730227f634e1d4c4294fe3b54c89dad Mon Sep 17 00:00:00 2001 From: Eduardo Edson Batista Cordeiro Alves Date: Tue, 19 Apr 2016 10:45:48 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20preview=20de=20imagem=20na=20edi?= =?UTF-8?q?=C3=A7=C3=A3o=20da=20casa=20legislativa?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/forms.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base/forms.py b/base/forms.py index d0e660312..f6532077c 100644 --- a/base/forms.py +++ b/base/forms.py @@ -8,10 +8,15 @@ from django.utils.translation import ugettext_lazy as _ import crispy_layout_mixin from crispy_layout_mixin import form_actions from sapl.settings import MAX_IMAGE_UPLOAD_SIZE +from floppyforms import ClearableFileInput from .models import CasaLegislativa +class ImageThumbnailFileInput(ClearableFileInput): + template_name = 'floppyforms/image_thumbnail.html' + + class CasaLegislativaTabelaAuxForm(ModelForm): class Meta: @@ -36,7 +41,7 @@ class CasaLegislativaTabelaAuxForm(ModelForm): 'cep': forms.TextInput(attrs={'class': 'cep'}), 'telefone': forms.TextInput(attrs={'class': 'telefone'}), 'fax': forms.TextInput(attrs={'class': 'telefone'}), - 'logotipo': forms.FileInput, + 'logotipo': ImageThumbnailFileInput, 'informacao_geral': forms.Textarea( attrs={'id': 'casa-informacoes'}) }