From 6b804724b42af45120656a095d9d9f2d6d20b4c0 Mon Sep 17 00:00:00 2001 From: ajuvercr Date: Thu, 9 Apr 2020 22:57:12 +0200 Subject: [PATCH] Refactor before it is too late --- backend/src/main.rs | 8 +- backend/src/{ => routes}/info.rs | 10 +- backend/src/{routes.rs => routes/lobby.rs} | 223 ++++++++++-------- backend/src/routes/maps.rs | 50 ++++ backend/src/routes/mod.rs | 82 +++++++ backend/src/util.rs | 167 +++---------- .../templates/{help => info}/base.html.tera | 2 +- .../info_1.html.tera} | 4 +- .../info_2.html.tera} | 4 +- .../info_3.html.tera} | 4 +- .../info_4.html.tera} | 4 +- .../info_5.html.tera} | 4 +- .../info_6.html.tera} | 4 +- 13 files changed, 312 insertions(+), 254 deletions(-) rename backend/src/{ => routes}/info.rs (65%) rename backend/src/{routes.rs => routes/lobby.rs} (50%) create mode 100644 backend/src/routes/maps.rs create mode 100644 backend/src/routes/mod.rs rename backend/templates/{help => info}/base.html.tera (95%) rename backend/templates/{help/help_1.html.tera => info/info_1.html.tera} (93%) rename backend/templates/{help/help_2.html.tera => info/info_2.html.tera} (92%) rename backend/templates/{help/help_3.html.tera => info/info_3.html.tera} (95%) rename backend/templates/{help/help_4.html.tera => info/info_4.html.tera} (95%) rename backend/templates/{help/help_5.html.tera => info/info_5.html.tera} (92%) rename backend/templates/{help/help_6.html.tera => info/info_6.html.tera} (92%) diff --git a/backend/src/main.rs b/backend/src/main.rs index 9de4ac1..b8c92a6 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -33,7 +33,6 @@ use futures::future::FutureExt; use mozaic::graph; use mozaic::modules::*; -mod info; mod planetwars; mod routes; mod util; @@ -45,6 +44,8 @@ use rocket_contrib::templates::tera::{self, Value}; use std::collections::HashMap; +/// Calculate viewbox from array of points (used in map preview), added to Tera engine. +/// So this function can be called in template. fn calc_viewbox(value: Value, _: HashMap) -> tera::Result { let mut min_x = std::f64::MAX; let mut min_y = std::f64::MAX; @@ -62,10 +63,12 @@ fn calc_viewbox(value: Value, _: HashMap) -> tera::Result return Ok(Value::String(format!("{} {} {} {}", min_x - 3., min_y - 3., (max_x - min_x) + 6., (max_y - min_y) + 6.))); } +/// Get's the right colour for planets fn get_colour(value: Value, _: HashMap) -> tera::Result { return Ok(Value::String(COLOURS[value.as_u64().unwrap_or(0) as usize].to_string())); } +/// Async main function, starting logger, graph and rocket #[async_std::main] async fn main() { let fut = graph::set_default(); @@ -81,7 +84,6 @@ async fn main() { let mut routes = Vec::new(); routes::fuel(&mut routes); - info::fuel(&mut routes); let tera = Template::custom(|engines: &mut Engines| { engines.tera.register_filter("calc_viewbox", calc_viewbox); @@ -98,6 +100,8 @@ async fn main() { .unwrap(); } +/// Creates the actual game_manager +/// Opening tcp socket etc.. async fn create_game_manager(tcp: &str, pool: ThreadPool) -> game::Manager { let addr = tcp.parse::().unwrap(); let (gmb, handle) = game::Manager::builder(pool.clone()); diff --git a/backend/src/info.rs b/backend/src/routes/info.rs similarity index 65% rename from backend/src/info.rs rename to backend/src/routes/info.rs index c09536a..abe4f8d 100644 --- a/backend/src/info.rs +++ b/backend/src/routes/info.rs @@ -7,22 +7,24 @@ use crate::util::*; const MAX: usize = 6; +/// Redirects to the first info page #[get("/info")] -fn help_base() -> Redirect { +fn info_base() -> Redirect { Redirect::to("/info/1") } +/// Renders the info page #[get("/info/")] -async fn help(page: usize) -> Template { +async fn info(page: usize) -> Template { let context = Context::new_with("info", json!({ "page": page, "next": if page + 1 <= MAX { Some(page + 1) } else { None }, "prev": if page - 1 > 0 { Some(page - 1) } else { None } })); - Template::render(format!("help/help_{}", page), &context) + Template::render(format!("info/info_{}", page), &context) } pub fn fuel(routes: &mut Vec) { - routes.extend(routes![help_base, help]); + routes.extend(routes![info_base, info]); } diff --git a/backend/src/routes.rs b/backend/src/routes/lobby.rs similarity index 50% rename from backend/src/routes.rs rename to backend/src/routes/lobby.rs index 5a9e96e..49da614 100644 --- a/backend/src/routes.rs +++ b/backend/src/routes/lobby.rs @@ -1,102 +1,25 @@ - -use serde::{Deserialize}; -use serde_json::Value; - -use rocket::{Route, State}; -use rocket::response::NamedFile; - -use rocket_contrib::templates::Template; -use rocket_contrib::json::Json; - -use async_std::prelude::*; -use async_std::fs; -use async_std::io::ReadExt; - +use crate::planetwars; use crate::util::*; -use std::path::Path; +use rocket::{State, Route}; +use rocket_contrib::json::Json; +use rocket_contrib::templates::Template; -#[get("/", rank = 6)] -async fn files(file: PathBuf) -> Option { - NamedFile::open(Path::new("static/").join(file)).ok() -} +use mozaic::modules::types::*; +use mozaic::modules::{game, StepLock}; +use mozaic::util::request::Connect; -#[get("/")] -async fn index() -> Template { - // let context = context(); - let context = Context::new("Home"); - // context.insert("name".to_string(), "Arthur".to_string()); - Template::render("index", &context) -} +use async_std::fs; +use async_std::prelude::StreamExt; -#[derive(Deserialize, Debug)] -struct MapReq { - pub name: String, - pub map: crate::planetwars::Map, -} +use futures::executor::ThreadPool; -use std::path::PathBuf; - -#[post("/maps", data="")] -async fn map_post(map_req: Json) -> Result { - let MapReq { name, map } = map_req.into_inner(); - - let path: PathBuf = PathBuf::from(format!("maps/{}.json", name)); - if path.exists() { - return Err("File already exists!".into()); - } - - let mut file = fs::File::create(path).await.map_err(|_| "IO error".to_string())?; - file.write_all(&serde_json::to_vec_pretty(&map).unwrap()).await.map_err(|_| "IO error".to_string())?; - - Ok("ok".into()) -} - -#[get("/lobby")] -async fn lobby_get(gm: State<'_, game::Manager>, state: State<'_, Games>) -> Result { - let maps = get_maps().await?; - let games = get_states(&state.get_games(), &gm).await?; - let context = Context::new_with("Lobby", Lobby { games, maps }); - Ok(Template::render("lobby", &context)) -} - -#[get("/mapbuilder")] -async fn builder_get() -> Result { - let context = Context::new("Map Builder"); - Ok(Template::render("mapbuilder", &context)) -} - -#[get("/debug")] -async fn debug_get() -> Result { - let context = Context::new("Debug Station"); - Ok(Template::render("debug", &context)) -} - -#[get("/visualizer")] -async fn visualizer_get() -> Template { - let game_options = get_games().await; - let context = Context::new_with("Visualizer", json!({"games": game_options, "colours": COLOURS})); - Template::render("visualizer", &context) -} - -#[get("/maps/")] -async fn map_get(file: String) -> Result { - let mut content = String::new(); - let mut file = fs::File::open(Path::new("maps/").join(file)).await.map_err(|_| "IO ERROR".to_string())?; - file.read_to_string(&mut content).await.map_err(|_| "IO ERROR".to_string())?; - - Ok(Template::render("map_partial", &serde_json::from_str::(&content).unwrap())) -} - -#[get("/partial/state")] -async fn state_get(gm: State<'_, game::Manager>, state: State<'_, Games>) -> Result { - let games = get_states(&state.get_games(), &gm).await?; - let context = Context::new_with("Lobby", Lobby { games, maps: Vec::new() }); - - Ok(Template::render("state_partial", &context)) -} +use serde_json::Value; +use rand::prelude::*; +/// The type required to build a game. +/// (json in POST request). #[derive(Deserialize, Debug)] struct GameReq { nop: u64, @@ -105,15 +28,35 @@ struct GameReq { name: String, } +/// Response when building a game. #[derive(Serialize)] struct GameRes { players: Vec, state: Value, } -use mozaic::util::request::Connect; +/// Standard get function for the lobby tab +#[get("/lobby")] +async fn get_lobby(gm: State<'_, game::Manager>, state: State<'_, Games>) -> Result { + let maps = get_maps().await?; + let games = get_states(&state.get_games(), &gm).await?; + let context = Context::new_with("Lobby", Lobby { games, maps }); + Ok(Template::render("lobby", &context)) +} + +/// The lobby get's this automatically on load and on refresh. +#[get("/partial/state")] +async fn state_get(gm: State<'_, game::Manager>, state: State<'_, Games>) -> Result { + let games = get_states(&state.get_games(), &gm).await?; + let context = Context::new_with("Lobby", Lobby { games, maps: Vec::new() }); + + Ok(Template::render("state_partial", &context)) +} + +/// Post function to create a game. +/// Returns the keys of the players in json. #[post("/lobby", data="")] -async fn game_post(game_req: Json, tp: State<'_, ThreadPool>, gm: State<'_, game::Manager>, state: State<'_, Games>) -> Result, String> { +async fn post_game(game_req: Json, tp: State<'_, ThreadPool>, gm: State<'_, game::Manager>, state: State<'_, Games>) -> Result, String> { let game = build_builder(tp.clone(), game_req.nop, game_req.max_turns, &game_req.map, &game_req.name); let game_id = gm.start_game(game).await.unwrap(); state.add_game(game_req.name.clone(), game_id); @@ -136,17 +79,7 @@ async fn game_post(game_req: Json, tp: State<'_, ThreadPool>, gm: State } } -pub fn fuel(routes: &mut Vec) { - routes.extend(routes![files, index, map_post, map_get, lobby_get, builder_get, visualizer_get, game_post, state_get, debug_get]); -} - - -use crate::planetwars; -use mozaic::modules::types::*; -use mozaic::modules::{game, StepLock}; -use futures::executor::ThreadPool; - -use rand::prelude::*; +/// Generate random ID for the game, used as filename fn generate_string_id() -> String { rand::thread_rng() .sample_iter(&rand::distributions::Alphanumeric) @@ -154,6 +87,8 @@ fn generate_string_id() -> String { .collect::() + ".json" } +/// game::Manager spawns game::Builder to start games. +/// This returns such a Builder for a planetwars game. fn build_builder( pool: ThreadPool, number_of_clients: u64, @@ -176,3 +111,83 @@ fn build_builder( .with_timeout(std::time::Duration::from_secs(1)), ) } + +/// Fuels the lobby routes +pub fn fuel(routes: &mut Vec) { + routes.extend(routes![post_game, get_lobby, state_get]); +} + + +#[derive(Serialize)] +pub struct Lobby { + pub games: Vec, + pub maps: Vec, +} + +#[derive(Serialize)] +pub struct Map { + name: String, + url: String, +} + +async fn get_maps() -> Result, String> { + let mut maps = Vec::new(); + let mut entries = fs::read_dir("maps") + .await + .map_err(|_| "IO error".to_string())?; + while let Some(file) = entries.next().await { + let file = file.map_err(|_| "IO error".to_string())?.path(); + if let Some(stem) = file.file_stem().and_then(|x| x.to_str()) { + maps.push(Map { + name: stem.to_string(), + url: file.to_str().unwrap().to_string(), + }); + } + } + + Ok(maps) +} + +use crate::planetwars::FinishedState; + +use futures::future::{join_all, FutureExt}; +pub async fn get_states( + game_ids: &Vec<(String, u64)>, + manager: &game::Manager, +) -> Result, String> { + let mut states = Vec::new(); + let gss = join_all( + game_ids + .iter() + .cloned() + .map(|(name, id)| manager.get_state(id).map(move |f| (f, name))), + ) + .await; + + for (gs, name) in gss { + if let Some(state) = gs { + match state { + Ok((state, conns)) => { + let players: Vec = + conns.iter().cloned().map(|x| x.into()).collect(); + let connected = players.iter().filter(|x| x.connected).count(); + states.push(GameState::Playing { + name: name, + total: players.len(), + players, + connected, + map: String::new(), + state, + }); + } + Err(value) => { + let state: FinishedState = serde_json::from_value(value).expect("Shit failed"); + states.push(state.into()); + } + } + } + } + + states.sort(); + Ok(states) +} diff --git a/backend/src/routes/maps.rs b/backend/src/routes/maps.rs new file mode 100644 index 0000000..6901aa0 --- /dev/null +++ b/backend/src/routes/maps.rs @@ -0,0 +1,50 @@ +use serde::{Deserialize}; + +use rocket::{Route}; +use rocket_contrib::templates::Template; +use rocket_contrib::json::Json; + +use async_std::prelude::*; +use async_std::fs; +use async_std::io::ReadExt; + +use std::path::{Path, PathBuf}; + +/// The expected body to create a map. +#[derive(Deserialize, Debug)] +struct MapReq { + pub name: String, + pub map: crate::planetwars::Map, +} + +/// Post route to create a map. +#[post("/maps", data="")] +async fn map_post(map_req: Json) -> Result { + let MapReq { name, map } = map_req.into_inner(); + + let path: PathBuf = PathBuf::from(format!("maps/{}.json", name)); + if path.exists() { + return Err("File already exists!".into()); + } + + let mut file = fs::File::create(path).await.map_err(|_| "IO error".to_string())?; + file.write_all(&serde_json::to_vec_pretty(&map).unwrap()).await.map_err(|_| "IO error".to_string())?; + + Ok("ok".into()) +} + +/// Map partial, rendering a map as svg and returning the svg element +/// Used in the lobby page for the map previewer +#[get("/maps/")] +async fn map_get(file: String) -> Result { + let mut content = String::new(); + let mut file = fs::File::open(Path::new("maps/").join(file)).await.map_err(|_| "IO ERROR".to_string())?; + file.read_to_string(&mut content).await.map_err(|_| "IO ERROR".to_string())?; + + Ok(Template::render("map_partial", &serde_json::from_str::(&content).unwrap())) +} + + +pub fn fuel(routes: &mut Vec) { + routes.extend(routes![map_post, map_get]); +} diff --git a/backend/src/routes/mod.rs b/backend/src/routes/mod.rs new file mode 100644 index 0000000..d2bf40a --- /dev/null +++ b/backend/src/routes/mod.rs @@ -0,0 +1,82 @@ +use crate::util::*; +use crate::planetwars::FinishedState; + +use rocket::{Route}; +use rocket::response::NamedFile; +use rocket_contrib::templates::Template; + +use async_std::prelude::*; +use async_std::io::BufReader; +use async_std::fs; + +use futures::stream::StreamExt; + +use std::path::{Path, PathBuf}; + +mod lobby; +mod maps; +mod info; + +/// Handles all files located in the static folder +#[get("/", rank = 6)] +async fn files(file: PathBuf) -> Option { + NamedFile::open(Path::new("static/").join(file)).ok() +} + +/// Routes the index page, rendering the index Template. +#[get("/")] +async fn index() -> Template { + let context = Context::new("Home"); + Template::render("index", &context) +} + +/// Routes the mapbuilder page, rendering the mapbuilder Template. +#[get("/mapbuilder")] +async fn builder_get() -> Result { + let context = Context::new("Map Builder"); + Ok(Template::render("mapbuilder", &context)) +} + +/// Routes the debug page, rendering the debug Template. +#[get("/debug")] +async fn debug_get() -> Result { + let context = Context::new("Debug Station"); + Ok(Template::render("debug", &context)) +} + +/// Routes the visualizer page, rendering the visualizer Template. +#[get("/visualizer")] +async fn visualizer_get() -> Template { + let game_options = get_played_games().await; + let context = Context::new_with("Visualizer", json!({"games": game_options, "colours": COLOURS})); + Template::render("visualizer", &context) +} + +/// Fuels all routes +pub fn fuel(routes: &mut Vec) { + routes.extend(routes![files, index, builder_get, visualizer_get, debug_get]); + lobby::fuel(routes); + maps::fuel(routes); + info::fuel(routes); +} + +/// Reads games.ini +/// File that represents all played games +/// Ready to be visualized +async fn get_played_games() -> Vec { + match fs::File::open("games.ini").await { + Ok(file) => { + let file = BufReader::new(file); + file.lines() + .filter_map(move |maybe| async { + maybe + .ok() + .and_then(|line| serde_json::from_str::(&line).ok()) + }) + .map(|state| state.into()) + .collect() + .await + } + Err(_) => Vec::new(), + } +} diff --git a/backend/src/util.rs b/backend/src/util.rs index 2546cf8..fefb282 100644 --- a/backend/src/util.rs +++ b/backend/src/util.rs @@ -1,5 +1,9 @@ -use async_std::fs; -use async_std::prelude::*; +use crate::planetwars::FinishedState; +use mozaic::util::request::Connect; +use serde_json::Value; + +use std::cmp::Ordering; +use std::sync::{Arc, Mutex}; static NAV: [(&'static str, &'static str); 6] = [ ("/", "Home"), @@ -14,18 +18,14 @@ pub static COLOURS: [&'static str; 9] = [ "gray", "blue", "cyan", "green", "yellow", "orange", "red", "pink", "purple", ]; -#[derive(Serialize)] -pub struct Map { - name: String, - url: String, -} - +/// The state of a player, in a running game. +/// This represents actual players or connection keys. #[derive(Serialize, Eq, PartialEq)] pub struct PlayerStatus { - waiting: bool, - connected: bool, - reconnecting: bool, - value: String, + pub waiting: bool, + pub connected: bool, + pub reconnecting: bool, + pub value: String, } impl From for PlayerStatus { fn from(value: Connect) -> Self { @@ -53,8 +53,9 @@ impl From for PlayerStatus { } } -use serde_json::Value; - +/// The GameState is the state of a game. +/// Either Finished, so the game is done, not running, and there is a posible visualization. +/// Or Playing, the game is still being managed by the mozaic framework. #[derive(Serialize, Eq, PartialEq)] #[serde(tag = "type")] pub enum GameState { @@ -75,8 +76,6 @@ pub enum GameState { }, } -use std::cmp::Ordering; - impl PartialOrd for GameState { fn partial_cmp(&self, other: &GameState) -> Option { Some(self.cmp(other)) @@ -104,10 +103,10 @@ impl From for GameState { GameState::Finished { players: state - .players - .iter() - .map(|(id, name)| (name.clone(), state.winners.contains(&id))) - .collect(), + .players + .iter() + .map(|(id, name)| (name.clone(), state.winners.contains(&id))) + .collect(), map: state.map, name: state.name, turns: state.turns, @@ -116,6 +115,7 @@ impl From for GameState { } } +/// Link struct, holding all necessary information #[derive(Serialize)] struct Link { name: String, @@ -123,18 +123,21 @@ struct Link { active: bool, } -#[derive(Serialize)] -pub struct Lobby { - pub games: Vec, - pub maps: Vec, +impl Link { + fn build_nav(active: &str) -> Vec { + NAV.iter() + .map(|(href, name)| Link { + name: name.to_string(), + href: href.to_string(), + active: *name == active, + }) + .collect() + } } -// #[derive(Serialize)] -// #[serde(rename_all = "camelCase")] -// pub enum ContextT { -// Games(Vec), -// } - +/// Context used as template context. +/// This way you know to add nav bar support etc. +/// This T can be anything that is serializable, like json!({}) macro. #[derive(Serialize)] pub struct Context { pub name: String, @@ -146,14 +149,7 @@ pub struct Context { impl Context { pub fn new_with(active: &str, t: T) -> Self { - let nav = NAV - .iter() - .map(|(href, name)| Link { - name: name.to_string(), - href: href.to_string(), - active: *name == active, - }) - .collect(); + let nav = Link::build_nav(active); Context { nav, @@ -165,14 +161,7 @@ impl Context { impl Context<()> { pub fn new(active: &str) -> Self { - let nav = NAV - .iter() - .map(|(href, name)| Link { - name: name.to_string(), - href: href.to_string(), - active: *name == active, - }) - .collect(); + let nav = Link::build_nav(active); Context { nav, @@ -182,92 +171,8 @@ impl Context<()> { } } -pub async fn get_maps() -> Result, String> { - let mut maps = Vec::new(); - let mut entries = fs::read_dir("maps") - .await - .map_err(|_| "IO error".to_string())?; - while let Some(file) = entries.next().await { - let file = file.map_err(|_| "IO error".to_string())?.path(); - if let Some(stem) = file.file_stem().and_then(|x| x.to_str()) { - maps.push(Map { - name: stem.to_string(), - url: file.to_str().unwrap().to_string(), - }); - } - } - - Ok(maps) -} - -use async_std::io::BufReader; -use futures::stream::StreamExt; -pub async fn get_games() -> Vec { - match fs::File::open("games.ini").await { - Ok(file) => { - let file = BufReader::new(file); - file.lines() - .filter_map(move |maybe| async { - maybe - .ok() - .and_then(|line| serde_json::from_str::(&line).ok()) - }) - .map(|state| state.into()) - .collect() - .await - } - Err(_) => Vec::new(), - } -} - -use crate::planetwars::FinishedState; - -use futures::future::{join_all, FutureExt}; -use mozaic::modules::game; -use mozaic::util::request::Connect; -pub async fn get_states( - game_ids: &Vec<(String, u64)>, - manager: &game::Manager, -) -> Result, String> { - let mut states = Vec::new(); - let gss = join_all( - game_ids - .iter() - .cloned() - .map(|(name, id)| manager.get_state(id).map(move |f| (f, name))), - ) - .await; - - for (gs, name) in gss { - if let Some(state) = gs { - match state { - Ok((state, conns)) => { - let players: Vec = - conns.iter().cloned().map(|x| x.into()).collect(); - let connected = players.iter().filter(|x| x.connected).count(); - states.push(GameState::Playing { - name: name, - total: players.len(), - players, - connected, - map: String::new(), - state, - }); - } - Err(value) => { - let state: FinishedState = serde_json::from_value(value).expect("Shit failed"); - states.push(state.into()); - } - } - } - } - - states.sort(); - Ok(states) -} - -use std::sync::{Arc, Mutex}; +/// Games is the game manager wrapper so Rocket can manage it pub struct Games { inner: Arc>>, } diff --git a/backend/templates/help/base.html.tera b/backend/templates/info/base.html.tera similarity index 95% rename from backend/templates/help/base.html.tera rename to backend/templates/info/base.html.tera index 07c4480..7256a5a 100644 --- a/backend/templates/help/base.html.tera +++ b/backend/templates/info/base.html.tera @@ -20,7 +20,7 @@
- {% block help %}{% endblock help %} + {% block info %}{% endblock info %}
diff --git a/backend/templates/help/help_1.html.tera b/backend/templates/info/info_1.html.tera similarity index 93% rename from backend/templates/help/help_1.html.tera rename to backend/templates/info/info_1.html.tera index 34d2e05..a79f3e2 100644 --- a/backend/templates/help/help_1.html.tera +++ b/backend/templates/info/info_1.html.tera @@ -1,4 +1,4 @@ -{% extends "help/base" %} +{% extends "info/base" %} {% block header %} @@ -7,7 +7,7 @@ Information {% endblock %} -{% block help %} +{% block info %}

Rules

diff --git a/backend/templates/help/help_2.html.tera b/backend/templates/info/info_2.html.tera similarity index 92% rename from backend/templates/help/help_2.html.tera rename to backend/templates/info/info_2.html.tera index b8729bb..69aa893 100644 --- a/backend/templates/help/help_2.html.tera +++ b/backend/templates/info/info_2.html.tera @@ -1,4 +1,4 @@ -{% extends "help/base" %} +{% extends "info/base" %} {% block header %} @@ -7,7 +7,7 @@ Information {% endblock %} -{% block help %} +{% block info %}

Combat resolution

diff --git a/backend/templates/help/help_3.html.tera b/backend/templates/info/info_3.html.tera similarity index 95% rename from backend/templates/help/help_3.html.tera rename to backend/templates/info/info_3.html.tera index 4077981..809dcd1 100644 --- a/backend/templates/help/help_3.html.tera +++ b/backend/templates/info/info_3.html.tera @@ -1,4 +1,4 @@ -{% extends "help/base" %} +{% extends "info/base" %} {% block header %} @@ -7,7 +7,7 @@ Interaction with the game {% endblock %} -{% block help %} +{% block info %}
diff --git a/backend/templates/help/help_4.html.tera b/backend/templates/info/info_4.html.tera similarity index 95% rename from backend/templates/help/help_4.html.tera rename to backend/templates/info/info_4.html.tera index 1a42297..1dbf3e7 100644 --- a/backend/templates/help/help_4.html.tera +++ b/backend/templates/info/info_4.html.tera @@ -1,4 +1,4 @@ -{% extends "help/base" %} +{% extends "info/base" %} {% block header %} @@ -7,7 +7,7 @@ Format: Game state {% endblock %} -{% block help %} +{% block info %}
diff --git a/backend/templates/help/help_5.html.tera b/backend/templates/info/info_5.html.tera
similarity index 92%
rename from backend/templates/help/help_5.html.tera
rename to backend/templates/info/info_5.html.tera
index 3dcd496..758c7c0 100644
--- a/backend/templates/help/help_5.html.tera
+++ b/backend/templates/info/info_5.html.tera
@@ -1,4 +1,4 @@
-{% extends "help/base" %}
+{% extends "info/base" %}
 
 {% block header %}
 
@@ -7,7 +7,7 @@ Format: Player turn (actions)
 {% endblock %}
 
 
-{% block help %}
+{% block info %}
 
 
diff --git a/backend/templates/help/help_6.html.tera b/backend/templates/info/info_6.html.tera
similarity index 92%
rename from backend/templates/help/help_6.html.tera
rename to backend/templates/info/info_6.html.tera
index f33186e..8e2830d 100644
--- a/backend/templates/help/help_6.html.tera
+++ b/backend/templates/info/info_6.html.tera
@@ -1,4 +1,4 @@
-{% extends "help/base" %}
+{% extends "info/base" %}
 
 {% block header %}
 
@@ -7,7 +7,7 @@ How to connect
 {% endblock %}
 
 
-{% block help %}
+{% block info %}