From dfab76692ba38f9cde82d840deb8c53c246ff8d3 Mon Sep 17 00:00:00 2001 From: Linnea Date: Fri, 22 May 2026 13:38:13 -0700 Subject: [PATCH 1/7] add territories struct --- Cargo.lock | 1 + Cargo.toml | 4 +++- src/data.rs | 56 +++++++++++++++++++++++++++++++++++++++++++++++- src/db.rs | 7 +----- src/geo_utils.rs | 39 ++++++++++++++++++++++++++++++++- src/main.rs | 22 ++++++++++++++++++- 6 files changed, 119 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 215b998..4d02117 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1487,6 +1487,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "133c182a6a2c87864fe97778797e46c7e999672690dc9fa3ee8e241aa4a9c13f" dependencies = [ + "cc", "pkg-config", "vcpkg", ] diff --git a/Cargo.toml b/Cargo.toml index e7848e3..b015113 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ geojson = "0.24.2" r2d2 = "0.8.10" r2d2_sqlite = "0.31.0" reqwest = "0.12.24" -rusqlite = "0.37.0" +rusqlite = {version="0.37.0", features=["bundled"]} serde = { version = "1.0", features = ["derive"] } serde_json = "1.0.145" tera = "1.20.1" @@ -25,3 +25,5 @@ xml = "1.1.0" [dev-dependencies] tempfile = "3.8" + +#libsqlite3-sys = { version = "0.18", features = ["bundled"]} \ No newline at end of file diff --git a/src/data.rs b/src/data.rs index 0f336f7..d9436c1 100644 --- a/src/data.rs +++ b/src/data.rs @@ -1,5 +1,7 @@ +use crate::geo_utils::GeoUtils; use serde::{Deserialize, Serialize}; use std::collections::HashMap; + #[derive(Debug, Clone, Deserialize, Serialize)] pub struct Player { pub username: String, @@ -10,7 +12,7 @@ pub struct Team { pub name: String, pub color: String, pub players: Vec, - pub scores: HashMap, + pub scores: HashMap, // neighborhood to number of valid changes } #[derive(Debug, Clone, Deserialize, Serialize)] @@ -19,6 +21,58 @@ pub struct Game { pub teams: Vec, pub start_time: String, pub end_time: String, + pub territories: Vec, +} + +impl Game { + fn build_territories(&mut self, geoutils: &GeoUtils) { + let territory_names = geoutils.get_all_territories(); + for name in territory_names { + let t: Territory = Territory { + territory_name: name, + claiming_team: None, + claiming_score: 0, + }; + self.territories.push(t); + } + } + + pub fn new(code: String, teams: Vec, start_time: String, end_time: String) -> Self { + let geoutils = GeoUtils::new(); + let mut game = Game { + code: code, + teams: teams, + start_time: start_time, + end_time: end_time, + territories: vec![], + }; + game.build_territories(&geoutils); + game + } + + pub fn update_territories(&mut self) { + for territory in &mut self.territories { + let mut max_team: (Option, i32) = (None, 0); + for team in &self.teams { + let score = team.scores.get(&territory.territory_name).unwrap_or(&0); + if *score > max_team.1 { + max_team = (Some(team.clone()), *score); + } else if *score > 0 && *score == max_team.1 { + // Tie doesn't count + max_team = (None, max_team.1); + } + } + territory.claiming_team = max_team.0; + territory.claiming_score = max_team.1; + } + } +} + +#[derive(Debug, Clone, Deserialize, Serialize)] +pub struct Territory { + pub territory_name: String, + pub claiming_team: Option, + pub claiming_score: i32, } impl Team { diff --git a/src/db.rs b/src/db.rs index be0cdaa..1c3f13c 100644 --- a/src/db.rs +++ b/src/db.rs @@ -66,12 +66,7 @@ fn get_all_games(conn: Connection, all_teams: HashMap) -> GamesRes .map(|part| all_teams.get(&format!("{game_name}_{part}")).unwrap()) .map(|part| part.to_owned()) .collect(); - Game { - code: game_name, - teams, - start_time: games_row.get(2)?, - end_time: games_row.get(3)?, - } + Game::new(game_name, teams, games_row.get(2)?, games_row.get(3)?) }) }) .and_then(Iterator::collect) diff --git a/src/geo_utils.rs b/src/geo_utils.rs index 4cbe00d..0f4b990 100644 --- a/src/geo_utils.rs +++ b/src/geo_utils.rs @@ -28,7 +28,17 @@ impl GeoUtils { FeatureCollection::try_from(geojson).unwrap() } - pub fn get_feature_collection_copy(self) -> FeatureCollection { + pub fn get_all_territories(&self) -> Vec { + let mut territory_names: Vec = vec![]; + for feature in self.feature_collection.clone() { + let name = feature.property("S_HOOD").unwrap_or_default(); + let name = name.as_str().unwrap_or("unknown"); + territory_names.push(String::from(name)); + } + territory_names + } + + pub fn get_feature_collection_copy(&self) -> FeatureCollection { self.feature_collection.clone() } @@ -57,6 +67,33 @@ impl GeoUtils { copy } + // pub fn get_number_neighborhoods(self, teams : Vec) -> HashMap { + // // new dicts of {team_name: number_claimed_neighborhoods} + // let team_to_score = HashMap::new(); + // let mut copy = self.feature_collection.clone(); + // for feature in &mut copy.features { + // let name = feature.property("S_HOOD").unwrap_or_default(); + // let name = name.as_str().unwrap_or("unknown"); + // let mut max_team: (Option, i32) = (None, 0); + // for team in &teams { + // let score = team.scores.get(name).unwrap_or(&0); + // if *score > max_team.1 { + // max_team = (Some(team.clone()), *score); + // } else if *score > 0 && *score == max_team.1 { + // // Tie doesn't count + // max_team = (None, 0); + // } + // } + // match max_team.0 { + // None => println!("No team has claimed this neighborhood: {name}"), + // Some(c) => { + // team_to_score.entry(c).and_modify(|val| *val+=1).or_insert(1); + // } + // } + // } + // team_to_score + // } + pub fn get_territory_for(self, point: geo_types::Point) -> String { let feature_collection: FeatureCollection = self.get_feature_collection_copy(); for feature in feature_collection { diff --git a/src/main.rs b/src/main.rs index d94eda9..54ae841 100644 --- a/src/main.rs +++ b/src/main.rs @@ -131,6 +131,24 @@ async fn legend_data( .body("{}") } +#[get("/territories/{game_code}")] +async fn get_territories( + game_code: web::Path, + games_actor: web::Data>, +) -> impl Responder { + if let Ok(Responses::GamesResult(games)) = games_actor.send(Messages::GetGames).await + && let Some(game) = games.iter().find(|g| g.code == *game_code) + { + println!("{0:?}", game); + return HttpResponse::Ok() + .content_type("application/json") + .body(serde_json::to_string(&game.territories).unwrap()); + } + HttpResponse::InternalServerError() + .content_type("application/json") + .body("{}") +} + #[get("/geojson/{game_code}")] async fn geojson_endpoint( game_code: web::Path, @@ -198,7 +216,7 @@ async fn main() -> std::io::Result<()> { let games = db::games(&pool) .await .expect("retirieving games from db should work fine"); - let state = Arc::new(Mutex::new(games)); + let state = Arc::new(Mutex::new(games.clone())); let actor_addr = GamesActor { games: state.clone(), } @@ -215,6 +233,7 @@ async fn main() -> std::io::Result<()> { .service(admin) .service(admin_query) .service(list_of_games) + .service(get_territories) }) .bind(("0.0.0.0", 8080))? .run() @@ -266,6 +285,7 @@ async fn update_scores(games: Vec) -> Result, Box> { team.add_scores(&territory_scores); } } + neogame.update_territories(); result.push(neogame); } Ok(result) -- 2.49.0 From eb4a2e04d636364e2738c619cff45bf0d234e994 Mon Sep 17 00:00:00 2001 From: Linnea Date: Sat, 23 May 2026 18:38:08 -0700 Subject: [PATCH 2/7] wip: territories on map --- src/main.rs | 29 +++++++++++- src/templates/map.html.tera | 90 +++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 src/templates/map.html.tera diff --git a/src/main.rs b/src/main.rs index 54ae841..6f88495 100644 --- a/src/main.rs +++ b/src/main.rs @@ -149,6 +149,32 @@ async fn get_territories( .body("{}") } +// Get the Territory info for a specific territory name? +#[get("/territories/{game_code}/{name}")] +async fn get_territory( + path: web::Path<(String, String)>, + games_actor: web::Data>, +) -> impl Responder { + let (game_code, name) = path.into_inner(); + if let Ok(Responses::GamesResult(games)) = games_actor.send(Messages::GetGames).await + && let Some(game) = games.iter().find(|g| g.code == *game_code) { + let territories = &game.territories; + for t in territories { + println!("Search term {name} vs. {0}", t.territory_name); + if t.territory_name == *name { + println!("{0:?}", t); + return HttpResponse::Ok() + .content_type("application/json") + .body(serde_json::to_string(&t).unwrap()); + } + } + } + HttpResponse::InternalServerError() + .content_type("application/json") + .body("{}") +} + + #[get("/geojson/{game_code}")] async fn geojson_endpoint( game_code: web::Path, @@ -173,7 +199,7 @@ async fn geojson_endpoint( async fn game_page(game_code: web::Path) -> impl Responder { let mut context = Context::new(); context.insert("game_code", game_code.as_str()); - let body = Tera::one_off(include_str!("templates/map.tera"), &context, false) + let body = Tera::one_off(include_str!("templates/map.html.tera"), &context, false) .expect("Failed to render template"); HttpResponse::Ok().body(body) } @@ -234,6 +260,7 @@ async fn main() -> std::io::Result<()> { .service(admin_query) .service(list_of_games) .service(get_territories) + .service(get_territory) }) .bind(("0.0.0.0", 8080))? .run() diff --git a/src/templates/map.html.tera b/src/templates/map.html.tera new file mode 100644 index 0000000..31b3983 --- /dev/null +++ b/src/templates/map.html.tera @@ -0,0 +1,90 @@ + + + + {{ game_code }} + + + + + +
+
    + + + \ No newline at end of file -- 2.49.0 From d5bf7183c6677d366df9c2feea6c16a7fce3fc7d Mon Sep 17 00:00:00 2001 From: Linnea Date: Sat, 23 May 2026 21:29:50 -0700 Subject: [PATCH 3/7] wip: get popup --- src/data.rs | 11 +++++- src/geo_utils.rs | 56 ++++++-------------------- src/main.rs | 4 +- src/templates/map.html.tera | 11 +++++- src/templates/map.tera | 79 ------------------------------------- 5 files changed, 32 insertions(+), 129 deletions(-) delete mode 100644 src/templates/map.tera diff --git a/src/data.rs b/src/data.rs index d9436c1..a00add8 100644 --- a/src/data.rs +++ b/src/data.rs @@ -1,5 +1,6 @@ use crate::geo_utils::GeoUtils; use serde::{Deserialize, Serialize}; +use geojson::{Feature}; use std::collections::HashMap; #[derive(Debug, Clone, Deserialize, Serialize)] @@ -27,11 +28,16 @@ pub struct Game { impl Game { fn build_territories(&mut self, geoutils: &GeoUtils) { let territory_names = geoutils.get_all_territories(); - for name in territory_names { + let territory_json = geoutils.get_feature_collection_copy(); + for feature in &territory_json.features { + let feat: Feature = feature.clone(); + let name = feature.property("S_HOOD").unwrap_or_default(); + let name = name.as_str().unwrap_or("unknown"); let t: Territory = Territory { - territory_name: name, + territory_name: String::from(name), claiming_team: None, claiming_score: 0, + territory_feature:feat, }; self.territories.push(t); } @@ -73,6 +79,7 @@ pub struct Territory { pub territory_name: String, pub claiming_team: Option, pub claiming_score: i32, + pub territory_feature: Feature, } impl Team { diff --git a/src/geo_utils.rs b/src/geo_utils.rs index 0f4b990..b83b81d 100644 --- a/src/geo_utils.rs +++ b/src/geo_utils.rs @@ -1,9 +1,9 @@ -use crate::Team; use geo as geo_types; use geo::algorithm::contains::Contains; use geojson::{FeatureCollection, GeoJson, Geometry, Value}; use std::convert::TryFrom; use std::fs; +use crate::data::{Game, Territory}; pub struct GeoUtils { feature_collection: FeatureCollection, @@ -42,58 +42,28 @@ impl GeoUtils { self.feature_collection.clone() } - pub fn get_colored_collection_copy(self, teams: Vec) -> FeatureCollection { + pub fn get_colored_collection_copy(self, game: &Game) -> FeatureCollection { let mut copy = self.feature_collection.clone(); for feature in &mut copy.features { let name = feature.property("S_HOOD").unwrap_or_default(); let name = name.as_str().unwrap_or("unknown"); - let mut max_team: (Option, i32) = (None, 0); - for team in &teams { - let score = team.scores.get(name).unwrap_or(&0); - if *score > max_team.1 { - max_team = (Some(team.color.clone()), *score); - } else if *score > 0 && *score == max_team.1 { - // Tie doesn't count - max_team = (None, 0); - } - } - match max_team.0 { - None => feature.set_property("color", "#888888ff"), - Some(c) => { - feature.set_property("color", c); + // TODO: Make the territories field of Game struct to be a hashmap + let this_territory : Territory = game.territories.clone().iter().find(|t| t.territory_name == *name) + .expect("somehow the territory wasn't found").clone(); + match this_territory.claiming_team { + Some(team) => { + feature.set_property("color", team.color.clone()); + feature.set_property("claiming_team", team.name.clone()); + } + None => { + feature.set_property("color", "#888888ff"); } } + feature.set_property("claiming_score", this_territory.claiming_score); } copy } - // pub fn get_number_neighborhoods(self, teams : Vec) -> HashMap { - // // new dicts of {team_name: number_claimed_neighborhoods} - // let team_to_score = HashMap::new(); - // let mut copy = self.feature_collection.clone(); - // for feature in &mut copy.features { - // let name = feature.property("S_HOOD").unwrap_or_default(); - // let name = name.as_str().unwrap_or("unknown"); - // let mut max_team: (Option, i32) = (None, 0); - // for team in &teams { - // let score = team.scores.get(name).unwrap_or(&0); - // if *score > max_team.1 { - // max_team = (Some(team.clone()), *score); - // } else if *score > 0 && *score == max_team.1 { - // // Tie doesn't count - // max_team = (None, 0); - // } - // } - // match max_team.0 { - // None => println!("No team has claimed this neighborhood: {name}"), - // Some(c) => { - // team_to_score.entry(c).and_modify(|val| *val+=1).or_insert(1); - // } - // } - // } - // team_to_score - // } - pub fn get_territory_for(self, point: geo_types::Point) -> String { let feature_collection: FeatureCollection = self.get_feature_collection_copy(); for feature in feature_collection { diff --git a/src/main.rs b/src/main.rs index 6f88495..f2f930e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,7 +139,6 @@ async fn get_territories( if let Ok(Responses::GamesResult(games)) = games_actor.send(Messages::GetGames).await && let Some(game) = games.iter().find(|g| g.code == *game_code) { - println!("{0:?}", game); return HttpResponse::Ok() .content_type("application/json") .body(serde_json::to_string(&game.territories).unwrap()); @@ -183,9 +182,8 @@ async fn geojson_endpoint( if let Ok(Responses::GamesResult(games)) = games_actor.send(Messages::GetGames).await && let Some(game) = games.iter().find(|g| g.code == *game_code) { - let teams = &game.teams; let utils = geo_utils::GeoUtils::new(); - let feature_collection = utils.get_colored_collection_copy(teams.to_vec()); + let feature_collection = utils.get_colored_collection_copy(&game); return HttpResponse::Ok() .content_type("application/json") .body(serde_json::to_string(&feature_collection).unwrap()); diff --git a/src/templates/map.html.tera b/src/templates/map.html.tera index 31b3983..13d033c 100644 --- a/src/templates/map.html.tera +++ b/src/templates/map.html.tera @@ -36,8 +36,13 @@ function onEachFeature(feature, layer) { // bind a popup to each geojson element // does this feature have a property named popupContent? + if (feature.properties) { - layer.bindPopup(feature.properties.S_HOOD); + const popup = document.createElement("p"); + popup.textContent += feature.properties.S_HOOD; + popup.textContent += "\nTeam: " + feature.properties.claiming_team; + popup.textContent += "\nScore: " + feature.properties.claiming_score; + layer.bindPopup(popup); } } @@ -48,7 +53,9 @@ fetch('/geojson/{{game_code}}') .then(res => res.json()) - .then(data => L.geoJSON(data, {style: style, onEachFeature : onEachFeature}).addTo(map)); + .then(data => { + L.geoJSON(data, {style: style, onEachFeature : onEachFeature}).addTo(map) + }); // // const endpoint = "/legend-data/{{game_code}}"; diff --git a/src/templates/map.tera b/src/templates/map.tera deleted file mode 100644 index 92c5a94..0000000 --- a/src/templates/map.tera +++ /dev/null @@ -1,79 +0,0 @@ - - - - {{ game_code }} - - - - - -
    -
      - - - \ No newline at end of file -- 2.49.0 From 35327c6d4b4fd56d97a38f08151e21d937e1c2fc Mon Sep 17 00:00:00 2001 From: Linnea Date: Sat, 23 May 2026 22:07:57 -0700 Subject: [PATCH 4/7] Popup with claimed territory info! --- src/data.rs | 13 ++++--------- src/geo_utils.rs | 28 ++++++++++------------------ src/main.rs | 27 --------------------------- src/templates/map.html.tera | 8 ++++---- 4 files changed, 18 insertions(+), 58 deletions(-) diff --git a/src/data.rs b/src/data.rs index a00add8..73923e1 100644 --- a/src/data.rs +++ b/src/data.rs @@ -1,6 +1,5 @@ use crate::geo_utils::GeoUtils; use serde::{Deserialize, Serialize}; -use geojson::{Feature}; use std::collections::HashMap; #[derive(Debug, Clone, Deserialize, Serialize)] @@ -22,24 +21,21 @@ pub struct Game { pub teams: Vec, pub start_time: String, pub end_time: String, - pub territories: Vec, + pub territories: HashMap, // territory name/id to struct } impl Game { fn build_territories(&mut self, geoutils: &GeoUtils) { - let territory_names = geoutils.get_all_territories(); let territory_json = geoutils.get_feature_collection_copy(); for feature in &territory_json.features { - let feat: Feature = feature.clone(); let name = feature.property("S_HOOD").unwrap_or_default(); let name = name.as_str().unwrap_or("unknown"); let t: Territory = Territory { territory_name: String::from(name), claiming_team: None, claiming_score: 0, - territory_feature:feat, }; - self.territories.push(t); + self.territories.insert(name.to_string(), t); } } @@ -50,14 +46,14 @@ impl Game { teams: teams, start_time: start_time, end_time: end_time, - territories: vec![], + territories: HashMap::new(), }; game.build_territories(&geoutils); game } pub fn update_territories(&mut self) { - for territory in &mut self.territories { + for (_, territory) in &mut self.territories { let mut max_team: (Option, i32) = (None, 0); for team in &self.teams { let score = team.scores.get(&territory.territory_name).unwrap_or(&0); @@ -79,7 +75,6 @@ pub struct Territory { pub territory_name: String, pub claiming_team: Option, pub claiming_score: i32, - pub territory_feature: Feature, } impl Team { diff --git a/src/geo_utils.rs b/src/geo_utils.rs index b83b81d..35685cc 100644 --- a/src/geo_utils.rs +++ b/src/geo_utils.rs @@ -1,9 +1,9 @@ +use crate::data::{Game, Territory}; use geo as geo_types; use geo::algorithm::contains::Contains; use geojson::{FeatureCollection, GeoJson, Geometry, Value}; use std::convert::TryFrom; use std::fs; -use crate::data::{Game, Territory}; pub struct GeoUtils { feature_collection: FeatureCollection, @@ -28,16 +28,6 @@ impl GeoUtils { FeatureCollection::try_from(geojson).unwrap() } - pub fn get_all_territories(&self) -> Vec { - let mut territory_names: Vec = vec![]; - for feature in self.feature_collection.clone() { - let name = feature.property("S_HOOD").unwrap_or_default(); - let name = name.as_str().unwrap_or("unknown"); - territory_names.push(String::from(name)); - } - territory_names - } - pub fn get_feature_collection_copy(&self) -> FeatureCollection { self.feature_collection.clone() } @@ -47,16 +37,18 @@ impl GeoUtils { for feature in &mut copy.features { let name = feature.property("S_HOOD").unwrap_or_default(); let name = name.as_str().unwrap_or("unknown"); - // TODO: Make the territories field of Game struct to be a hashmap - let this_territory : Territory = game.territories.clone().iter().find(|t| t.territory_name == *name) - .expect("somehow the territory wasn't found").clone(); - match this_territory.claiming_team { - Some(team) => { + let this_territory: Territory = game + .territories + .get(name) + .expect("Whaaa no territory found!") + .clone(); + match this_territory.claiming_team.clone() { + Some(team) => { feature.set_property("color", team.color.clone()); feature.set_property("claiming_team", team.name.clone()); } - None => { - feature.set_property("color", "#888888ff"); + None => { + feature.set_property("color", "#888888ff"); } } feature.set_property("claiming_score", this_territory.claiming_score); diff --git a/src/main.rs b/src/main.rs index f2f930e..7616931 100644 --- a/src/main.rs +++ b/src/main.rs @@ -148,32 +148,6 @@ async fn get_territories( .body("{}") } -// Get the Territory info for a specific territory name? -#[get("/territories/{game_code}/{name}")] -async fn get_territory( - path: web::Path<(String, String)>, - games_actor: web::Data>, -) -> impl Responder { - let (game_code, name) = path.into_inner(); - if let Ok(Responses::GamesResult(games)) = games_actor.send(Messages::GetGames).await - && let Some(game) = games.iter().find(|g| g.code == *game_code) { - let territories = &game.territories; - for t in territories { - println!("Search term {name} vs. {0}", t.territory_name); - if t.territory_name == *name { - println!("{0:?}", t); - return HttpResponse::Ok() - .content_type("application/json") - .body(serde_json::to_string(&t).unwrap()); - } - } - } - HttpResponse::InternalServerError() - .content_type("application/json") - .body("{}") -} - - #[get("/geojson/{game_code}")] async fn geojson_endpoint( game_code: web::Path, @@ -258,7 +232,6 @@ async fn main() -> std::io::Result<()> { .service(admin_query) .service(list_of_games) .service(get_territories) - .service(get_territory) }) .bind(("0.0.0.0", 8080))? .run() diff --git a/src/templates/map.html.tera b/src/templates/map.html.tera index 13d033c..82bdaf9 100644 --- a/src/templates/map.html.tera +++ b/src/templates/map.html.tera @@ -38,10 +38,10 @@ // does this feature have a property named popupContent? if (feature.properties) { - const popup = document.createElement("p"); - popup.textContent += feature.properties.S_HOOD; - popup.textContent += "\nTeam: " + feature.properties.claiming_team; - popup.textContent += "\nScore: " + feature.properties.claiming_score; + var popup = document.createElement("div"); + popup.innerHTML += feature.properties.S_HOOD; + popup.innerHTML += "
      Team: " + feature.properties.claiming_team; + popup.innerHTML += "
      Score: " + feature.properties.claiming_score; layer.bindPopup(popup); } } -- 2.49.0 From 417dbfb1c1447c2e53daa6f6718a7008af4a384c Mon Sep 17 00:00:00 2001 From: Linnea Date: Sat, 23 May 2026 22:09:22 -0700 Subject: [PATCH 5/7] fine I'll keep the current name --- src/templates/{map.html.tera => map.tera} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/templates/{map.html.tera => map.tera} (100%) diff --git a/src/templates/map.html.tera b/src/templates/map.tera similarity index 100% rename from src/templates/map.html.tera rename to src/templates/map.tera -- 2.49.0 From 436debc0cefbb296bb8908803131794cb865305d Mon Sep 17 00:00:00 2001 From: Linnea Date: Sat, 23 May 2026 22:13:43 -0700 Subject: [PATCH 6/7] merge --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ad3e1cd..d72edb0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,7 +171,7 @@ async fn geojson_endpoint( async fn game_page(game_code: web::Path) -> impl Responder { let mut context = Context::new(); context.insert("game_code", game_code.as_str()); - let body = Tera::one_off(include_str!("templates/map.html.tera"), &context, false) + let body = Tera::one_off(include_str!("templates/map.tera"), &context, false) .expect("Failed to render template"); HttpResponse::Ok().body(body) } -- 2.49.0 From e49ab790cd36d1dec70d26360df95cf88e6baa17 Mon Sep 17 00:00:00 2001 From: Linnea Date: Sat, 23 May 2026 22:16:23 -0700 Subject: [PATCH 7/7] woops --- Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b015113..290857c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,5 +25,3 @@ xml = "1.1.0" [dev-dependencies] tempfile = "3.8" - -#libsqlite3-sys = { version = "0.18", features = ["bundled"]} \ No newline at end of file -- 2.49.0