Skip to content
Snippets Groups Projects
Commit 64475afc authored by Patrick Jentsch's avatar Patrick Jentsch
Browse files

Change file download view.

parent bb26cba0
No related branches found
No related tags found
No related merge requests found
......@@ -110,8 +110,9 @@ def job(job_id):
files[file]['results'] = {}
results_dir = os.path.join(dir, 'output', file)
for result in os.listdir(results_dir):
files[file]['results'][result] = {}
files[file]['results'][result]['path'] = os.path.join(
result_type = result.rsplit(".", 1)[1]
files[file]['results'][result_type] = {}
files[file]['results'][result_type]['path'] = os.path.join(
'output', files[file]['path'], result
)
......
......@@ -161,28 +161,33 @@
</div>
</div>
<span class="card-title">Input files</span>
<p>
{% for file in files %}
<a href="{{ url_for('main.job_download', job_id=job.id, file=files[file]['path']) }}" class="waves-effect waves-light btn-small">
<i class="material-icons left">file_download</i>{{ file }}
</a>
{% endfor %}
</p>
{% if job.status == 'complete' %}
<p>&nbsp;</p>
<span class="card-title">Results</span>
<p>
{% for file in files %}
{% for result in files[file]['results'] %}
<a href="{{ url_for('main.job_download', job_id=job.id, file=files[file]['results'][result]['path']) }}" class="waves-effect waves-light btn-small">
<i class="material-icons left">file_download</i>{{ result }}
</a>
{% endfor %}
{% endfor %}
</p>
{% endif %}
<table>
<thead>
<tr>
<th>Inputs</th>
<th>Results</th>
</tr>
</thead>
<tbody>
{% for file in files %}
<tr>
<td>
<a href="{{ url_for('main.job_download', job_id=job.id, file=files[file]['path']) }}" class="waves-effect waves-light btn-small">{{ file }}</a>
</td>
<td>
{% if job.status == 'complete' %}
{% for result in files[file]['results'] %}
<a href="{{ url_for('main.job_download', job_id=job.id, file=files[file]['results'][result]['path']) }}" class="waves-effect waves-light btn-small">{{ result }}</a>
{% endfor %}
{% else %}
None
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment