signebedi / libreforms-fastapi

FastAPI implementation of the libreForms spec
GNU Affero General Public License v3.0
1 stars 1 forks source link

Add support for Jinja2 macros in create & read_one UI route #370

Open signebedi opened 1 month ago

signebedi commented 1 month ago

Maybe this is a is_html_macro that renders jinja2 with the capacity to self-reference values eg. {{FIELD_NAME}} or {{__metadata__FIELD_NAME}}. It renders in the UI read_one page ONLY, like the is_header fields. It renders at the place where it is positioned.

If render_in_create_mode is True, then you will have this rendered in the /create UI page. It will default to False. If render_in_read_mode is True, then you will have this rendered in the /read_one page. You can have both, but be mindful that the create_mode route will not have any values to reference via jinja, though perhaps via javascript pulling values from other elements...