Skip to content

Commit

Permalink
Add main.css and map.css in the HTML maptip dock preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry committed Nov 30, 2023
1 parent b7ae66e commit fc4f931
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions lizmap/dialogs/dock_html_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,15 @@ def set_server_url(self, url: str):
self._server_url = url

def css(self) -> str:
""" Link to CSS style sheet according to server. """
asset = 'assets/css/bootstrap.min.css'
return self._server_url + asset
""" Links to CSS style sheet according to the server. """
# Order is important
assets = (
'assets/css/bootstrap.min.css',
'themes/default/css/main.css',
'themes/default/css/map.css',
)
html = [f'<link type="text/css" href="{self._server_url + asset}" rel="stylesheet" />' for asset in assets]
return '\n'.join(html)

def current_layer_changed(self):
""" When the layer has changed. """
Expand Down
2 changes: 1 addition & 1 deletion lizmap/resources/html/maptip_preview.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<head>
<link type="text/css" href="{css}" rel="stylesheet" />
{css}
</head>
<body>
{maptip}
Expand Down

0 comments on commit fc4f931

Please sign in to comment.