From: Paul Hänsch Date: Thu, 9 Jun 2022 13:22:55 +0000 (+0200) Subject: improved UI for attachment manipulation X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=7213d4e9f90acaa688a17b110f1c17b1e7ca74d3;p=shellwiki improved UI for attachment manipulation --- diff --git a/themes/default.css b/themes/default.css index 91458c3..f9fdc79 100644 --- a/themes/default.css +++ b/themes/default.css @@ -54,7 +54,7 @@ main .pagemenu li a { color: #FFF; } main article, main > form#renamepage, main > form#movepage, main > form#deletepage, -[id$="/[attachment]"] main form.upload { +[id$="/[attachment]"] main > form { margin: 1em; padding: .125em 1em 1em 1em; box-shadow: .25em .25em .75em; @@ -62,12 +62,12 @@ main > form#deletepage, } [id$="/[revision]"] main .revisions, -[id$="/[attachment]"] main .attachment.list { +[id$="/[attachment]"] main > .attachment.list { margin: 1em; padding: 1em 2em; } [id$="/[revision]"] main .revisions:before, -[id$="/[attachment]"] main .attachment.list:before { +[id$="/[attachment]"] main > .attachment.list:before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0; @@ -75,7 +75,6 @@ main > form#deletepage, box-shadow: .25em .25em .75em; } - /* === Editor === */ body[id$="/[edit]"] textarea, @@ -113,6 +112,39 @@ body[id$="/[newpage]"] textarea { margin-right: 1em; } +[id$="/[attachment]"] input[type=radio].tab ~ ul.attachment.list.tab { + display: block; + margin-left: 0; + padding-top: 1em; + list-style: none; +} + +ul.attachment.list.tab li input[name=select], +ul.attachment.list.tab li label.name, +ul.attachment.list.tab li a.name, +ul.attachment.list.tab li input.name { + display: none; +} + +[id$="/[attachment]"] input[type=radio].tab#tview:checked ~ ul li a.name, +[id$="/[attachment]"] input[type=radio].tab#tdel:checked ~ ul li input[name=select], +[id$="/[attachment]"] input[type=radio].tab#tdel:checked ~ ul li label.name, +[id$="/[attachment]"] input[type=radio].tab#tmove:checked ~ ul li input[name=select], +[id$="/[attachment]"] input[type=radio].tab#tmove:checked ~ ul li label.name { + display: inline; +} +[id$="/[attachment]"] input[type=radio].tab#tren:checked ~ ul li input.name { + display: block; +} + +[id$="/[attachment]"] button[name=action] { display: none; } +[id$="/[attachment]"] .upload button[name=action] { display: inline-block; } +[id$="/[attachment]"] input[type=radio].tab#tdel:checked ~ button[name=action][value=delete], +[id$="/[attachment]"] input[type=radio].tab#tmove:checked ~ button[name=action][value=move], +[id$="/[attachment]"] input[type=radio].tab#tren:checked ~ button[name=action][value=rename] { + display: block; +} + /* === Macros === */ .macro.toc { diff --git a/themes/default.sh b/themes/default.sh index c99477b..6807242 100755 --- a/themes/default.sh +++ b/themes/default.sh @@ -99,13 +99,20 @@ theme_attachments(){ if acl_write "$page"; then theme_page - "Attachments: $title" <<-EOF
+

Upload

-
+ + + + EOF else theme_page - "Attachments: $title" <<-EOF