diff --git a/src/subcommand/server/templates/home.rs b/src/subcommand/server/templates/home.rs index ba3246c458..be6c3bd469 100644 --- a/src/subcommand/server/templates/home.rs +++ b/src/subcommand/server/templates/home.rs @@ -3,7 +3,7 @@ use super::*; #[derive(Display)] pub(crate) struct HomeHtml { last: u64, - hashes: Vec, + blocks: Vec<(&'static str, BlockHash)>, } impl HomeHtml { @@ -14,7 +14,10 @@ impl HomeHtml { .map(|(height, _)| height) .cloned() .unwrap_or(0), - hashes: blocks.into_iter().map(|(_, hash)| hash).collect(), + blocks: blocks + .into_iter() + .map(|(height, hash)| (Height(height).starting_ordinal().rarity(), hash)) + .collect(), } } } @@ -50,8 +53,8 @@ mod tests {

Recent Blocks

    -
  1. 1{64}
  2. -
  3. 0{64}
  4. +
  5. 1{64}
  6. +
  7. 0{64}
", &HomeHtml::new(vec![ diff --git a/static/index.css b/static/index.css index 056d6ebc47..7b3aedd60b 100644 --- a/static/index.css +++ b/static/index.css @@ -63,7 +63,6 @@ span.legendary { span.mythic { background-color: #f2a900; - color: white; } a.common { diff --git a/templates/home.html b/templates/home.html index 600d82b601..c980bb69fe 100644 --- a/templates/home.html +++ b/templates/home.html @@ -9,7 +9,7 @@

Ordinals

Recent Blocks

    -%% for hash in &self.hashes { -
  1. {{hash}}
  2. +%% for (rarity, hash) in &self.blocks { +
  3. {{hash}}
  4. %% }
diff --git a/tests/server.rs b/tests/server.rs index c06f5a3953..7965d7f23d 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -203,8 +203,8 @@ fn home() {

Recent Blocks

    -
  1. [[:xdigit:]]{64}
  2. -
  3. 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206
  4. +
  5. [[:xdigit:]]{64}
  6. +
  7. 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206
.*", ); } @@ -218,7 +218,7 @@ fn home_block_limit() { state.request_regex( "/", 200, - ".*
    \n(
  1. [[:xdigit:]]{64}
  2. \n){100}
.*" + ".*
    \n(
  1. [[:xdigit:]]{64}
  2. \n){100}
.*" ); }