diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2025-02-07 12:48:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-07 12:48:50 +0000 |
commit | 77b1c1cd0bfab5d4dc5e0994050fabd4a19cdd0f (patch) | |
tree | 0b9e157598d2361397ee09e7f196938d284c48f9 /src/renderer.rs | |
parent | chore: clean up (diff) | |
parent | Add CHANGELOG entry for #1473 (diff) | |
download | miniserve-77b1c1cd0bfab5d4dc5e0994050fabd4a19cdd0f.tar.gz miniserve-77b1c1cd0bfab5d4dc5e0994050fabd4a19cdd0f.zip |
Merge branch 'master' into upload-progress-bar
Diffstat (limited to 'src/renderer.rs')
-rw-r--r-- | src/renderer.rs | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/renderer.rs b/src/renderer.rs index 9af601c..035309d 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -1,6 +1,6 @@ use std::time::SystemTime; -use actix_web::http::StatusCode; +use actix_web::http::{StatusCode, Uri}; use chrono::{DateTime, Local}; use chrono_humanize::Humanize; use clap::{crate_name, crate_version, ValueEnum}; @@ -9,7 +9,6 @@ use fast_qr::{ qr::QRCodeError, QRBuilder, }; -use http::Uri; use maud::{html, Markup, PreEscaped, DOCTYPE}; use strum::{Display, IntoEnumIterator}; @@ -118,7 +117,7 @@ pub fn page( } } } - @if conf.mkdir_enabled { + @if conf.mkdir_enabled && upload_allowed { div.toolbar_box { form id="mkdir" action=(mkdir_action) method="POST" enctype="multipart/form-data" { p { "Specify a directory name to create" } @@ -358,10 +357,10 @@ pub enum ThemeSlug { impl ThemeSlug { pub fn css(&self) -> &str { match self { - ThemeSlug::Squirrel => grass::include!("data/themes/squirrel.scss"), - ThemeSlug::Archlinux => grass::include!("data/themes/archlinux.scss"), - ThemeSlug::Zenburn => grass::include!("data/themes/zenburn.scss"), - ThemeSlug::Monokai => grass::include!("data/themes/monokai.scss"), + Self::Squirrel => grass::include!("data/themes/squirrel.scss"), + Self::Archlinux => grass::include!("data/themes/archlinux.scss"), + Self::Zenburn => grass::include!("data/themes/zenburn.scss"), + Self::Monokai => grass::include!("data/themes/monokai.scss"), } } @@ -553,7 +552,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)) } } } |