Add new pages and links to slow games and reset game password
Dependencies
- [2]
HZDCKIXQUse constants for templates - [3]
BCXEUKX6Add config, static files and web server - [4]
IM5ZPD4NUpdate dependencies - [5]
OJO4B4QOAdd login form and empty handler - [*]
65A3LIWUUse handlebars to render index - [*]
EVP2FSBHSplit index page - [*]
WW3KRXX6Add page for reset game password - [*]
WVHXYKCVAdd postgresql pools - [*]
4MZ4VIR7Initial commit
Change contents
- file addition: slow-games.html[7.12]
<!DOCTYPE html><html><head><meta charset="UTF-8"><link rel="alternate" type="application/rss+xml" href="atoms/new-games.xml" title="Multiplayer FreeOrion slow games" /><link rel="stylesheet" type="text/css" href="static/style.css" /><title>Welcome to multiplayer FreeOrion slow games!</title></head><body><div class="navi"></div><div class="content"><h1>Welcome to FreeOrion slow games!</h1><p>There is a page about slow multiplayer FreeOrion games influenced by <a href="https://longturn.net/">FreeCiv LongTurn project</a>.</p><p>Subscribe to <a href="atoms/new-games.xml">RSS</a> <a href="http://www.feedvalidator.org/check.cgi?url=https%3A//freeorion-test.dedyn.io/atoms/new-games.xml"><img src="static/valid-rss-rogers.png" alt="[Valid RSS]" title="Validate my RSS feed" /></a> to get information about upcoming games.</p><p>Information, updates, registration and support for this server<a href="https://freeorion.org/forum/viewtopic.php?f=2&t=11274">https://freeorion.org/forum/viewtopic.php?f=2&t=11274</a>.</p><p>To set or change game password visit <a href="query-reset-game-pwd.html">Reset game password</a>.</p></div>{{> footer}}</body></html> - edit in src/templates/index.html at line 11
<a href="slow-games.html">Slow games corner</a> - replacement in src/templates/index.html at line 33
<li>User authentication with OTP via XMPP or E-mail (no registration yet).</ul></p><li>User authentication with OTP via XMPP or E-mail (no open registration yet).</ul></p> - replacement in src/templates/index.html at line 45
<a href="https://freeorion.org/forum/viewtopic.php?f=2&t=10706">https://freeorion.org/forum/viewtopic.php?f=2&t=10706</a>.<a href="https://freeorion.org/forum/viewtopic.php?f=2&t=10706">https://freeorion.org/forum/viewtopic.php?f=2&t=10706</a>.<br/>To set or change game password visit <a href="query-reset-game-pwd.html">Reset game password</a>. - file addition: slow_games.rs[8.17]
use actix_web::{web, HttpResponse};use crate::pages::insert_security_headers;use crate::pages::templates::SLOW_GAMES;use crate::WebData;pub async fn slow_games(data: web::Data<WebData<'_>>) -> HttpResponse {let body = match data.handlebars.render(SLOW_GAMES, &()) {Ok(b) => b,Err(e) => {log::error!("Render slow games error: {}", e);return HttpResponse::ServiceUnavailable().body(actix_web::body::None::new());}};insert_security_headers(HttpResponse::Ok()).body(body)} - edit in src/pages/mod.rs at line 12
pub mod slow_games; - edit in src/pages/mod.rs at line 18
pub const SLOW_GAMES: &str = "slow-games"; - edit in src/main.rs at line 19
use pages::slow_games::slow_games; - edit in src/main.rs at line 93
handlebars.register_template_string(templates::SLOW_GAMES,include_str!("templates/slow-games.html"),).expect("slow games template"); - edit in src/main.rs at line 161
.route("/slow-games.html", web::get().to(slow_games))