From 96a866d58a60bdd1d5533cbe76acfcc1254dba87 Mon Sep 17 00:00:00 2001 From: "O. D." Date: Tue, 3 Sep 2024 14:22:02 -0600 Subject: [PATCH] fixed pin deleter, started fixing popup font --- app.py | 6 ++++-- static/styles.css | 19 ++++++++++++------- templates/base.html | 13 +++++++++++++ templates/dashboard.html | 4 ++++ templates/index.html | 8 ++++++-- templates/secondbase.html | 4 ++-- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/app.py b/app.py index 91ff654..112bf15 100644 --- a/app.py +++ b/app.py @@ -174,8 +174,10 @@ def create_app(): @app.route("/remove_pin/") @login_required def remove_pin(pin_id): - actual_pin = mongo.db.pins.find_one({"_id": pin_id}) - added_by = actual_pin.added_by + actual_pin = mongo.db.pins.find_one({"_id": ObjectId(pin_id)}) + 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: return redirect(url_for('index')) else: diff --git a/static/styles.css b/static/styles.css index 9b6a996..97d5128 100644 --- a/static/styles.css +++ b/static/styles.css @@ -111,7 +111,7 @@ nav { nav { 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 { @@ -127,7 +127,7 @@ nav { } 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 */ border-radius: 5px; /* Slight rounding for aesthetic consistency */ } @@ -144,8 +144,13 @@ nav { padding: 15px; } - div.leaflet-popup-content { + div.leaflet-pane div.leaflet-popup div.leaflet-popup-content-wrapper div.leaflet-popup-content { width: 90%; + font-size: 2rem !important; + } + + div.leaflet-popup-content { + background-color: red; } div.pinner-modal { @@ -157,23 +162,23 @@ nav { nav { 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 { - font-size: 2.2rem; /* Larger icons for touch interactions */ + font-size: 2.2rem !important; /* Larger icons for touch interactions */ margin-left: -10px; margin-top: -10px; } button { 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 */ } 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 */ border-radius: 5px; } diff --git a/templates/base.html b/templates/base.html index 2a7a460..b46ee13 100644 --- a/templates/base.html +++ b/templates/base.html @@ -75,4 +75,17 @@ pinner_button_top.addEventListener('click', toggleSlide); observer.observe(document.body, { childList: true, subtree: true }); + + diff --git a/templates/dashboard.html b/templates/dashboard.html index a5dd2df..2260e8b 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -37,6 +37,10 @@ Tipo de mejora urbana {{ pin.typeofpin }} + + Eliminar pin + + diff --git a/templates/index.html b/templates/index.html index 6ccc0a9..38e9e06 100644 --- a/templates/index.html +++ b/templates/index.html @@ -31,7 +31,11 @@ {% endfor %} 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); @@ -44,7 +48,7 @@ // Add a circle around the user's location user_radial = L.circle(e.latlng, radius).addTo(map); // 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 diff --git a/templates/secondbase.html b/templates/secondbase.html index c047e8c..48adfa7 100644 --- a/templates/secondbase.html +++ b/templates/secondbase.html @@ -1,5 +1,5 @@ - + Interactive Map @@ -9,7 +9,7 @@ -