Skip to content

fix #3337 #3345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion qiita_pet/handlers/study_handlers/prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------------------------------
from os.path import join
from os.path import join, relpath

from tornado.web import authenticated
from tornado.escape import url_escape
import pandas as pd

from qiita_core.qiita_settings import qiita_config
from qiita_pet.handlers.util import to_int
from qiita_pet.handlers.base_handlers import BaseHandler
from qiita_db.util import (get_files_from_uploads_folders, get_mountpoint,
Expand Down Expand Up @@ -79,6 +80,13 @@ def get(self):
fp = res['creation_job'].parameters.values['sample_sheet']
res['creation_job_filename'] = fp['filename']
res['creation_job_filename_body'] = fp['body']
summary = None
if res['creation_job'].outputs:
summary = relpath(
# [0] is the id, [1] is the filepath
res['creation_job'].outputs['output'].html_summary_fp[1],
qiita_config.base_data_dir)
res['creation_job_artifact_summary'] = summary

self.render('study_ajax/prep_summary.html', **res)

Expand Down
3 changes: 3 additions & 0 deletions qiita_pet/templates/study_ajax/prep_summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,9 @@ <h4>
<span id="prep-name-span">{{name}}</span> - ID {{prep_id}} ({{data_type}})
{% if user_level in ('admin', 'wet-lab admin') and creation_job is not None %}
<a class="btn btn-default" download="{{creation_job_filename}}" href="data:text/plain;charset=utf-8,{{creation_job_filename_body}}"><span class="glyphicon glyphicon-download-alt"></span> SampleSheet</a>
{% if creation_job_artifact_summary is not None %}
<a class="btn btn-default" target="_blank" href="{% raw qiita_config.portal_dir %}/artifact/html_summary/{{creation_job_artifact_summary}}"><span class="glyphicon glyphicon-download-alt"></span> Creation Job Output</a>
{% end %}
{% end %}
<a class="btn btn-default" data-toggle="modal" data-target="#update-prep-name"><span class="glyphicon glyphicon-pencil"></span> Edit name</a>
<a class="btn btn-default" href="{% raw qiita_config.portal_dir %}/download/{{download_prep_id}}"><span class="glyphicon glyphicon-download-alt"></span> Prep info</a>
Expand Down