aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
authormarawan ragab <marawan31@gmail.com>2020-05-10 21:14:51 +0000
committermarawan ragab <marawan31@gmail.com>2020-05-10 21:14:51 +0000
commit848557762c1c4eed2ba16713ead97308d1841220 (patch)
tree9514661da1dbcf2169077044d995af89673a1a7c /src/renderer.rs
parentsmall improvment to buffer usage (diff)
downloadminiserve-848557762c1c4eed2ba16713ead97308d1841220.tar.gz
miniserve-848557762c1c4eed2ba16713ead97308d1841220.zip
make sure archiving is opt-in
Diffstat (limited to 'src/renderer.rs')
-rw-r--r--src/renderer.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index face6ff..accb49b 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -22,7 +22,8 @@ pub fn page(
file_upload: bool,
upload_route: &str,
current_dir: &str,
- archives: bool,
+ tar_enabled: bool,
+ zip_enabled: bool,
) -> Markup {
let upload_action = build_upload_action(
upload_route,
@@ -50,10 +51,12 @@ pub fn page(
span#top { }
h1.title { "Index of " (serve_path) }
div.toolbar {
- @if archives {
+ @if tar_enabled || zip_enabled {
div.download {
@for compression_method in CompressionMethod::iter() {
- (archive_button(compression_method, sort_method, sort_order, color_scheme, default_color_scheme))
+ @if compression_method.is_enabled(tar_enabled, zip_enabled) {
+ (archive_button(compression_method, sort_method, sort_order, color_scheme, default_color_scheme))
+ }
}
}
}