aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2025-02-07 12:46:32 +0000
committerGitHub <noreply@github.com>2025-02-07 12:46:32 +0000
commitc7cd4a7a39bf1cdf7fb0ceefd1189186180b8f77 (patch)
tree878ffc5692ea1120bc62c40f82c48e903f21dfa5
parentUpdate README.md (diff)
parentAdd date pill and sort links for mobile views (diff)
downloadminiserve-c7cd4a7a39bf1cdf7fb0ceefd1189186180b8f77.tar.gz
miniserve-c7cd4a7a39bf1cdf7fb0ceefd1189186180b8f77.zip
Merge pull request #1473 from Flat/mobile-sorting
Add date pill and sort links for mobile views
-rw-r--r--data/style.scss7
-rw-r--r--src/renderer.rs7
2 files changed, 12 insertions, 2 deletions
diff --git a/data/style.scss b/data/style.scss
index c2d54f7..ceedc5f 100644
--- a/data/style.scss
+++ b/data/style.scss
@@ -281,11 +281,12 @@ td.date-cell {
color: var(--date_text_color);
}
-span.size {
+span.size, span.mobile-info.history {
white-space: nowrap;
border-radius: 1rem;
background: var(--size_background_color);
padding: 0 0.25rem;
+ margin: 0 0.25rem;
font-size: 0.7rem;
color: var(--size_text_color);
}
@@ -294,6 +295,10 @@ span.size {
display: none;
}
+.mobile-info a, .mobile-info a:visited {
+ color: var(--size_text_color);
+}
+
th a,
th a:visited,
.chevron {
diff --git a/src/renderer.rs b/src/renderer.rs
index 28ca2d9..ca49413 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -521,7 +521,12 @@ fn entry_row(
@if !raw {
@if let Some(size) = entry.size {
span.mobile-info.size {
- (maud::display(size))
+ (build_link("size", &format!("{}", size), sort_method, sort_order))
+ }
+ }
+ @if let Some(modification_timer) = humanize_systemtime(entry.last_modification_date) {
+ span.mobile-info.history {
+ (build_link("date", &modification_timer, sort_method, sort_order))
}
}
}