{% set base = '.' %} {% set active_form_id = handler.get_argument('id', '') %} {% set title = 'Form Builder' if active_form_id else 'Form Builder - Create a form' %} {{ title }} {% import os %} {% import json %} {% from gramex import variables %} {% from form_builder import FOLDER %} {% from gramex.data import filter as gfilter %} {% from gramex.config import variables as var %} {% set form_details = gfilter(url=var.FORMS_URL, table=var.FORMS_TABLE, args={'id': [active_form_id]}) %} {% set form_details = form_details %} {% set _md = json.loads(form_details['metadata'].iloc[0]) if active_form_id else '' %} {% set _config = form_details['config'].iloc[0] if active_form_id else '' %} {% set _config = json.loads(_config) if active_form_id else {} %} {% set _config.pop('undefined') if _config and 'undefined' in _config else '' %} {% include template-navbar.html %}

{{ 'Updating an existing form' if active_form_id else 'Creating a new form' }}

{{_md['name'] if active_form_id else 'Untitled form' }}

{{_md['description'] if active_form_id else 'Form description' }}

Configure fields

Add fields
Edit properties
{% include 'toast.html' %} {% include 'modals/add-field.html' %}