Commit graph

8 commits

Author SHA1 Message Date
Martin Hebnes Pedersen
36eb6ade59 Fix parsing of ReplyTemplate template command 2025-07-05 13:32:30 +02:00
Martin Hebnes Pedersen
8a3159e8f2 Improve template parsing/detection 2025-05-30 07:07:43 +02:00
Martin Hebnes Pedersen
42856f11d7 Handle UTF-8 BOM when reading templates files 2024-12-13 18:34:04 +01:00
Martin Hebnes Pedersen
4d7ab34e65 Cleanup 2024-04-13 07:33:20 +02:00
Martin Hebnes Pedersen
64dd3cd29d Resolve Form files by referencing the template
By referencing the template instead of the "initial_uri" (Forms
composer), the backend is able to more precisely identify the correct
HTML file for any given template. It also makes handling of reply
templates much easier.

In addition to a less complex implementation, this simplifies the API as
we no longer need to supply the frontend with URIs for all HTML
variants. We also get increased performance because of the simplified
file search, and by not having to parse reply templates upfront.

This also opens up the possibility of serving a specialized HTML-based
composer for text-only templates in the future, without having to change
the existing frontend.
2024-04-13 07:33:20 +02:00
Martin Hebnes Pedersen
6129ee5302 Fallback to global file reference search
Some templates references HTML Forms and reply templates located in
adjecent folders, without specifying a relative path. Examples of this
can be found in `MAPPING-GIS FORMS`.
2024-04-13 07:33:20 +02:00
Martin Hebnes Pedersen
c4984fcf77 Ignore invalid file references
This fixes an issue where, when searching for a html viewer, we ended up
using a non-existent HTML file.
2024-04-13 07:33:20 +02:00
Martin Hebnes Pedersen
9db0706843 More refactoring (split source files) 2024-04-13 07:33:20 +02:00