Show label if player could join the game

O01eg
Oct 17, 2022, 8:41 AM
XKG2L3QBAWH6XMYZ5TMDPLIXL43S3GCN4QNLAZXAWVPHGRQP727AC

Dependencies

  • [2] 6BDGQ4VM Show player names for registered players
  • [3] AEWYJHUD Start to show player list
  • [4] 6NYILMKI Add page for slow game
  • [5] BVCWJKEX Get auth info for slow game page
  • [6] A2LJT7TT Show duration in turns
  • [7] LPK5YJ2D Show slow game's status and notes
  • [8] G3VK7RIB Add FreeOrion forum's URL to slow game's
  • [9] GUAEZDLE Add turns info to slow game's page
  • [10] C6F7SJZI Add players count to slow game's page

Change contents

  • edit in src/templates/slow-game.html at line 68
    [3.195]
    [3.551]
    {{#if can_join}}
    <p>Can join</p>
    {{/if}}
  • replacement in src/pages/slow_game.rs at line 25
    [3.246][2.210:252]()
    player_list: Option<Vec<PlayerInfo>>,
    [3.246]
    [3.0]
    player_list: Option<&'a Vec<PlayerInfo>>,
    can_join: bool,
  • replacement in src/pages/slow_game.rs at line 139
    [3.1039][3.1039:1059]()
    Some(users)
    [3.1039]
    [3.1059]
    Some((users, has_itself))
  • edit in src/pages/slow_game.rs at line 143
    [3.1092]
    [3.1122]
    let status = row.get::<_, Option<&str>>(0);
  • replacement in src/pages/slow_game.rs at line 153
    [3.2642][3.705:756]()
    status: row.get::<_, Option<&str>>(0),
    [3.2642]
    [3.756]
    status,
  • replacement in src/pages/slow_game.rs at line 160
    [3.886][3.1093:1118]()
    player_list,
    [3.886]
    [3.2642]
    player_list: player_list.as_ref().map(|x| &x.0),
    can_join: player_list
    .as_ref()
    .map_or(false, |x| !x.1 && status.is_none()),