From 7b1d88cf33d962e2ac98e03d0fd21327aee583a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 11 May 2022 00:22:59 +0200 Subject: [PATCH] delete buttons in attachment list (non-functional) --- themes/default.css | 5 +++++ themes/default.sh | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/themes/default.css b/themes/default.css index d038d5b..c8db718 100644 --- a/themes/default.css +++ b/themes/default.css @@ -80,6 +80,11 @@ body.editor textarea { /* === Attachments === */ +.attachment.list button[name=delete] { + font-size: .75em; + line-height: 1.25em; + margin-right: 1.25em; +} .attachment.list .size, .attachment.list .date { font-size: .875em; diff --git a/themes/default.sh b/themes/default.sh index 022a29a..7edd4b9 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -93,10 +93,19 @@ theme_attachments(){ local page="$1" title title="${page%/}"; title="${title##*/}" + if [ ! "$(mdfile "$page")" ]; then + theme_404 + return 0 + elif ! acl_read "$page"; then + theme_403 + return 0 + fi + # Important! Web Server response including newline printf "%s\r\n" "Content-Type: text/html; charset=utf-8" "" - cat <<-EOF + if acl_write "$page"; then + cat <<-EOF $(theme_head) @@ -109,6 +118,32 @@ theme_attachments(){ +
+ + $(theme_footer) + + EOF + else + cat <<-EOF + + + $(theme_head) + Attachments $(HTML "${title}") + + $(theme_header) +
$(theme_footer) EOF + fi } theme_login(){ -- 2.39.2