Skip to content

Commit

Permalink
Merge 881363b into c8fa007
Browse files Browse the repository at this point in the history
  • Loading branch information
antgonza committed Nov 7, 2016
2 parents c8fa007 + 881363b commit e689735
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions qiita_pet/handlers/api_proxy/studies.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,14 @@ def study_prep_get_req(study_id, user_id):
info['start_artifact_id'] = start_artifact.id
info['youngest_artifact'] = '%s - %s' % (
youngest_artifact.name, youngest_artifact.artifact_type)
info['ebi_experiment'] = (True
if prep.ebi_experiment_accessions
else False)
else:
info['start_artifact'] = None
info['start_artifact_id'] = None
info['youngest_artifact'] = None
info['ebi_experiment'] = False

prep_info[dtype].append(info)

Expand Down
16 changes: 11 additions & 5 deletions qiita_pet/handlers/api_proxy/tests/test_studies.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ def test_study_prep_get_req(self):
'name': 'PREP 1 NAME',
'start_artifact_id': 1,
'start_artifact': 'FASTQ',
'youngest_artifact': 'BIOM - BIOM'}, {
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True}, {
'id': 2,
'status': 'private',
'name': 'PREP 2 NAME',
'start_artifact': 'BIOM',
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True,
'start_artifact_id': 7}]}}
self.assertEqual(obs, exp)

Expand All @@ -192,19 +194,22 @@ def test_study_prep_get_req(self):
'name': 'PREP 1 NAME',
'start_artifact_id': 1,
'start_artifact': 'FASTQ',
'youngest_artifact': 'BIOM - BIOM'},
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True},
{'id': 2,
'status': 'private',
'name': 'PREP 2 NAME',
'start_artifact_id': 7,
'start_artifact': 'BIOM',
'youngest_artifact': 'BIOM - BIOM'}],
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True}],
'16S': [{'id': pt.id,
'status': 'sandbox',
'name': 'PREP %d NAME' % pt.id,
'start_artifact_id': None,
'start_artifact': None,
'youngest_artifact': None}]}}
'youngest_artifact': None,
'ebi_experiment': False}]}}
self.assertEqual(obs, exp)

obs = study_prep_get_req(1, 'admin@foo.bar')
Expand All @@ -220,7 +225,8 @@ def test_study_prep_get_req(self):
'name': 'PREP 1 NAME',
'start_artifact_id': 1,
'start_artifact': 'FASTQ',
'youngest_artifact': 'BIOM - BIOM'}]}}
'youngest_artifact': 'BIOM - BIOM',
'ebi_experiment': True}]}}
self.assertEqual(obs, exp)
# Reset visibility of the artifacts
for i in range(4, 0, -1):
Expand Down
Binary file added qiita_pet/static/img/ena.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion qiita_pet/templates/study_ajax/data_type_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ <h4 class="panel-title">
<div class="panel-body">
{% for prep in prep_info[dt] %}
<a href="#" style="display:block;color:black;" onclick="populate_main_div('{% raw qiita_config.portal_dir %}/study/description/prep_template/', { prep_id: {{prep['id']}}, study_id: {{study_id}} });">
<span id="prep-header-{{prep['id']}}">{{prep['name']}} - ID {{prep['id']}} - {{prep['status']}}</span><br/>
<span id="prep-header-{{prep['id']}}">
{% if prep['ebi_experiment'] %}
<img src="{% raw qiita_config.portal_dir %}/static/img/ena.png" style="width:20px;height:20px;">
{% end %}
{{prep['name']}} - ID {{prep['id']}} - {{prep['status']}}
</span><br/>
{{prep['start_artifact']}} - ID {{prep['start_artifact_id']}}<br/>
{{prep['youngest_artifact']}}
</a>
Expand Down

0 comments on commit e689735

Please sign in to comment.