diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 841e48f9c..a53ec010a 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -6,7 +6,6 @@ dj-database-url==0.5.0 django-braces==1.14.0 django-crispy-forms==1.7.2 django-contrib-postgres==0.0.1 -django-floppyforms==1.8.0 django-extra-views==0.12.0 django-model-utils==3.1.2 django-extensions==2.1.4 diff --git a/sapl/parlamentares/forms.py b/sapl/parlamentares/forms.py index 8621eb360..89ab424f5 100755 --- a/sapl/parlamentares/forms.py +++ b/sapl/parlamentares/forms.py @@ -13,7 +13,6 @@ from django.forms import ModelForm from django.utils import timezone from django.utils.translation import ugettext_lazy as _ import django_filters -from floppyforms.widgets import ClearableFileInput from image_cropping.widgets import CropWidget, ImageCropWidget from sapl.base.models import Autor, TipoAutor @@ -26,10 +25,6 @@ from .models import (Coligacao, ComposicaoColigacao, Filiacao, Frente, Legislatu Mandato, Parlamentar, Partido, Votante, Bloco, FrenteParlamentar, BlocoMembro) -class ImageThumbnailFileInput(ClearableFileInput): - template_name = 'floppyforms/image_thumbnail.html' - - class CustomImageCropWidget(ImageCropWidget): """ Custom ImageCropWidget that doesn't show the initial value of the field. diff --git a/sapl/settings.py b/sapl/settings.py index e811efdd6..42299dd52 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -75,10 +75,11 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'django.forms', + 'django_extensions', 'crispy_forms', - 'floppyforms', 'waffle', @@ -197,6 +198,8 @@ CACHES = { ROOT_URLCONF = 'sapl.urls' +FORM_RENDERER = 'django.forms.renderers.TemplatesSetting' + TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', @@ -333,9 +336,6 @@ DAB_FIELD_RENDERER = \ CRISPY_TEMPLATE_PACK = 'bootstrap4' CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap4' CRISPY_FAIL_SILENTLY = not DEBUG -FLOPPY_FORMS_USE_GIS = False - -FORM_RENDERER = 'django.forms.renderers.DjangoTemplates' # suprime texto de ajuda default do django-filter FILTERS_HELP_TEXT_FILTER = False diff --git a/sapl/templates/floppyforms/image_thumbnail.html b/sapl/templates/floppyforms/image_thumbnail.html deleted file mode 100644 index 79d0f40db..000000000 --- a/sapl/templates/floppyforms/image_thumbnail.html +++ /dev/null @@ -1,65 +0,0 @@ -{% load i18n staticfiles thumbnail %} -{% load webpack_static from webpack_loader %} -
- {% if field.label %} - - {% endif %} - -
-
- {% if value.url %} -
-
- {{ value }} -
-
-
-
- - -
-
- - {% else %} -
-
- -
-
- {% endif %} -
-
-
- -
-
-
- {% include 'bootstrap3/layout/help_text_and_errors.html' %} -
-
diff --git a/sapl/utils.py b/sapl/utils.py index 5ceeecfa5..0733d8152 100644 --- a/sapl/utils.py +++ b/sapl/utils.py @@ -31,14 +31,13 @@ from django.db import models from django.db.models import Q from django.db.models.fields.related import ForeignKey from django.forms import BaseForm -from django.forms.widgets import SplitDateTimeWidget +from django.forms.widgets import SplitDateTimeWidget, ClearableFileInput from django.http.response import JsonResponse, HttpResponse from django.utils import six, timezone from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ import django_filters from easy_thumbnails import source_generators -from floppyforms import ClearableFileInput import magic import requests from unipath.path import Path @@ -310,7 +309,7 @@ class SaplGenericRelation(GenericRelation): class ImageThumbnailFileInput(ClearableFileInput): - template_name = 'floppyforms/image_thumbnail.html' + template_name = 'widgets/image_thumbnail.html' class RangeWidgetOverride(forms.MultiWidget): diff --git a/setup.py b/setup.py index e15abba68..faff1c270 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,6 @@ install_requires = [ 'dj-database-url==0.5.0', 'django-braces==1.9.0', 'django-crispy-forms==1.7.2', - 'django-floppyforms==1.7.0', 'django-extra-views==0.12.0', 'django-model-utils==3.1.2', 'django-extensions==2.1.4',