Skip to content

Commit 71cea44

Browse files
Luke TuiteLuke Tuite
authored andcommitted
view function now shows SWC metadata in detailed view after upload
1 parent 63dfce8 commit 71cea44

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

ingest/templates/ingest/new_metadata_detail.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ <h1>Detail of New Metadata</h1>
88
{% include 'ingest/dataset_detail.html' %}
99
{% include 'ingest/specimen_detail.html' %}
1010
{% include 'ingest/image_detail.html' %}
11+
{% include 'ingest/swc_detail.html' %}
1112
{% endblock %}
1213

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{% if swcs %}
2+
<h3>SWC</h3>
3+
4+
<table class="table">
5+
<thead>
6+
<tr>
7+
<th>tracingFile</th>
8+
<th>sourceData</th>
9+
<th>sourceDataSample</th>
10+
<th>sourceDataSubmission</th>
11+
<th>coordinates</th>
12+
<th>coordinatesRegistration</th>
13+
<th>brainRegion</th>
14+
<th>brainRegionAtlas</th>
15+
<th>brainRegionAtlasName</th>
16+
<th>brainRegionAxonalProjection</th>
17+
<th>brainRegionDendriticProjection</th>
18+
<th>neuronType</th>
19+
<th>segmentTags</th>
20+
<th>proofreadingLevel</th>
21+
<th>notes</th>
22+
</tr>
23+
</thead>
24+
<tbody>
25+
{% for s in swcs %}
26+
<tr>
27+
<td>{{ s.tracingFile }}</td>
28+
<td>{{ s.sourceData }}</td>
29+
<td>{{ s.sourceDataSample }}</td>
30+
<td>{{ s.sourceDataSubmission }}</td>
31+
<td>{{ s.coordinates }}</td>
32+
<td>{{ s.coordinatesRegistration }}</td>
33+
<td>{{ s.brainRegion }}</td>
34+
<td>{{ s.brainRegionAtlas }}</td>
35+
<td>{{ s.brainRegionAtlasName }}</td>
36+
<td>{{ s.brainRegionAxonalProjection }}</td>
37+
<td>{{ s.brainRegionDendriticProjection }}</td>
38+
<td>{{ s.neuronType }}</td>
39+
<td>{{ s.segmentTags }}</td>
40+
<td>{{ s.proofreadingLevel }}</td>
41+
<td>{{ s.notes }}</td>
42+
</tr>
43+
{% endfor %}
44+
</table>
45+
46+
{% else %}
47+
<div class="alert alert-info">
48+
<p>There is not SWC data associated with this dataset. Please contact BIL Support if this is incorrect.</p>
49+
</div>
50+
{% endif %}

ingest/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,9 @@ def new_metadata_detail(request, pk):
462462
datasets = Dataset.objects.filter(sheet_id=pk).all()
463463
specimens = Specimen.objects.filter(sheet_id=pk).all()
464464
images = Image.objects.filter(sheet_id=pk).all()
465+
swcs = SWC.objects.filter(sheet_id=pk).all()
465466

466-
return render(request, 'ingest/new_metadata_detail.html', {'contributors':contributors, 'funders':funders, 'publications':publications, 'instruments':instruments, 'datasets':datasets, 'specimens':specimens, 'images':images})
467+
return render(request, 'ingest/new_metadata_detail.html', {'contributors':contributors, 'funders':funders, 'publications':publications, 'instruments':instruments, 'datasets':datasets, 'specimens':specimens, 'images':images, 'swcs':swcs})
467468

468469
class DescriptiveMetadataDetail(LoginRequiredMixin, DetailView):
469470
""" A detailed view of a single piece of metadata. """

0 commit comments

Comments
 (0)