up styles
This commit is contained in:
parent
1048f4af45
commit
7971e48636
5 changed files with 32 additions and 33 deletions
|
@ -167,7 +167,7 @@ class DemoResource:
|
|||
<a href="/demo">← Back to Map</a>
|
||||
<a href="/">API Information</a>
|
||||
<a href="/event">View Events</a>
|
||||
<a href="https://source.cipherbliss.com/tykayn/oedb-backend" target="_blank" title="View Source Code on Cipherbliss">
|
||||
<a href="https://source.cipherbliss.com/tykayn/oedb-backend" title="View Source Code on Cipherbliss">
|
||||
<i class="fas fa-code-branch"></i> Source
|
||||
</a>
|
||||
</div>
|
||||
|
@ -251,7 +251,7 @@ class DemoResource:
|
|||
|
||||
// Add attribution control with OpenStreetMap attribution
|
||||
map.addControl(new maplibregl.AttributionControl({{
|
||||
customAttribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors'
|
||||
customAttribution: '© <a href="https://www.openstreetmap.org/copyright" >OpenStreetMap</a> contributors'
|
||||
}}));
|
||||
|
||||
// Add marker for event location
|
||||
|
@ -400,7 +400,7 @@ class DemoResource:
|
|||
|
||||
// Add link to view the event
|
||||
const resultElement = document.getElementById('result');
|
||||
resultElement.innerHTML += `<p><a href="/event/${{data.id}}" target="_blank">View Event</a> | <a href="/demo">Back to Map</a></p>`;
|
||||
resultElement.innerHTML += `<p><a href="/event/${{data.id}}" >View Event</a> | <a href="/demo">Back to Map</a></p>`;
|
||||
}})
|
||||
.catch(error => {{
|
||||
showResult(`Error: ${{error.message}}`, 'error');
|
||||
|
@ -553,8 +553,8 @@ class DemoResource:
|
|||
event_label = event.get('label', 'Unnamed Event')
|
||||
coordinates = event.get('coordinates', [0, 0])
|
||||
|
||||
html += f'<li><a href="/event/{event_id}" target="_blank">{event_label}</a> '
|
||||
html += f'<small>[<a href="https://www.openstreetmap.org/?mlat={coordinates[1]}&mlon={coordinates[0]}&zoom=15" target="_blank">map</a>]</small></li>'
|
||||
html += f'<li><a href="/event/{event_id}" >{event_label}</a> '
|
||||
html += f'<small>[<a href="https://www.openstreetmap.org/?mlat={coordinates[1]}&mlon={coordinates[0]}&zoom=15" >map</a>]</small></li>'
|
||||
|
||||
html += "</ul>"
|
||||
else:
|
||||
|
@ -1207,7 +1207,7 @@ class DemoResource:
|
|||
}
|
||||
|
||||
// Add link to view full event
|
||||
popupContent += `<p><a href="/event/${properties.id}" target="_blank">View Event</a></p>`;
|
||||
popupContent += `<p><a href="/event/${properties.id}" >View Event</a></p>`;
|
||||
|
||||
popupContent += '</div>';
|
||||
|
||||
|
@ -1468,7 +1468,7 @@ class DemoResource:
|
|||
<a href="/">Home</a>
|
||||
<a href="/demo">Demo Map</a>
|
||||
<a href="/demo/by-what">Events by Type</a>
|
||||
<a href="https://source.cipherbliss.com/tykayn/oedb-backend" target="_blank" title="View Source Code on Cipherbliss">
|
||||
<a href="https://source.cipherbliss.com/tykayn/oedb-backend" title="View Source Code on Cipherbliss">
|
||||
<i class="fas fa-code-branch"></i> Source
|
||||
</a>
|
||||
</div>
|
||||
|
@ -1504,7 +1504,7 @@ class DemoResource:
|
|||
|
||||
// Add attribution control with OpenStreetMap attribution
|
||||
map.addControl(new maplibregl.AttributionControl({
|
||||
customAttribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors'
|
||||
customAttribution: '© <a href="https://www.openstreetmap.org/copyright" >OpenStreetMap</a> contributors'
|
||||
}));
|
||||
|
||||
// Store all events and their types
|
||||
|
@ -1696,7 +1696,7 @@ class DemoResource:
|
|||
} else if (typeof value === 'object') {
|
||||
displayValue = `<pre style="margin: 0; white-space: pre-wrap;">${JSON.stringify(value, null, 2)}</pre>`;
|
||||
} else if (typeof value === 'string' && value.startsWith('http')) {
|
||||
displayValue = `<a href="${value}" target="_blank">${value}</a>`;
|
||||
displayValue = `<a href="${value}" >${value}</a>`;
|
||||
} else {
|
||||
displayValue = String(value);
|
||||
}
|
||||
|
@ -1897,8 +1897,8 @@ class DemoResource:
|
|||
event_label = event.get('label', 'Unnamed Event')
|
||||
coordinates = event.get('coordinates', [0, 0])
|
||||
|
||||
html += f'<li><a href="/event/{event_id}" target="_blank">{event_label}</a> '
|
||||
html += f'<small>[<a href="https://www.openstreetmap.org/?mlat={coordinates[1]}&mlon={coordinates[0]}&zoom=15" target="_blank">map</a>]</small></li>'
|
||||
html += f'<li><a href="/event/{event_id}" >{event_label}</a> '
|
||||
html += f'<small>[<a href="https://www.openstreetmap.org/?mlat={coordinates[1]}&mlon={coordinates[0]}&zoom=15" >map</a>]</small></li>'
|
||||
|
||||
html += "</ul>"
|
||||
else:
|
||||
|
@ -1933,7 +1933,7 @@ class DemoResource:
|
|||
"""
|
||||
Handle GET requests to the /demo/view-events endpoint.
|
||||
Delegates to the demo_view_events resource.
|
||||
|
||||
|
||||
Args:
|
||||
req: The request object.
|
||||
resp: The response object.
|
||||
|
|
|
@ -114,7 +114,7 @@ class DemoMainResource:
|
|||
<!-- Authentication section -->
|
||||
<div id="auth-section" class="auth-section">
|
||||
<h3>OpenStreetMap Authentication</h3>
|
||||
<p>Authenticate with your OpenStreetMap account to include your username in reports.</p>
|
||||
|
||||
<a href="https://www.openstreetmap.org/oauth2/authorize?client_id={client_id}&redirect_uri={client_redirect}&response_type=code&scope=read_prefs" class="osm-login-btn">
|
||||
<span class="osm-logo"></span>
|
||||
Login with OpenStreetMap
|
||||
|
@ -138,23 +138,23 @@ class DemoMainResource:
|
|||
|
||||
<h3>API Endpoints:</h3>
|
||||
<ul>
|
||||
<li><a href="/" target="_blank">/ - API Information</a></li>
|
||||
<li><a href="/event" target="_blank">/event - Get Events</a></li>
|
||||
<li><a href="/stats" target="_blank">/stats - Database Statistics</a></li>
|
||||
<li><a href="/" >/ - API Information</a></li>
|
||||
<li><a href="/event" >/event - Get Events</a></li>
|
||||
<li><a href="/stats" >/stats - Database Statistics</a></li>
|
||||
</ul>
|
||||
<h3>Demo Pages:</h3>
|
||||
<ul>
|
||||
<li><a href="/demo/search" target="_blank">/demo/search - Advanced Search</a></li>
|
||||
<li><a href="/demo/by-what" target="_blank">/demo/by-what - Events by Type</a></li>
|
||||
<li><a href="/demo/map-by-what" target="_blank">/demo/map-by-what - Map by Event Type</a></li>
|
||||
<li><a href="/demo/traffic" target="_blank">/demo/traffic - Report Traffic Jam</a></li>
|
||||
<li><a href="/demo/view-events" target="_blank">/demo/view-events - View Saved Events</a></li>
|
||||
<li><a href="/event?what=music" target="_blank">Search Music Events</a></li>
|
||||
<li><a href="/event?what=sport" target="_blank">Search Sport Events</a></li>
|
||||
<li><a href="/demo/search" >/demo/search - Advanced Search</a></li>
|
||||
<li><a href="/demo/by-what" >/demo/by-what - Events by Type</a></li>
|
||||
<li><a href="/demo/map-by-what" >/demo/map-by-what - Map by Event Type</a></li>
|
||||
<li><a href="/demo/traffic" >/demo/traffic - Report Traffic Jam</a></li>
|
||||
<li><a href="/demo/view-events" >/demo/view-events - View Saved Events</a></li>
|
||||
<li><a href="/event?what=music" >Search Music Events</a></li>
|
||||
<li><a href="/event?what=sport" >Search Sport Events</a></li>
|
||||
</ul>
|
||||
<p><a href="/demo/add" class="add-event-btn" style="display: block; text-align: center; margin-top: 15px; padding: 8px; background-color: #0078ff; color: white; border-radius: 4px; font-weight: bold;">+ Add New Event</a></p>
|
||||
<p style="text-align: center; margin-top: 10px;">
|
||||
<a href="https://source.cipherbliss.com/tykayn/oedb-backend" target="_blank" title="View Source Code on Cipherbliss" style="font-size: 24px;">
|
||||
<a href="https://source.cipherbliss.com/tykayn/oedb-backend" title="View Source Code on Cipherbliss" style="font-size: 24px;">
|
||||
<i class="fas fa-code-branch"></i>
|
||||
</a>
|
||||
</p>
|
||||
|
@ -180,7 +180,7 @@ class DemoMainResource:
|
|||
'https://tile.openstreetmap.org/{z}/{x}/{y}.png'
|
||||
],
|
||||
tileSize: 256,
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors'
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright" >OpenStreetMap</a> contributors'
|
||||
}
|
||||
},
|
||||
layers: [
|
||||
|
@ -208,7 +208,7 @@ class DemoMainResource:
|
|||
|
||||
// Add attribution control with OpenStreetMap attribution
|
||||
map.addControl(new maplibregl.AttributionControl({
|
||||
customAttribution: '© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors'
|
||||
customAttribution: '© <a href="https://www.openstreetmap.org/copyright" >OpenStreetMap</a> contributors'
|
||||
}));
|
||||
|
||||
// Style switcher functionality
|
||||
|
@ -348,7 +348,7 @@ class DemoMainResource:
|
|||
} else if (typeof value === 'object') {
|
||||
displayValue = `<pre style="margin: 0; white-space: pre-wrap;">${JSON.stringify(value, null, 2)}</pre>`;
|
||||
} else if (typeof value === 'string' && value.startsWith('http')) {
|
||||
displayValue = `<a href="${value}" target="_blank">${value}</a>`;
|
||||
displayValue = `<a href="${value}" >${value}</a>`;
|
||||
} else {
|
||||
displayValue = String(value);
|
||||
}
|
||||
|
|
|
@ -114,13 +114,12 @@ class OSMAuth {
|
|||
html += '<div class="auth-info">';
|
||||
html += '<div>';
|
||||
html += `<p>Logged in as <strong>${this.username}</strong></p>`;
|
||||
html += `<p><a href="https://www.openstreetmap.org/user/${this.username}" target="_blank">View OSM Profile</a></p>`;
|
||||
html += `<p><a href="https://www.openstreetmap.org/user/${this.username}" >View OSM Profile</a></p>`;
|
||||
html += `<input type="hidden" id="osmUsername" value="${this.username}">`;
|
||||
html += `<input type="hidden" id="osmUserId" value="${this.userId}">`;
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
} else {
|
||||
html += '<p>Authenticate with your OpenStreetMap account to include your username in reports.</p>';
|
||||
html += `<a href="https://www.openstreetmap.org/oauth2/authorize?client_id=${clientId}&redirect_uri=${redirectUri}&response_type=code&scope=${scope}" class="osm-login-btn">`;
|
||||
html += '<span class="osm-logo"></span>';
|
||||
html += 'Login with OpenStreetMap';
|
||||
|
|
|
@ -82,7 +82,7 @@ button:hover {
|
|||
|
||||
#map {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
height: 100vh;
|
||||
margin-bottom: 15px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<div class="auth-info">
|
||||
<div>
|
||||
<p>Logged in as <strong>{{ osm_username }}</strong></p>
|
||||
<p><a href="https://www.openstreetmap.org/user/{{ osm_username }}" target="_blank">View OSM Profile</a></p>
|
||||
<p><a href="https://www.openstreetmap.org/user/{{ osm_username }}" >View OSM Profile</a></p>
|
||||
<input type="hidden" id="osmUsername" value="{{ osm_username }}">
|
||||
<input type="hidden" id="osmUserId" value="{{ osm_user_id }}">
|
||||
</div>
|
||||
|
@ -441,8 +441,8 @@
|
|||
const resultElement = document.getElementById('result');
|
||||
resultElement.innerHTML += `
|
||||
<p>
|
||||
<a href="/event/${data.id}" target="_blank">View Report on Server</a> |
|
||||
<a href="/demo/view-events" target="_blank">View Saved Reports</a> |
|
||||
<a href="/event/${data.id}" >View Report on Server</a> |
|
||||
<a href="/demo/view-events" >View Saved Reports</a> |
|
||||
<a href="/demo">Back to Map</a>
|
||||
</p>`;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue