Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved CSS and JS version management #33

Open
Flix6x opened this issue Feb 19, 2021 · 1 comment
Open

Improved CSS and JS version management #33

Flix6x opened this issue Feb 19, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers UI

Comments

@Flix6x
Copy link
Contributor

Flix6x commented Feb 19, 2021

At the very least we need to set the versions of external CSS and JS dependencies in one place. One example is Leaflet, which currently gets loaded individually for the following templates: dashboard.html, asset.html and asset_new.html. This makes version management more cumbersome than it should be. I suggest moving the version requirements into the app, and using Jinja to inject the right scripts in the right place within our templates. This would be similar to how bokeh handles this already:

In the view:

bokeh_html_embedded = ""
for css in CDN.css_files:
    bokeh_html_embedded += (
        """<link href="%s" rel="stylesheet" type="text/css">\n""" % css
    )
for js in CDN.js_files:
    bokeh_html_embedded += """<script src="%s"></script>\n""" % js

In the html:

{{ bokeh_html_embedded | safe }}
@Flix6x Flix6x added the enhancement New feature or request label Feb 19, 2021
@Flix6x
Copy link
Contributor Author

Flix6x commented Apr 20, 2021

Commit fdcd2f7 in PR #99 introduced an idea to handle JS version management.

@nhoening nhoening added UI good first issue Good for newcomers labels May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers UI
Projects
None yet
Development

No branches or pull requests

2 participants