mirror of
https://github.com/Tim-Paik/srv.git
synced 2024-10-13 00:29:43 +00:00
Replace tera with askama, split the code
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. #}
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. #}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
@ -12,9 +12,12 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<title>{{ title }}</title>
|
||||
<!--[if lt IE 9
|
||||
]><script src="https://cdn.jsdelivr.net/npm/html5shiv/dist/html5shiv.min.js"></script
|
||||
><![endif]-->
|
||||
<!--[if lt IE 9]><script>
|
||||
/**
|
||||
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
|
||||
</script><![endif]-->
|
||||
<style>
|
||||
html,
|
||||
body,
|
||||
@ -219,7 +222,6 @@
|
||||
d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48zm220.1-208c-5.7 0-10.6 4-11.7 9.5-20.6 97.7-20.4 95.4-21 103.5-.2-1.2-.4-2.6-.7-4.3-.8-5.1.3.2-23.6-99.5-1.3-5.4-6.1-9.2-11.7-9.2h-13.3c-5.5 0-10.3 3.8-11.7 9.1-24.4 99-24 96.2-24.8 103.7-.1-1.1-.2-2.5-.5-4.2-.7-5.2-14.1-73.3-19.1-99-1.1-5.6-6-9.7-11.8-9.7h-16.8c-7.8 0-13.5 7.3-11.7 14.8 8 32.6 26.7 109.5 33.2 136 1.3 5.4 6.1 9.1 11.7 9.1h25.2c5.5 0 10.3-3.7 11.6-9.1l17.9-71.4c1.5-6.2 2.5-12 3-17.3l2.9 17.3c.1.4 12.6 50.5 17.9 71.4 1.3 5.3 6.1 9.1 11.6 9.1h24.7c5.5 0 10.3-3.7 11.6-9.1 20.8-81.9 30.2-119 34.5-136 1.9-7.6-3.8-14.9-11.6-14.9h-15.8z" />
|
||||
</defs>
|
||||
</svg>
|
||||
{% set paths_length = paths | length -%}
|
||||
<header id="header">
|
||||
<h1>
|
||||
<nav>
|
||||
@ -228,7 +230,7 @@
|
||||
</span>
|
||||
{% for path in paths -%}
|
||||
<span>
|
||||
<a href="./{% for i in range(end=paths | length - loop.index) %}../{% endfor %}">{{ path }} /
|
||||
<a href="./{% for i in 0..(paths.len() - loop.index) %}../{% endfor %}">{{ path }} /
|
||||
</a>
|
||||
</span>
|
||||
{% endfor -%}
|
||||
@ -237,10 +239,8 @@
|
||||
</header>
|
||||
<main>
|
||||
<div id="meta">
|
||||
{% set dir_length = dirs | length -%}
|
||||
{% set file_length = files | length -%}
|
||||
<span><b>{{ dir_length }}</b> directories</span>
|
||||
<span><b>{{ file_length }}</b> files</span>
|
||||
<span><b>{{ dirs.len() }}</b> directories</span>
|
||||
<span><b>{{ files.len() }}</b> files</span>
|
||||
</div>
|
||||
<div id="listing">
|
||||
<table>
|
||||
@ -298,15 +298,7 @@
|
||||
<span>{{ file.name }}</span></a>
|
||||
</td>
|
||||
<td data-order="-1">
|
||||
{{ file.size | filesizeformat |
|
||||
replace(from="KB", to="KiB") |
|
||||
replace(from="MB", to="MiB") |
|
||||
replace(from="GB", to="GiB") |
|
||||
replace(from="TB", to="TiB") |
|
||||
replace(from="PB", to="PiB") |
|
||||
replace(from="EB", to="EiB") |
|
||||
replace(from="ZB", to="ZiB") |
|
||||
replace(from="YB", to="YiB") }}
|
||||
{{ file.size|filesizeformat }}
|
||||
</td>
|
||||
<td class="hideable">
|
||||
<time class="date" datetime="{{ file.modified }}">{{ file.modified }}</time>
|
||||
@ -317,7 +309,7 @@
|
||||
<tr></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% if dir_length + file_length == 0 -%}
|
||||
{% if dirs.len() + files.len() == 0 -%}
|
||||
<div style="text-align: center; margin: 1rem; color: #cccccc;">Nothing here</div>
|
||||
{% endif -%}
|
||||
</div>
|
||||
Reference in New Issue
Block a user