Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flaskdav
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
flaskdav
Commits
e6d856b1
Commit
e6d856b1
authored
Jan 04, 2016
by
iv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add links for better browsing experience.
parent
0b747c8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
flaskdav.py
flaskdav.py
+5
-7
templates/get_collection.html
templates/get_collection.html
+9
-0
templates/link_page.html
templates/link_page.html
+9
-0
No files found.
flaskdav.py
View file @
e6d856b1
...
@@ -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
link
s
():
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__'
:
...
...
templates/get_collection.html
0 → 100644
View file @
e6d856b1
<html>
<body>
<ul>
{% for link in link_list %}
<li>
<a
href=
{{
link
}}
>
{{ link }}
</a>
</li>
{% endfor %}
</ul>
</body>
</html>
templates/link_page.html
0 → 100644
View file @
e6d856b1
<html>
<body>
<ul>
{% for link in link_correspondance %}
<li>
<a
href=
{{
link
[
1
]
}}
>
{{ link[0] }}
</a>
</li>
{% endfor %}
</ul>
</body>
</html>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment