Commit 16f9ddc4 authored by Robin Tissot's avatar Robin Tissot
Browse files

Fixes pdf not working in docker and wrong help_text in import pdf modal.

parent 011d0719
# pull official base image
FROM python:3.7.5-stretch
FROM python:3.7.5-buster
# ARG KRAKEN_VERSION=3.0b5
# EXPOSE 8000
......
......@@ -340,7 +340,7 @@ class LineTranscriptionViewSet(DocumentPermissionMixin, ModelViewSet):
if serializer.is_valid():
try:
lt.new_version(author=request.user.username,
source=settings.VERSIONING_DEFAULT_SOURCE)
source=settings.VERSIONING_DEFAULT_SOURCE)
except NoChangeException:
pass
......
......@@ -23,6 +23,8 @@ def render_field(field, group=False, **kwargs):
tplt = template.loader.get_template('django/forms/widgets/field.html')
if 'class' in kwargs and 'class' in field.field.widget.attrs:
kwargs['class'] = field.field.widget.attrs['class'] + " " + kwargs['class']
if 'help_text' in kwargs:
field.help_text = kwargs.pop('help_text')
field.field.widget.attrs.update(**{k.replace('_', '-'): v
for k, v in kwargs.items()
......
......@@ -10,7 +10,8 @@
{% if not import_form.current_import.ongoing %}
<h5>{% trans "Import images from a PDF document." %}</h5>
<div class="form-group">
{% render_field import_form.upload_file class="js-proc-settings" accept=".pdf" %}
{% trans "A single pdf with one image per page." as help_text %}
{% render_field import_form.upload_file class="js-proc-settings" accept=".pdf" help_text=help_text %}
</div>
{% endif %}
{% endblock %}
......
{% if not group %}<div class="form-group">{% endif %}
{% if field.field.widget.need_label %}<label class="my-1 mr-1" for="{{ field.name }}">{{ field.label }}</label>{% endif %}
{{ field }}
{% if not group %}
{% if field.help_text %}<small id="{{field.name}}Help" class="form-text text-muted">{{field.help_text|safe}}</small>{% endif %}
{% if field.field.widget.need_label %}<label class="my-1 mr-1" for="{{ field.name }}">{{ field.label }}</label>{% endif %}
{{ field }}
{% if not group %}
{% if field.help_text %}
<small id="{{field.name}}Help" class="form-text text-muted">
{{ field.help_text|safe }}
</small>
{% endif %}
{% for error in field.errors %}<div class="invalid-feedback">{{ error }}</div>{% endfor %}
</div>
{% endif %}
......@@ -23,3 +23,4 @@ numpy>=1.17
django-compressor==2.4
albumentations
django-simple-captcha==0.5.12
pyvips==2.1.12
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment