Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
61bdb2ac
Commit
61bdb2ac
authored
10 months ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
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
!112
Release 0.12.0
,
!108
F css
Pipeline
#52886
passed
10 months ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+3
-0
3 additions, 0 deletions
CHANGELOG.md
src/caosadvancedtools/crawler.py
+19
-15
19 additions, 15 deletions
src/caosadvancedtools/crawler.py
with
22 additions
and
15 deletions
CHANGELOG.md
+
3
−
0
View file @
61bdb2ac
...
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ##
## [Unreleased] ##
### Added ###
### Added ###
-
Possibility to configure custom CSS to be used in static HTML sites created
by the crawler
### Changed ###
### Changed ###
...
@@ -15,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
...
@@ -15,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ###
### Removed ###
### Fixed ###
### Fixed ###
-
Rendering of entities in static HTML sites created by the crawler.
### Security ###
### Security ###
...
...
This diff is collapsed.
Click to expand it.
src/caosadvancedtools/crawler.py
+
19
−
15
View file @
61bdb2ac
...
@@ -518,6 +518,12 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
...
@@ -518,6 +518,12 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
"""
"""
from
xml.sax.saxutils
import
escape
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
# TODO move path related stuff to sss_helper
form
=
"""
form
=
"""
<html>
<html>
...
@@ -526,21 +532,17 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
...
@@ -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 http-equiv=
"
Content-Type
"
content=
"
text/html; charset=UTF-8
"
>
<meta name=
"
viewport
"
content=
"
width=device-width, initial-scale=1
"
>
<meta name=
"
viewport
"
content=
"
width=device-width, initial-scale=1
"
>
<title>Crawler</title>
<title>Crawler</title>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/webcaosdb.css
"
/>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/bootstrap.css
"
>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/bootstrap.css
"
>
<script src=
"
{url}/webinterface/js/jquery.js
"
></script>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/webcaosdb.css
"
/>
<script src=
"
{url}/webinterface/js/utif.js
"
></script>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/linkahead.css
"
/>
<script src=
"
{url}/webinterface/js/loglevel.js
"
></script>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/dropzone.css
"
>
<script src=
"
{url}/webinterface/js/bootstrap.js
"
></script>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/tour.css
"
>
<script src=
"
{url}/webinterface/js/ext_table_preview.js
"
></script>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/leaflet.css
"
>
<script src=
"
{url}/webinterface/js/webcaosdb.js
"
></script>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/leaflet-coordinates.css
"
>
<script src=
"
{url}/webinterface/js/plotly.js
"
></script>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/bootstrap-select.css
"
>
<script src=
"
{url}/webinterface/js/caosdb.js
"
></script>
<link rel=
"
stylesheet
"
href=
"
{url}/webinterface/css/bootstrap-icons.css
"
>
<script src=
"
{url}/webinterface/js/state-machine.js
"
></script>
{customcssfile}
<script src=
"
{url}/webinterface/js/showdown.js
"
></script>
<script src=
"
{url}/webinterface/webcaosdb.dist.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>
</head>
</head>
<body>
<body>
<form method=
"
post
"
action=
"
{url}/scripting
"
>
<form method=
"
post
"
action=
"
{url}/scripting
"
>
...
@@ -582,9 +584,11 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
...
@@ -582,9 +584,11 @@ ____________________\n""".format(i+1, len(pending_changes)) + str(el[3]))
</script>
</script>
</body>
</body>
</html>
</html>
"""
.
format
(
url
=
db
.
configuration
.
get
_config
()
[
"
Connection
"
][
"
url
"
],
"""
.
format
(
url
=
caosdb
_config
[
"
Connection
"
][
"
url
"
],
rid
=
run_id
,
rid
=
run_id
,
changes
=
escape
(
"
\n
"
.
join
(
changes
)),
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
)
path
=
path
)
if
"
SHARED_DIR
"
in
os
.
environ
:
if
"
SHARED_DIR
"
in
os
.
environ
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment