mirror of
https://github.com/Novartis/cellxgene-gateway.git
synced 2026-09-27 17:38:11 +08:00
Use url_for in all templates
This commit is contained in:
@@ -45,10 +45,13 @@ def recurse_dir(path):
|
||||
"name": x[:-13]
|
||||
if (len(x) > 13 and x[-13] in ["-", "_"])
|
||||
else (x[:-4] if x.endswith(".csv") else x),
|
||||
"path": os.path.join(full_path, x).replace(env.cellxgene_data, ""),
|
||||
"path": os.path.join(full_path, x).replace(
|
||||
env.cellxgene_data, ""
|
||||
),
|
||||
}
|
||||
for x in sorted(os.listdir(full_path))
|
||||
if x.endswith(".csv") and os.path.isfile(os.path.join(full_path, x))
|
||||
if x.endswith(".csv")
|
||||
and os.path.isfile(os.path.join(full_path, x))
|
||||
]
|
||||
return [
|
||||
{
|
||||
@@ -89,7 +92,7 @@ def render_entries(entries):
|
||||
|
||||
|
||||
def get_url(entry):
|
||||
return url_for("do_view", path=entry["path"])
|
||||
return url_for("do_view", path=entry["path"].lstrip("/"))
|
||||
|
||||
|
||||
def get_class(entry):
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
|
||||
<h4>{{ message }}</h4>
|
||||
|
||||
<a href="/filecrawl.html">
|
||||
<a href="{{ url_for('filecrawl') }}">
|
||||
Please click here to be redirected to the file directory.
|
||||
</a>
|
||||
<br>
|
||||
<a href="/">
|
||||
<a href="{{ url_for('index') }}">
|
||||
Please click here to return to the homepage.
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
Navigation:
|
||||
<ul>
|
||||
{% if path %}
|
||||
<li><a href="/filecrawl.html">top level</a></li>
|
||||
<li><a href="{{ url_for('filecrawl') }}">top level</a></li>
|
||||
{% else %}
|
||||
{% endif %}
|
||||
<li><a href="/">homepage</a></li>
|
||||
<li><a href="{{ url_for('index') }}">homepage</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
<script>
|
||||
|
||||
@@ -35,11 +35,11 @@
|
||||
The page will refresh shortly.
|
||||
</p>
|
||||
|
||||
<a href="/filecrawl.html">
|
||||
<a href="{{ url_for('filecrawl') }}">
|
||||
Please click here to be redirected to the file directory.
|
||||
</a>
|
||||
<br>
|
||||
<a href="/">
|
||||
<a href="{{ url_for('index') }}">
|
||||
Please click here to return to the homepage.
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -39,10 +39,10 @@
|
||||
<li><a href="{{url_for('do_relaunch', path=dataset)}}">
|
||||
Attempt to relaunch the cellxgene server.
|
||||
</a></li>
|
||||
<li><a href="/filecrawl.html">
|
||||
<li><a href="{{ url_for('filecrawl') }}">
|
||||
Return to the file directory.
|
||||
</a></li>
|
||||
<li><a href="/">
|
||||
<li><a href="{{ url_for('index') }}">
|
||||
Return to the homepage.
|
||||
</a></li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user