123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- % from rest.tool_color import color
- % link = setdefault("link", "") or ""
- % disabled = setdefault("disabled", "") and 'disabled="true"'
- % download_disabled = "" if disabled else 'disabled="true"'
- % mimetype = (setdefault("mimetype", None) is not True and mimetype) or None
- <!DOCTYPE html>
- <html>
- <head>
- <style>
- html {
- --scrollbarBG: #333333;
- --thumbBG: #080808;
- }
- body {
- background-color: #080808;
- color: #cccccc;
- }
- img {
- background-color: floralwhite;
- color: black;
- max-height: min(100vh, calc(100vw * 9 / 16));
- max-width: calc(100vw - 2em);
- }
- object {
- width: 80%;
- margin: 1em 0 0;
- }
- object.other {
- height: 60vh;
- }
- object.text {
- height: 60vh;
- border: floralwhite;
- border-style: solid;
- border-width: thin;
- }
- </style>
- <title>Upload</title>
- <link rel="manifest" href="/static/upload-manifest.json"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/purecss@2.1.0/build/pure-min.css" integrity="sha384-yHIFVG6ClnONEA5yB5DJXfW2/KC173DIQrYoZMEtBvGzmf0PKiGyNEqe9N6BNDBH" crossorigin="anonymous"/>
- <link rel="stylesheet" href="https://shandan.one/css/grids-responsive-min.css"/>
- <link rel="stylesheet" href="https://shandan.one/css/responsive-visibility-collapse.css"/>
- </head>
- <body align="center" style="text-align: center">
- <div class="pure-g">
- <div class="pure-u-1">
- % include('buttongroup-upload')
- </div>
- <div class="pure-u-1">
- <div class="pure-button" style="margin: 1em 0 0; background: {{ color['upload'] }};">
- <a href="{{link}}" style="color: floralwhite;">{{ link }}</a>
- </div>
- </div>
- <div class="pure-u-1">
- <p><details><summary> Show QR code ...</summary><img src="{{qr}}"/></details></p>
- {{!form}}
- <form id="download" method="get" action="{{link}}"></form>
- % if mimetype and mimetype.startswith('text'):
- <object class="text" data="{{link}}?download=false&mimetype=text/plain" type={{mimetype}}><p>Unable to display {{mimetype}}</p></object>
- % elif mimetype and mimetype.startswith('image'):
- <object data="{{link}}?download=false" type="{{mimetype}}"><p>Unable to display {{mimetype}}</p></object>
- % elif mimetype:
- <object class="other" data="{{link}}?download=false" type={{mimetype}}><p>Unable to display {{mimetype}}</p></object>
- % end
- </div>
- </div>
- </body>
- </html>
|