Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/opaque into development

This commit is contained in:
Stephan Porada 2020-04-20 13:48:44 +02:00
commit 80c049ae06
2 changed files with 57 additions and 52 deletions

View File

@ -8,7 +8,7 @@ ENV FLASK_APP=nopaque.py
ENV LANG=C.UTF-8
EXPOSE 8000
EXPOSE 5000
RUN apt-get update \
@ -34,9 +34,6 @@ RUN python -m venv venv \
&& mkdir logs
VOLUME ["/home/nopaque/logs", "/home/nopaque/migrations"]
COPY ["docker-entrypoint.sh", "/usr/local/bin/"]

View File

@ -1,11 +1,27 @@
{% macro render_field(field) %}
{% if field.flags.required %}
{% if 'class_' in kwargs and 'validate' not in kwargs['class_'] %}
{% set tmp = kwargs.update({'class_': kwargs['class_'] + ' validate'}) %}
{% else %}
{% set tmp = kwargs.update({'class_': 'validate'}) %}
{% endif %}
{% endif %}
{% if field.type == 'BooleanField' %}
{{ render_boolean_field(field, *args, **kwargs) }}
{% elif field.type == 'IntegerField' %}
{% set tmp = kwargs.update({'type': 'number'}) %}
{% if 'class_' in kwargs and 'validate' not in kwargs['class_'] %}
{% set tmp = kwargs.update({'class_': kwargs['class_'] + ' validate'}) %}
{% else %}
{% set tmp = kwargs.update({'class_': 'validate'}) %}
{% endif %}
{{ render_generic_field(field, *args, **kwargs) }}
{% elif field.type == 'SubmitField' %}
{{ render_submit_field(field, *args, **kwargs) }}
{% elif field.type in ['FileField', 'MultipleFileField'] %}
{{ render_file_field(field, *args, **kwargs) }}
{% elif field.type in ['IntegerField', 'PasswordField', 'SelectField', 'StringField'] %}
{% elif field.type in ['PasswordField', 'SelectField', 'StringField'] %}
{{ render_generic_field(field, *args, **kwargs) }}
{% endif %}
{% endmacro %}
@ -39,14 +55,6 @@
{% endmacro %}
{% macro render_generic_field(field) %}
{% if field.type == 'IntegerField' %}
{% set tmp = kwargs.update({'type': 'number'}) %}
{% if 'class_' in kwargs and 'validate' not in kwargs['class_'] %}
{% set tmp = kwargs.update({'class_': kwargs['class_'] + ' validate'}) %}
{% else %}
{% set tmp = kwargs.update({'class_': 'validate'}) %}
{% endif %}
{% endif %}
<div class="input-field">
{% if 'material_icon' in kwargs %}
<i class="material-icons prefix">{{ kwargs.pop('material_icon') }}</i>