Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
🚸 Add table headers at the bottom if there're too many tanks
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Jul 30, 2021
1 parent 7193664 commit ed43868
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blitz-dashboard"
version = "0.26.0"
version = "0.26.1"
authors = ["Pavel Perestoronin <[email protected]>"]
edition = "2018"
resolver = "2"
Expand Down
138 changes: 71 additions & 67 deletions src/web/routes/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub async fn get(
}
};
let tabs = html! {
nav#period.tabs.is-boxed {
nav.tabs.is-boxed {
div.container {
ul {
(render_period_li(period, StdDuration::from_secs(3600), "Час"))
Expand All @@ -145,6 +145,72 @@ pub async fn get(
}
}
};
let vehicles_thead = html! {
tr {
th { "Техника" }
th#by-tier {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-tier" { "Уровень" } }
}
}
th { "Тип" }
th#by-battles {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-battles" { "Бои" } }
}
}
th#by-wins {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-wins" { "Победы" } }
}
}
th#by-win-rate {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-win-rate" { "Текущий " abbr title="Процент побед" { "WR" } } }
}
}
th#by-true-win-rate {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-true-win-rate" { "Ожидаемый " abbr title="Процент побед" { "WR" } } }
}
}
th#by-frags-per-hour {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-wins-per-hour" { abbr title="Число побед за время жизни танка в бою – полезно для событий на победы" { "Победы в час" } } }
}
}
th#by-gold {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-gold" { abbr title="Текущий доход от золотых бустеров за бой, если они были установлены" { "Заработанное золото" } } }
}
}
th#by-true-gold {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-true-gold" { abbr title="Средняя ожидаемая доходность золотого бустера за бой" { "Ожидаемое золото" } } }
}
}
th#by-damage-dealt {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-damage-dealt" { "Ущерб" } }
}
}
th#by-damage-per-battle {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-damage-per-battle" { "Ущерб за бой" } }
}
}
th#by-survived-battles {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-survived-battles" { "Выжил" } }
}
}
th#by-survival-rate {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-survival-rate" { "Выживаемость" } }
}
}
}
};
let markup = html! {
(DOCTYPE)
html lang="en" {
Expand Down Expand Up @@ -310,72 +376,7 @@ pub async fn get(
div.box {
div.table-container {
table#vehicles.table.is-hoverable.is-striped.is-fullwidth {
thead {
tr {
th { "Техника" }
th#by-tier {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-tier" { "Уровень" } }
}
}
th { "Тип" }
th#by-battles {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-battles" { "Бои" } }
}
}
th#by-wins {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-wins" { "Победы" } }
}
}
th#by-win-rate {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-win-rate" { "Текущий " abbr title="Процент побед" { "WR" } } }
}
}
th#by-true-win-rate {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-true-win-rate" { "Ожидаемый " abbr title="Процент побед" { "WR" } } }
}
}
th#by-frags-per-hour {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-wins-per-hour" { abbr title="Число побед за время жизни танка в бою – полезно для событий на победы" { "Победы в час" } } }
}
}
th#by-gold {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-gold" { abbr title="Текущий доход от золотых бустеров за бой, если они были установлены" { "Заработанное золото" } } }
}
}
th#by-true-gold {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-true-gold" { abbr title="Средняя ожидаемая доходность золотого бустера за бой" { "Ожидаемое золото" } } }
}
}
th#by-damage-dealt {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-damage-dealt" { "Ущерб" } }
}
}
th#by-damage-per-battle {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-damage-per-battle" { "Ущерб за бой" } }
}
}
th#by-survived-battles {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-survived-battles" { "Выжил" } }
}
}
th#by-survival-rate {
span.icon-text.is-flex-wrap-nowrap {
span { a href="#by-survival-rate" { "Выживаемость" } }
}
}
}
}
thead { (vehicles_thead) }
tbody {
@for tank in &tanks_delta {
@let vehicle = get_vehicle(tank.tank_id);
Expand Down Expand Up @@ -465,6 +466,9 @@ pub async fn get(
}
}
}
@if tanks_delta.len() >= 25 {
tfoot { (vehicles_thead) }
}
}
}
}
Expand Down

0 comments on commit ed43868

Please sign in to comment.