]> git.plutz.net Git - shellwiki/commitdiff
Display attachment action button in tab container. Form field for attachment move...
authorPaul Hänsch <paul@plutz.net>
Tue, 2 Aug 2022 09:59:18 +0000 (11:59 +0200)
committerPaul Hänsch <paul@plutz.net>
Tue, 2 Aug 2022 09:59:18 +0000 (11:59 +0200)
themes/default.css
themes/default.sh

index eacc66c36171c969a438adc26a59a1ec670f2b41..e21c919f4e465614ec21000c5993a27788bdfb62 100644 (file)
@@ -123,39 +123,46 @@ body[id$="/[newpage]"] textarea {
   margin-right: 1em;
 }
 
-[id$="/[attachment]"] input[type=radio].tab ~ ul.attachment.list.tab {
+[id$="/[attachment]"] input[type=radio].tab ~ div.tab {
   display: block;
-  margin-left: 0;
   padding-top: 1em;
+}
+[id$="/[attachment]"] input[type=radio].tab ~ div.tab ul.attachment.list {
   list-style: none;
+  margin-left: 0;
 }
 
-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 {
+.tab ul li input[name=select],
+.tab ul li label.name,
+.tab ul li a.name,
+.tab ul 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 {
+[id$="/[attachment]"] input[type=radio].tab#tview:checked ~ div.tab ul li a.name,
+[id$="/[attachment]"] input[type=radio].tab#tdel:checked  ~ div.tab ul li input[name=select],
+[id$="/[attachment]"] input[type=radio].tab#tdel:checked  ~ div.tab ul li label.name,
+[id$="/[attachment]"] input[type=radio].tab#tmove:checked ~ div.tab ul li input[name=select],
+[id$="/[attachment]"] input[type=radio].tab#tmove:checked ~ div.tab ul li label.name {
   display: inline;
 }
-[id$="/[attachment]"] input[type=radio].tab#tren:checked ~ ul li input.name {
+[id$="/[attachment]"] input[type=radio].tab#tren:checked ~ .tab ul li input.name {
   display: block;
 }
 
+[id$="/[attachment]"] label[for=moveto], [id$="/[attachment]"] input#moveto,
 [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;
+[id$="/[attachment]"] input[type=radio].tab#tdel:checked  ~ div.tab button[name=action][value=delete],
+[id$="/[attachment]"] input[type=radio].tab#tmove:checked ~ div.tab label[for=moveto],
+[id$="/[attachment]"] input[type=radio].tab#tmove:checked ~ div.tab input#moveto,
+[id$="/[attachment]"] input[type=radio].tab#tmove:checked ~ div.tab button[name=action][value=move],
+[id$="/[attachment]"] input[type=radio].tab#tren:checked  ~ div.tab button[name=action][value=rename] {
+  display: inline;
 }
 
+
 /* === Macros === */
 
 .macro.toc {
index 6807242cd2d6dd0445e419bd72ae62dfe5834f23..3c803f455716d56ff6bba276a2586690945fb958 100755 (executable)
@@ -112,7 +112,8 @@ theme_attachments(){
           <input         type=radio class=tab name=attachaction value=del  id=tdel ><label for=tdel >Delete</label>
           <input         type=radio class=tab name=attachaction value=move id=tmove><label for=tmove>Move</label>
           <input         type=radio class=tab name=attachaction value=ren  id=tren ><label for=tren >Rename</label>
-          <ul class="attachment list tab">
+          <div class="tab">
+           <ul class="attachment list">
        $(for file in "$_EXEC/pages/$page/#attachments"/* "$_DATA/pages/$page/#attachments"/*; do
          [ "$file" = "$_EXEC/pages/$page/#attachments/${file##*/}" \
                -a -f "$_DATA/pages/$page/#attachments/${file##*/}" ] && continue
@@ -131,10 +132,13 @@ theme_attachments(){
                 "$hfile" "$hfile" "$hfile" "$hfile" \
                 "$(size_human "$size")" "$(date -d @"$date" +"%F %T")"
        done)
-         </ul>
-         <button type=submit name=action value=delete>Delete</button>
-         <button type=submit name=action value=move  >Move</button>
-         <button type=submit name=action value=rename>Rename</button>
+           </ul>
+           <button type=submit name=action value=delete>Delete</button>
+           <label for=moveto>Move To:</label>
+           <input id="moveto" name="moveto" value="$(HTML "$page")" placeholder="page name">
+           <button type=submit name=action value=move  >Move</button>
+           <button type=submit name=action value=rename>Rename</button>
+         </div>
        </form>
        EOF
   else