Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scraper/src/maps2zim/assets/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,29 @@ h1 {
}

/* About Page Styles */
.close-button {
position: fixed;
top: 20px;
right: 20px;
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border: 1px solid #ddd;
border-radius: 50%;
background: white;
color: #333;
font-size: 24px;
line-height: 1;
text-decoration: none;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.close-button:hover {
background-color: #f5f5f5;
}

.section {
margin-top: 30px;
padding-top: 25px;
Expand Down
2 changes: 2 additions & 0 deletions scraper/src/maps2zim/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,8 @@ def _create_about_html(
</head>
<body>
<div class="container" style="max-width:700px">
<a class="close-button" href="../index.html"
aria-label="Close about page">&times;</a>
<div class="header">
<div class="icon">🗺️</div>
<h1>{title_escaped}</h1>
Expand Down
15 changes: 15 additions & 0 deletions scraper/tests/test_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,21 @@ def test_create_about_html_contains_title_and_description():
assert "<!DOCTYPE html>" in html


def test_create_about_html_includes_close_link():
"""Test that about.html includes a visible way back to the map."""
html = Processor._create_about_html( # pyright: ignore[reportPrivateUsage]
title="My Map",
description="Short desc",
long_description=None,
zim_creator="openZIM",
publisher="openZIM",
include_geofabrik=False,
)
assert 'class="close-button"' in html
assert 'href="../index.html"' in html
assert 'aria-label="Close about page"' in html


def test_create_about_html_single_creator_publisher():
"""Test creator/publisher when they are the same."""
html = Processor._create_about_html( # pyright: ignore[reportPrivateUsage]
Expand Down