");
+ if log.is_empty() {
+ s.push_str("
nothing has happened yet");
+ }
+ for line in log {
+ let _ = write!(
+ s,
+ "
{who} {what}",
+ who = esc(&line.who),
+ what = esc(&line.what),
+ );
+ if line.effects.is_empty() {
+ // The silence CB-WP-0018 was reported for, said out loud.
+ s.push_str(" \u{2014} no effect");
+ } else {
+ for e in &line.effects {
+ let _ = write!(s, "
\u{2192} {}", esc(e));
+ }
+ }
+ s.push_str("
");
+ }
+ s.push_str("
");
+}
+
/// The page a finished game leaves behind (CB-WP-0018 T01).
///
/// `view` is `None` when the game ended badly: then there is no result to
@@ -651,7 +707,7 @@ fn json_string(s: &str) -> String {
/// **This page does not auto-reload.** The old one reloaded on `ok` and
/// the reload was refused, which is how a completed game became a blank
/// tab.
-pub fn ending(view: Option<&GroundView>, message: &str, endpoint: &str) -> String {
+pub fn ending(view: Option<&GroundView>, message: &str, endpoint: &str, log: &[LogLine]) -> String {
let mut s = String::with_capacity(4096);
let _ = write!(
s,
@@ -670,9 +726,10 @@ pub fn ending(view: Option<&GroundView>, message: &str, endpoint: &str) -> Strin
);
}
}
+ log_section(&mut s, log);
let _ = write!(
s,
- "