Add new pages and links to slow games and reset game password

O01eg
Apr 13, 2022, 12:12 PM
DNFB7TNICXFHRGPNZTT2I4VQNBPGVA2HQMUJWLNEPHF2M4SRZ3SQC

Dependencies

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
    [3.1118]
    [3.1444]
    <a href="slow-games.html">Slow games corner</a>
  • replacement in src/templates/index.html at line 33
    [3.7525][3.1474:1562]()
    <li>User authentication with OTP via XMPP or E-mail (no registration yet).</ul></p>
    [3.7525]
    [3.7603]
    <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
    [3.7898][3.857:980]()
    <a href="https://freeorion.org/forum/viewtopic.php?f=2&t=10706">https://freeorion.org/forum/viewtopic.php?f=2&t=10706</a>.
    [3.7898]
    [3.8019]
    <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
    [9.1091]
    [10.413]
    pub mod slow_games;
  • edit in src/pages/mod.rs at line 18
    [2.1270]
    [2.1270]
    pub const SLOW_GAMES: &str = "slow-games";
  • edit in src/main.rs at line 19
    [9.1187]
    [2.1604]
    use pages::slow_games::slow_games;
  • edit in src/main.rs at line 93
    [9.1223]
    [9.1223]
    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
    [9.1429]
    [2.2328]
    .route("/slow-games.html", web::get().to(slow_games))