Compare commits

..

2 Commits

Author SHA1 Message Date
Dendy f067850ab6 Don't show "<---" on route "/" 2024-01-24 23:53:32 +01:00
Dendy bc385e4af3 Show .php and order lists alphabetically 2024-01-24 23:52:28 +01:00
2 changed files with 5 additions and 3 deletions

View File

@ -46,9 +46,8 @@ def index(path):
if os.path.isdir(internal_path): if os.path.isdir(internal_path):
_, dirs, files = next(os.walk(internal_path)) _, dirs, files = next(os.walk(internal_path))
files = filter(lambda x: not x.endswith(".php"), files) files = sorted(filter(lambda x: not x.startswith("."), files))
files = filter(lambda x: not x.startswith("."), files) dirs = sorted(filter(lambda x: not x.startswith("."), dirs))
dirs = filter(lambda x: not x.startswith("."), dirs)
return ( return (
render_template( render_template(

View File

@ -3,8 +3,11 @@
{% block title %}{{ path }}{% endblock %} {% block title %}{{ path }}{% endblock %}
{% block body %} {% block body %}
{% if path != "/" %}
<a href="..">&lt;--</a> <a href="..">&lt;--</a>
<br /><br /> <br /><br />
{% endif %}
{% for dir in dirs %} {% for dir in dirs %}
<a href="{{ path_join(path, dir) }}">{{ dir }}</a><br /> <a href="{{ path_join(path, dir) }}">{{ dir }}</a><br />