diff options
author | B Stack <bgstack15@gmail.com> | 2021-01-07 20:52:38 -0500 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2021-01-07 20:56:10 -0500 |
commit | badcb48cd279f0e2a0ed7eae2661171f2411e647 (patch) | |
tree | 920d3319404ece4811fd7f8bea5ef96ba52021e1 /templates/upload.html.j2 | |
download | fuss-badcb48cd279f0e2a0ed7eae2661171f2411e647.tar.gz fuss-badcb48cd279f0e2a0ed7eae2661171f2411e647.tar.bz2 fuss-badcb48cd279f0e2a0ed7eae2661171f2411e647.zip |
initial commit
Diffstat (limited to 'templates/upload.html.j2')
-rw-r--r-- | templates/upload.html.j2 | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/templates/upload.html.j2 b/templates/upload.html.j2 new file mode 100644 index 0000000..35673b7 --- /dev/null +++ b/templates/upload.html.j2 @@ -0,0 +1,53 @@ +{% set prefix_s = prefix | trim('/') ~ '/' %}{% set s_prefix_s = ( '/' ~ prefix | trim('/') ~ '/' ) | replace ("//","/") %}{% set ulp_s = ulp | trim('/') ~ '/' %}{% set server_prefix = ( server | replace("//","##") ~ '/' ~ prefix ~ '/' ) | replace("///","/") | replace("//", "/") | replace("##","//") %}{% set prefix_ulp = ( '/' ~ prefix ~ '/' ~ ulp ~ '/' ) | replace("///","/") | replace("//", "/") %}{% set server_prefix_ulp = ( server | replace("//","##") ~ '/' ~ prefix ~ '/' ~ ulp ~ '/' ) | replace("///","/") | replace("//", "/") | replace("##","//") %}<!DOCTYPE html> +<html> + <head> + <title> + FUSS upload page + </title> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <!-- (A) CSS + JS --> + <link rel="stylesheet" href="{{ s_prefix_s }}static/upload.css"/> + <link rel="stylesheet" href="{{ s_prefix_s }}static/index.css"/> + <script src="{{ s_prefix_s }}template/upload.js"></script> + <script> + function lastmod(elem){ + tc = "lastmod="; + for (var x=0; x < elem.files.length; x++) { + tc += `${Math.trunc(elem.files[x].lastModified / 1000)},` + } + document.cookie = tc; + // For a single file: + //document.cookie = `lastmod=${elem.files[0].lastModified}` + } + </script> + </head> +<!-- +server = "{{ server }}" +prefix = "{{ prefix }}" +ulp = "{{ ulp }}" +--> + <body> + <!-- (B) FILE DROP ZONE --> + <div id="upzone"> + Drop Files Here + </div> + + <!-- (D) FALLBACK --> + <form id="upform" action="{{ server_prefix_ulp }}" method="post" enctype="multipart/form-data"> + <br/> + <input type="file" name="file" multiple accept="*" oninput="lastmod(this);" required> + <input type="submit" value="Upload File"> + </form> + + <!-- (C) UPLOAD STATUS --> + <div id="hiddenfirst"> + <input id="upstatus" class="toggle" type="checkbox" checked><label for="upstatus" class="lbl-toggle" tabindex="0">Upload status</label> + <div id="upstatus" class="content"> + <div class="content-inner" id="upstat"> + </div> <!-- content-inner --> + </div> <!-- content --> + </div> + <script src="{{ s_prefix_s }}static/index.js"></script> + </body> +</html> |