supervisor-frontend-service icon indicating copy to clipboard operation
supervisor-frontend-service copied to clipboard

Fix hard-coded URL patterns in the templates

Open gridhead opened this issue 4 years ago • 1 comments

That is, replace

<a href="/contlist/">Containers</a>

with

<a href="{{ url_for('contlist') }}">Containers</a>

You get the idea, don't you? :slightly_smiling_face:

gridhead avatar Feb 28 '21 18:02 gridhead

Hard-coded URL can be removed only from the HTML5 templates and those generated from JavaScript would still be hard-coded as they cannot be used with the templating engine unless the JavaScript files are made into one of the origin templates, like frameset.html but then the rendered HTML would also include internal JavaScript code in themselves and not import it externally - which is not we want.

This issue can hence be fixed either partially or we can look away from fixing this at all for the redirects work perfectly in the current state and a mixture of soft-coded URLs (in HTML files) and hard-coded URLs (in JavaScript files), albeit working, would still lead to an inconsistent code and any change to the URL pattern would still not be reflected automatically in the imported JavaScript files.

Tagging this issue with the question label now.

gridhead avatar Mar 01 '21 02:03 gridhead