Narrative web: New features (#842)

* Narrative: Don't use event links if no event pages

+ some pylint changes

* map popup links must be visible for all stylesheet

* Narrative web: add scrollbar in popup content

* Narweb: Some improvement in popup

* Narweb: remove unused variable.
This commit is contained in:
Serge Noiraud 2019-12-15 09:59:58 +01:00 committed by GitHub
parent ac37f11b87
commit 3938fac0d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 18 deletions

View File

@ -975,7 +975,6 @@ table.calendar {
.calendar td.highlight div.date { .calendar td.highlight div.date {
color: #36220B; color: #36220B;
background-color: #FFC35E; background-color: #FFC35E;
vertical-align: middle;
} }
/* Calendar : Previous-Next Month */ /* Calendar : Previous-Next Month */
@ -985,7 +984,6 @@ table.calendar {
.calendar td.next div.date { .calendar td.next div.date {
color: #FFC35E; color: #FFC35E;
background-color: #FFFBE7; background-color: #FFFBE7;
vertical-align: middle;
} }
/* Calendar : Full Year */ /* Calendar : Full Year */

View File

@ -75,12 +75,12 @@ div#FamilyMapDetail div#references table.infolist tbody tr td.ColumnPlace {
background-color: white; background-color: white;
-webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); -webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2)); filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
padding: 15px; padding: 5px;
border-radius: 10px; border-radius: 8px;
border: 2px solid #111111; border: 2px solid #111111;
bottom: 12px; bottom: 8px;
left: -50px; left: -10px;
min-width: 450px; min-width: 500px;
} }
#map_canvas .ol-popup:after, #map_canvas .ol-popup:before { #map_canvas .ol-popup:after, #map_canvas .ol-popup:before {
top: 100%; top: 100%;
@ -108,13 +108,29 @@ div#FamilyMapDetail div#references table.infolist tbody tr td.ColumnPlace {
top: 2px; top: 2px;
right: 8px; right: 8px;
} }
#map_canvas .ol-popup-title {
background-color: #ededed;
padding: 0 0.5em;
}
#map_canvas .ol-popup-content {
color: #111;
font: bold 0.9em sans-serif;
max-height: 200px;
overflow-y: auto;
padding: 0 0.5em 15px 0.5em;
}
#map_canvas .ol-popup-content a {
color: #111;
}
#map_canvas .ol-popup-content a:visited {
color: green;
}
#map_canvas .ol-popup-content a:hover {
color: red;
}
#map_canvas .ol-popup-closer:after { #map_canvas .ol-popup-closer:after {
content: "✖"; content: "✖";
} }
#popup-content {
max-height: 250px;
overflow-y: auto;
}
#map_canvas .ol-control { #map_canvas .ol-control {
position: absolute; position: absolute;
background-color: rgba(255,255,255,0.1); background-color: rgba(255,255,255,0.1);

View File

@ -289,6 +289,7 @@ STAMEN_MARKERS = """
OPENLAYER = """ OPENLAYER = """
var element = document.getElementById('popup'); var element = document.getElementById('popup');
var content = document.getElementById('popup-content'); var content = document.getElementById('popup-content');
var ptitle = document.getElementById('popup-title');
var closer = document.getElementById('popup-closer'); var closer = document.getElementById('popup-closer');
var tip = document.getElementById('tooltip'); var tip = document.getElementById('tooltip');
var tipcontent = document.getElementById('tooltip-content'); var tipcontent = document.getElementById('tooltip-content');
@ -323,7 +324,6 @@ OPENLAYER = """
}); });
map.getTargetElement().style.cursor = feature ? 'pointer' : ''; map.getTargetElement().style.cursor = feature ? 'pointer' : '';
if (evt.dragging) { if (evt.dragging) {
popup.setPosition(undefined);
tooltip.setPosition(undefined); tooltip.setPosition(undefined);
return; return;
} }
@ -344,10 +344,9 @@ OPENLAYER = """
if (feature) { if (feature) {
var coordinate = evt.coordinate; var coordinate = evt.coordinate;
var title = '<h2>' + feature.get('name') + '</h2>'; var title = '<h2>' + feature.get('name') + '</h2>';
content.innerHTML = title + feature.get('data'); ptitle.innerHTML = title;
content.innerHTML = feature.get('data');
popup.setPosition(coordinate); popup.setPosition(coordinate);
} else {
popup.setPosition(undefined);
} }
}); });
}); });

View File

@ -756,7 +756,6 @@ class PersonPages(BasePage):
if number_markers > 0: if number_markers > 0:
tracelife = "[" tracelife = "["
seq_ = 0 seq_ = 0
old_place_title = "" old_place_title = ""
links = "" links = ""
ln_str = "<a href='%s' title='%s' target='_self'>%s</a>" ln_str = "<a href='%s' title='%s' target='_self'>%s</a>"
@ -939,7 +938,10 @@ class PersonPages(BasePage):
mapdetail += popup mapdetail += popup
popup += Html("a", href="#", id="popup-closer", popup += Html("a", href="#", id="popup-closer",
class_="ol-popup-closer") class_="ol-popup-closer")
popup += Html("div", id="popup-content") popup += Html("div", id="popup-title",
class_="ol-popup-title")
popup += Html("div", id="popup-content",
class_="ol-popup-content")
with Html("div", id="tooltip", class_="ol-popup", with Html("div", id="tooltip", class_="ol-popup",
inline=True) as tooltip: inline=True) as tooltip:
mapdetail += tooltip mapdetail += tooltip

View File

@ -415,6 +415,8 @@ class PlacePages(BasePage):
placedetail += popup placedetail += popup
popup += Html("a", href="#", id="popup-closer", popup += Html("a", href="#", id="popup-closer",
class_="ol-popup-closer") class_="ol-popup-closer")
popup += Html("div", id="popup-title",
class_="ol-popup-title")
popup += Html("div", id="popup-content") popup += Html("div", id="popup-content")
with Html("div", id="tooltip", class_="ol-popup", with Html("div", id="tooltip", class_="ol-popup",
inline=True) as tooltip: inline=True) as tooltip: