Skip to content
Snippets Groups Projects
Commit 0fc89beb authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'f-css' into 'dev'

F css

See merge request !108
parents d41c566b 0f8ee50f
Branches
Tags
2 merge requests!112Release 0.12.0,!108F css
Pipeline #53490 passed
......@@ -8,14 +8,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ###
- Possibility to configure custom CSS to be used in static HTML sites created
by the crawler
### Changed ###
- The static HTML pages that are generated by the crawler now require the
webinterface to be built with `JS_DIST_BUNDLE=TRUE`, i.e. all js source files
bundled into one `webcaosdb.dist.js`. This is the default and highly
recommended for production systems in any case but it will break the display
of these static files in certain corner cases where you may want to use
`JS_DIST_BUNDLE=FALSE` for development or debugging reasons.
### Deprecated ###
### Removed ###
### Fixed ###
- Rendering of entities in static HTML sites created by the crawler.
### Security ###
### Documentation ###
......
......@@ -518,6 +518,12 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
"""
from xml.sax.saxutils import escape
caosdb_config = db.configuration.get_config()
if ("advancedtools" in caosdb_config and "crawler.customcssfile" in
caosdb_config["advancedtools"]):
cssfile = caosdb_config["advancedtools"]["crawler.customcssfile"]
else:
cssfile = None
# TODO move path related stuff to sss_helper
form = """
<html>
......@@ -526,21 +532,17 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Crawler</title>
<link rel="stylesheet" href="{url}/webinterface/css/webcaosdb.css"/>
<link rel="stylesheet" href="{url}/webinterface/css/bootstrap.css">
<script src="{url}/webinterface/js/jquery.js"></script>
<script src="{url}/webinterface/js/utif.js"></script>
<script src="{url}/webinterface/js/loglevel.js"></script>
<script src="{url}/webinterface/js/bootstrap.js"></script>
<script src="{url}/webinterface/js/ext_table_preview.js"></script>
<script src="{url}/webinterface/js/webcaosdb.js"></script>
<script src="{url}/webinterface/js/plotly.js"></script>
<script src="{url}/webinterface/js/caosdb.js"></script>
<script src="{url}/webinterface/js/state-machine.js"></script>
<script src="{url}/webinterface/js/showdown.js"></script>
<script src="{url}/webinterface/js/preview.js"></script>
<script src="{url}/webinterface/js/ext_references.js"></script>
<script src="{url}/webinterface/js/ext_bottom_line.js"></script>
<link rel="stylesheet" href="{url}/webinterface/css/webcaosdb.css"/>
<link rel="stylesheet" href="{url}/webinterface/css/linkahead.css"/>
<link rel="stylesheet" href="{url}/webinterface/css/dropzone.css">
<link rel="stylesheet" href="{url}/webinterface/css/tour.css">
<link rel="stylesheet" href="{url}/webinterface/css/leaflet.css">
<link rel="stylesheet" href="{url}/webinterface/css/leaflet-coordinates.css">
<link rel="stylesheet" href="{url}/webinterface/css/bootstrap-select.css">
<link rel="stylesheet" href="{url}/webinterface/css/bootstrap-icons.css">
{customcssfile}
<script src="{url}/webinterface/webcaosdb.dist.js"></script>
</head>
<body>
<form method="post" action="{url}/scripting">
......@@ -582,9 +584,11 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
</script>
</body>
</html>
""".format(url=db.configuration.get_config()["Connection"]["url"],
""".format(url=caosdb_config["Connection"]["url"],
rid=run_id,
changes=escape("\n".join(changes)),
customcssfile='<link rel="stylesheet" href="{url}/webinterface/css/{customcssfile}"/>'.format(
url=caosdb_config["Connection"]["url"], customcssfile=cssfile) if cssfile else "",
path=path)
if "SHARED_DIR" in os.environ:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment