- Replace old implementation of PROCESSOR_TYPES and CATALOG_TYPES with the new cached approach

- Add an ordered_list dynamic field type (to be refined)
- Add tabulator javascript library to project
This commit is contained in:
Josako
2025-05-29 16:00:25 +02:00
parent 8a29eb0d8f
commit 25e169dbea
23 changed files with 687 additions and 199 deletions

View File

@@ -1,3 +1,12 @@
{# Helper functie om veilig de class van een veld te krijgen #}
{% macro get_field_class(field, default='') %}
{% if field.render_kw is not none and field.render_kw.get('class') is not none %}
{{ field.render_kw.get('class') }}
{% else %}
{{ default }}
{% endif %}
{% endmacro %}
{% macro render_field_content(field, disabled=False, readonly=False, class='') %}
{% if field.type == 'BooleanField' %}
<div class="form-group">
@@ -55,9 +64,13 @@
{% endif %}
{% endif %}
{% set field_class = get_field_class(field) %}
{% if field.type == 'TextAreaField' and 'json-editor' in class %}
<div id="{{ field.id }}-editor" class="json-editor-container"></div>
{{ field(class="form-control d-none " + class, disabled=disabled, readonly=readonly) }}
{% elif field.type == 'OrderedListField' or 'ordered-list-field' in field_class %}
{# Behoud ordered-list-field class en voeg form-control toe #}
{{ field(class="form-control " + field_class|trim, disabled=disabled, readonly=readonly) }}
{% elif field.type == 'SelectField' %}
{{ field(class="form-control form-select " + class, disabled=disabled, readonly=readonly) }}
{% else %}
@@ -76,6 +89,7 @@
{% endmacro %}
{% macro render_field(field, disabled_fields=[], readonly_fields=[], exclude_fields=[], class='') %}
<!-- Debug info -->
<!-- Field name: {{ field.name }}, Field type: {{ field.__class__.__name__ }} -->