Skip to content

Commit ed1305b

Browse files
authored
Merge pull request #215 from brain-image-library/feature/ondemand
Feature/ondemand
2 parents fd78dc8 + bda5a62 commit ed1305b

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

ingest/templates/ingest/collection_detail.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ <h1><b>Submission Name</b> {{ collection.name }}
6767
<strong>This submission doesn't have any Metadata Version 1.</strong>
6868
</div>
6969
{% endif %}
70-
70+
<div><a href="{% url 'ingest:ondemandSubmission' collection.id %}">
71+
<button class="btn btn-lg btn-primary" value="ignore" formnovalidate="">View Submission Directory</button>
72+
</a></div>
7173
<p>
7274

7375
<table>

ingest/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@
5555
re_path(r'^change_bil_admin_privs/$', views.change_bil_admin_privs, name = 'change_bil_admin_privs'),
5656
path('add_project_user/<int:pk>', views.add_project_user, name = 'add_project_user'),
5757
path('people_of_pi', views.people_of_pi, name = 'people_of_pi'),
58-
re_path(r'^write_user_to_project_people/$', views.write_user_to_project_people, name = 'write_user_to_project_people')
58+
re_path(r'^write_user_to_project_people/$', views.write_user_to_project_people, name = 'write_user_to_project_people'),
59+
path('collection/ondemandSubmission/<int:pk>', views.ondemandSubmission, name = 'ondemandSubmission')
5960
]

ingest/views.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,18 @@ def collection_detail(request, pk):
934934
'descriptive_metadata_queryset': descriptive_metadata_queryset,
935935
'pi': pi, 'datasets_list':datasets_list})
936936

937+
@login_required
938+
def ondemandSubmission(request, pk):
939+
coll = Collection.objects.get(id = pk)
940+
if coll.submission_status == 'SUCCESS' and coll.validation_status == 'SUCCESS':
941+
first2 = coll.bil_uuid[:2]
942+
second2 = coll.bil_uuid[2:4]
943+
path = '/bil/data/' + first2 + '/' + second2 + '/' + coll.bil_uuid + '/'
944+
else:
945+
path = coll.data_path
946+
od = 'https://ondemand.bil.psc.edu/pun/sys/dashboard/files/fs' + path
947+
return redirect(od)
948+
937949
class CollectionUpdate(LoginRequiredMixin, UpdateView):
938950
""" Edit an existing collection ."""
939951
model = Collection

0 commit comments

Comments
 (0)