aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorboasting-squirrel <boasting.squirrel@gmail.com>2019-02-26 22:54:36 +0000
committerboasting-squirrel <boasting.squirrel@gmail.com>2019-02-26 22:54:36 +0000
commitdb87865631477fafc8b4e62f444514e853014856 (patch)
tree06a1c86c52b489edb087849f1b3376d740c12867 /src
parentStylized table header + added chevrons (diff)
downloadminiserve-db87865631477fafc8b4e62f444514e853014856.tar.gz
miniserve-db87865631477fafc8b4e62f444514e853014856.zip
Added highlight for current sorting column
Diffstat (limited to 'src')
-rw-r--r--src/renderer.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index 24942d8..846d18b 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -55,9 +55,11 @@ fn build_link(
let mut link = format!("?sort={}&order=asc", name);
let mut help = format!("Sort by {} in ascending order", name);
let mut chevron = chevron_up();
+ let mut class = "";
if let Some(method) = sort_method {
if method.to_string() == name {
+ class = "active";
if let Some(order) = sort_order {
if order.to_string() == "asc" {
link = format!("?sort={}&order=desc", name);
@@ -69,9 +71,10 @@ fn build_link(
};
html! {
- (chevron)
-
- a href=(link) title=(help) { (title) }
+ span class=(class) {
+ (chevron)
+ a href=(link) title=(help) { (title) }
+ }
}
}
@@ -258,6 +261,12 @@ fn css() -> Markup {
th a, th a:visited {
color: #777c82;
}
+ th span.active a {
+ color: #d24ca9;
+ }
+ th span.active svg {
+ fill: #d24ca9;
+ }
@media (max-width: 600px) {
h1 {
font-size: 1.375em;