Skip to content
Snippets Groups Projects
Commit 61bdb2ac authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

ENH/FIX: allow custom css and fix rendering of static html created by the crawler

parent d41c566b
No related branches found
No related tags found
2 merge requests!112Release 0.12.0,!108F css
Pipeline #52886 passed
......@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ##
### Added ###
- Possibility to configure custom CSS to be used in static HTML sites created
by the crawler
### Changed ###
......@@ -15,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ###
### Fixed ###
- Rendering of entities in static HTML sites created by the crawler.
### Security ###
......
......@@ -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