Commit e6d856b1 authored by iv's avatar iv

Add links for better browsing experience.

parent 0b747c8d
...@@ -173,7 +173,7 @@ class WebDAV(MethodView): ...@@ -173,7 +173,7 @@ class WebDAV(MethodView):
data = '' data = ''
if os.path.isdir(localpath): if os.path.isdir(localpath):
data = "\n".join(app.fs_handler.get_children(request.path)) data = render_template('get_collection.html', link_list=app.fs_handler.get_children(request.path))
elif os.path.isfile(localpath): elif os.path.isfile(localpath):
try: try:
data_resource = app.fs_handler.get_data(request.path) data_resource = app.fs_handler.get_data(request.path)
...@@ -409,16 +409,14 @@ def system(): ...@@ -409,16 +409,14 @@ def system():
return "system info" return "system info"
@app.route('/') @app.route('/')
def links(): def link_page():
""" """
TODO: nice set of links to useful local pages TODO: nice set of links to useful local pages
+ HOWTO use the server + HOWTO use the server
""" """
the_links = '<div><ul>' link_correspondance = ([ (what, where)
the_links += '\n'.join(['<li>%s: %s </li>' % (what, where) for what, where in URI_BEGINNING_PATH.iteritems()])
for what, where in URI_BEGINNING_PATH.iteritems()]) return render_template('link_page.html', link_correspondance=link_correspondance)
the_links += '</ul></div>'
return the_links
if __name__ == '__main__': if __name__ == '__main__':
......
<html>
<body>
<ul>
{% for link in link_list %}
<li> <a href={{ link }}>{{ link }}</a> </li>
{% endfor %}
</ul>
</body>
</html>
<html>
<body>
<ul>
{% for link in link_correspondance %}
<li> <a href={{ link[1] }}>{{ link[0] }}</a> </li>
{% endfor %}
</ul>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment