start moving file from its parent directory, cleanup some style/text
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmKqplIACgkQO3+8IhRO Y5hKQBAAi9z3Ymbb3lgFW4XZt3lvNIWlWLI8iJk2xa7SMZ52UM1juQlEjv8enC5Q DHtiyWV4VUfKEuHY6KwiDm1Sor/MUtqhcZG8tUnJfRbSVL/tFOEWiJj8/vqOAq7x NtTD5GljeKfbEL4CPbCfUimQYOKk3JDP/27MP4D3/rBhkDNx/crsnbp9sqqcJMG5 5Ol8pWu/i4u21JU5zpZKks+iFpE62OdS+mNl08waxSN4V0oYGGLbbh7Ap/c1oDLP 6AqlqnvlY9LA2527WbE3RaCgrEzB1SCmSyrUmf5YlHV/zA0HHU4w7h/6dHoF7mcw ky7uOCj+0aCp7G8+NebfRlmQF6/UKxjjf8EYyzKQ8PFv2FBu8DCF19OY7lBqeElc fscdwCZwJPB7EXzi5sz83Y9nCg3Pnb2mVXT2FFlWXupigWtsca5opc42RtBEjAgd WxhoT2NsRTgmOxZnxNQBtadDJvF4gk2LbDRl6NpeD6QestIAZWyuzKgcvFiDFHv3 0gk/Gbu2ijD3Hm4XWradrcZL+UQwZZiW8ZDjfV49lhaYai3cYwq1a1QSkYG00535 1WZw361VbTXJ4YshFzOR/d4H2chhL/XI5TSnf7iENQoeRIojiObXKlKepTyJunFR ldpnMF2i/AGgVlk8bAFOsxfi8Yp9XJVmz+Z2tGWIn5Du8D5BFtM= =DDBG -----END PGP SIGNATURE-----
4 files changed,
22 insertions(+),
10 deletions(-)
M
archetype/fileManager.go
→
archetype/fileManager.go
@@ -17,10 +17,11 @@ maxUploadMB int64
} type FileData struct { - Error string - Path string - Name string - IsDir bool + Error string + Path string + Name string + Parent string + IsDir bool } type FileListing struct {@@ -76,10 +77,11 @@ list.Root = "/" + list.Root
} levels := strings.Split(root, "/") + if list.Root != "/" { list.Up = "/" } - if len(levels) >= 2 { + if len(levels) >= 2 && list.Root != "/" { list.Up = strings.Join(levels[:len(levels)-1], "/") if !strings.HasPrefix(list.Up, "/") { list.Up = "/" + list.Up@@ -120,11 +122,12 @@ }
cleanedSlug := filepath.Clean(slug) fileBase := filepath.Base(cleanedSlug) - + parent := strings.TrimSuffix("/"+cleanedSlug, "/"+fileBase) return FileData{ - Path: filepath.Clean(slug), - Name: fileBase, - IsDir: fileInfo.IsDir(), + Path: filepath.Clean(slug), + Name: fileBase, + Parent: parent, + IsDir: fileInfo.IsDir(), } }
M
static/style.css
→
static/style.css
@@ -58,6 +58,7 @@ border: solid 2px lightgray;
font-size: 200%; color: lightgray; padding: 0.2em; + max-width: calc(100vw - 2em); } .login form input[type="text"], .login form input[type="password"] {@@ -117,6 +118,7 @@ }
nav ul { list-style: none; + padding: 0; } nav ul li {@@ -363,3 +365,9 @@
.upload-wrapper { position: relative; } + +@media screen and (max-width: 512px) { + body { + font-size: 75%; + } +}
M
templates/file_actions.html
→
templates/file_actions.html
@@ -19,6 +19,7 @@
<div class="action-panel"> <form class="file-move" method="GET" action="/file-move/{{($file).Path}}"> <span>/{{($file).Path}}</span> + <input hidden type="text" name="dest" value="{{($file).Parent}}"/> <input type="submit" value="Move/Rename"/> </form> <details class="danger-zone"><summary>Danger Zone</summary>
M
templates/file_move_process.html
→
templates/file_move_process.html
@@ -15,7 +15,7 @@ {{ else }}
<h2>File Move/Rename Success</h2> -<span class="adapter-success">File moved from {{$slug}} to {{$dest}}{{$name}} </span> +<span class="adapter-success">File moved from /{{$slug}} to {{$dest}}{{$name}} </span> {{ end }}