Skip to content

refactor template strings into /templates folder

This moves all the templates in templates.py into a templates/ folder in the repo root. The result is functionally identical but should make things much more manageable in terms of handling the web side of locklost. In particular, the two types of pages should be easier to follow since all the HTML (with some mixed-in python) are contained in a single file that has syntax highlighting enabled.

You can see an example page here: https://ldas-jobs.ligo-wa.caltech.edu/~patrick.godwin/cgi-bin/locklost.cgi

This cleans up web/__main__.py and moves most of the work (the index and event page) into index.tpl and event.tpl, respectively. They both derive from base.tpl which contains the HTML header and some of the skeleton. There are two more templates, plots.tpl and collapsed_plots.tpl for ease in creating the HTML skeleton those require.

I know it's a bit of an extreme change, but hopefully it should be easier to work with for you moving forward.

Merge request reports

Loading