Skip to content

Commit

Permalink
Progress on #298
Browse files Browse the repository at this point in the history
  • Loading branch information
nutjob4life committed Nov 10, 2023
1 parent c000145 commit e2aa49b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/eke.knowledge/src/eke/knowledge/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .rdf import RDFAttribute, RelativeRDFAttribute
from .sites import Site
from .utils import edrn_schema_uri as esu
from .utils import Ingestor as BaseIngestor, ghetto_plotly_legend
from .utils import Ingestor as BaseIngestor, ghetto_plotly_legend, filter_by_user
from dash_dangerously_set_inner_html import DangerouslySetInnerHTML
from django.core.exceptions import ValidationError
from django.db import models
Expand Down Expand Up @@ -155,7 +155,11 @@ def get_context(self, request: HttpRequest, *args, **kwargs) -> dict:
context['nonEDRNProtocol'] = self.protocolID >= limit
from .sciencedata import DataCollection
dcs = DataCollection.objects.filter(generating_protocol=self).live().order_by(Lower('title'))
total_collections = dcs.count()
dcs = filter_by_user(dcs, request.user)
invisible_collections = total_collections - dcs.count()
context['data_collections'] = dcs
context['invisible_collections'] = invisible_collections
from eke.biomarkers.biomarker import Biomarker
bms = Biomarker.objects.filter(protocols=self).live().order_by(Lower('title'))
context['biomarkers'] = bms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,24 @@ <h2>Biomarkers</h2>
</ul>

<h2>Data Collections</h2>
<ul>
{% for dc in data_collections %}
<li><a href='{{dc.identifier}}'>{{dc.title}}</a></li>
{% empty %}
<li class='small'>No data available at this time for this protocol</li>
{% endfor %}
</ul>

{% if data_collections or invisible_collections %}
{% if data_collections %}
<ul>
{% for dc in data_collections %}
<li><a href='{{dc.identifier}}'>{{dc.title}}</a></li>
{% endfor %}
</ul>
{% endif %}
{% if invisible_collections == 1 %}
<p class='small'>There is one collection of data that has not yet been made public.</p>
{% elif invisible_collections > 1 %}
<p class='small'>There are {{invisible_collections}} collections of data that have not yet been made public.</p>
{% endif %}
{% else %}
<ul>
<li class='small'>No data collections available at this time for thie protocol</li>
</ul>
{% endif %}

</div>
<div class='col-lg-3'>
Expand Down

0 comments on commit e2aa49b

Please sign in to comment.