forked from orson/bachemap
fixed pin deleter, started fixing popup font
This commit is contained in:
parent
1b5df190ff
commit
96a866d58a
6
app.py
6
app.py
@ -174,8 +174,10 @@ def create_app():
|
|||||||
@app.route("/remove_pin/<pin_id>")
|
@app.route("/remove_pin/<pin_id>")
|
||||||
@login_required
|
@login_required
|
||||||
def remove_pin(pin_id):
|
def remove_pin(pin_id):
|
||||||
actual_pin = mongo.db.pins.find_one({"_id": pin_id})
|
actual_pin = mongo.db.pins.find_one({"_id": ObjectId(pin_id)})
|
||||||
added_by = actual_pin.added_by
|
print(actual_pin)
|
||||||
|
added_by = actual_pin.get("added_by")
|
||||||
|
print(added_by)
|
||||||
if not current_user.is_admin or current_user.id != added_by:
|
if not current_user.is_admin or current_user.id != added_by:
|
||||||
return redirect(url_for('index'))
|
return redirect(url_for('index'))
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -111,7 +111,7 @@ nav {
|
|||||||
|
|
||||||
nav {
|
nav {
|
||||||
padding: 12px; /* Increased padding for easier interaction */
|
padding: 12px; /* Increased padding for easier interaction */
|
||||||
font-size: 1.3rem; /* Increased font size for readability */
|
font-size: 1.2rem; /* Increased font size for readability */
|
||||||
}
|
}
|
||||||
|
|
||||||
i.fa, i.far, i.fas {
|
i.fa, i.far, i.fas {
|
||||||
@ -127,7 +127,7 @@ nav {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"], input[type="password"], input[type="email"], textarea {
|
input[type="text"], input[type="password"], input[type="email"], textarea {
|
||||||
font-size: 1.1rem; /* Ensure input text is readable */
|
font-size: 1.4rem; /* Ensure input text is readable */
|
||||||
padding: 12px; /* Comfortable padding for touch input */
|
padding: 12px; /* Comfortable padding for touch input */
|
||||||
border-radius: 5px; /* Slight rounding for aesthetic consistency */
|
border-radius: 5px; /* Slight rounding for aesthetic consistency */
|
||||||
}
|
}
|
||||||
@ -144,8 +144,13 @@ nav {
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.leaflet-popup-content {
|
div.leaflet-pane div.leaflet-popup div.leaflet-popup-content-wrapper div.leaflet-popup-content {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
|
font-size: 2rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.leaflet-popup-content {
|
||||||
|
background-color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.pinner-modal {
|
div.pinner-modal {
|
||||||
@ -157,23 +162,23 @@ nav {
|
|||||||
|
|
||||||
nav {
|
nav {
|
||||||
padding: 20px; /* Larger padding for tappable navigation */
|
padding: 20px; /* Larger padding for tappable navigation */
|
||||||
font-size: 1.5rem; /* Increased font size for readability */
|
font-size: 1.4rem !important; /* Increased font size for readability */
|
||||||
}
|
}
|
||||||
|
|
||||||
.fa, .far, .fas {
|
.fa, .far, .fas {
|
||||||
font-size: 2.2rem; /* Larger icons for touch interactions */
|
font-size: 2.2rem !important; /* Larger icons for touch interactions */
|
||||||
margin-left: -10px;
|
margin-left: -10px;
|
||||||
margin-top: -10px;
|
margin-top: -10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
padding: 18px 30px; /* Large buttons for touch interaction */
|
padding: 18px 30px; /* Large buttons for touch interaction */
|
||||||
font-size: 1.4rem; /* Increased font size for readability */
|
font-size: 1.6rem !important; /* Increased font size for readability */
|
||||||
border-radius: 10px; /* Rounded corners for modern design */
|
border-radius: 10px; /* Rounded corners for modern design */
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"], input[type="password"], input[type="email"], textarea {
|
input[type="text"], input[type="password"], input[type="email"], textarea {
|
||||||
font-size: 1.2rem; /* Larger input text for readability */
|
font-size: 1.6rem !important; /* Larger input text for readability */
|
||||||
padding: 15px; /* More padding for ease of input */
|
padding: 15px; /* More padding for ease of input */
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,4 +75,17 @@
|
|||||||
pinner_button_top.addEventListener('click', toggleSlide);
|
pinner_button_top.addEventListener('click', toggleSlide);
|
||||||
observer.observe(document.body, { childList: true, subtree: true });
|
observer.observe(document.body, { childList: true, subtree: true });
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
// Wait until the entire page is fully loaded
|
||||||
|
window.addEventListener('load', function() {
|
||||||
|
const link = document.querySelector("link[rel='stylesheet'][href='{{ url_for('static', filename='styles.css') }}']");
|
||||||
|
if (link) {
|
||||||
|
const newLink = link.cloneNode();
|
||||||
|
link.remove();
|
||||||
|
document.head.appendChild(newLink);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -37,6 +37,10 @@
|
|||||||
<td>Tipo de mejora urbana</td>
|
<td>Tipo de mejora urbana</td>
|
||||||
<td>{{ pin.typeofpin }}</td>
|
<td>{{ pin.typeofpin }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Eliminar pin</td>
|
||||||
|
<td><a href="/remove_pin/{{pin._id}}"><button type="submit" formmethod="get">Eliminar</button></a></td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,11 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
attribution: '© OpenStreetMap contributors'
|
attribution: '© OpenStreetMap contributors',
|
||||||
|
detectRetina: true,
|
||||||
|
tileSize: 256,
|
||||||
|
maxZoom: 19,
|
||||||
|
maxNativeZoom: 18,
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
|
|
||||||
@ -44,7 +48,7 @@
|
|||||||
// Add a circle around the user's location
|
// Add a circle around the user's location
|
||||||
user_radial = L.circle(e.latlng, radius).addTo(map);
|
user_radial = L.circle(e.latlng, radius).addTo(map);
|
||||||
// Center the map on the user's location
|
// Center the map on the user's location
|
||||||
map.setView(e.latlng, 16); // Adjust zoom level as needed
|
map.setView(e.latlng, 18); // Adjust zoom level as needed
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error handling for geolocation
|
// Error handling for geolocation
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html data-theme="light" lang="en" style="background-color: rgb(205, 243, 148); color: black;">
|
<html data-theme="light" lang="es" style="background-color: rgb(205, 243, 148); color: black;">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Interactive Map</title>
|
<title>Interactive Map</title>
|
||||||
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body style="background-color: rgb(205, 243, 148); color: black;overflow-y: scroll;">
|
<body style="background-color: rgb(205, 243, 148); color: black;overflow-y: scroll;">
|
||||||
<nav style="z-index: 500; height: 7vh;">
|
<nav style="z-index: 500; height: 7vh; position:relative">
|
||||||
<ul>
|
<ul>
|
||||||
<a href="/"><li><h2>El Bachemapa</h2></li></a>
|
<a href="/"><li><h2>El Bachemapa</h2></li></a>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user