diff --git a/src/edrnsite.controls/src/edrnsite/controls/migrations/0003_informatics_funding_cycle.py b/src/edrnsite.controls/src/edrnsite/controls/migrations/0003_informatics_funding_cycle.py new file mode 100644 index 00000000..dad3fb11 --- /dev/null +++ b/src/edrnsite.controls/src/edrnsite/controls/migrations/0003_informatics_funding_cycle.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.9 on 2023-09-14 17:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('edrnsitecontrols', '0002_informatics_entrez_api_key'), + ] + + operations = [ + migrations.AddField( + model_name='informatics', + name='funding_cycle', + field=models.CharField(default='Ⅴ', help_text='EDRN Funding Cycle', max_length=8), + ), + ] diff --git a/src/edrnsite.controls/src/edrnsite/controls/models.py b/src/edrnsite.controls/src/edrnsite/controls/models.py index 4bde1408..82dacc8e 100644 --- a/src/edrnsite.controls/src/edrnsite/controls/models.py +++ b/src/edrnsite.controls/src/edrnsite/controls/models.py @@ -68,12 +68,14 @@ class Informatics(BaseSiteSetting): default='https://www.compass.fhcrc.org/enterEDRN/?cl=3&dl=0.9¶m1=dmcc&extra_param=plin', null=False, help_text='URL to the DMCC "secure" site', blank=False ) + funding_cycle = models.CharField(default='Ⅴ', max_length=8, null=False, blank=False, help_text='EDRN Funding Cycle') panels = [ FieldPanel('in_development'), FieldPanel('entrez_email'), FieldPanel('entrez_id'), FieldPanel('entrez_api_key'), - FieldPanel('dmcc_url') + FieldPanel('dmcc_url'), + FieldPanel('funding_cycle'), ] diff --git a/src/edrnsite.controls/src/edrnsite/controls/templatetags/edrnsite_controls_tags.py b/src/edrnsite.controls/src/edrnsite/controls/templatetags/edrnsite_controls_tags.py index 65c23ddb..30389e1d 100644 --- a/src/edrnsite.controls/src/edrnsite/controls/templatetags/edrnsite_controls_tags.py +++ b/src/edrnsite.controls/src/edrnsite/controls/templatetags/edrnsite_controls_tags.py @@ -2,9 +2,10 @@ '''🎛 EDRN Site Controls: tags.''' -from ..models import AnalyticsSnippet +from ..models import AnalyticsSnippet, Informatics from django import template from django.utils.safestring import mark_safe +from wagtail.models import Site register = template.Library() @@ -13,3 +14,9 @@ @register.simple_tag(takes_context=False) def edrn_analytics(location: str) -> str: return mark_safe(''.join(AnalyticsSnippet.objects.filter(location=location).values_list('code', flat=True))) + + +@register.simple_tag(takes_context=False) +def edrn_funding_cycle() -> str: + informatics = Informatics.for_site(Site.objects.filter(is_default_site=True).first()) + return informatics.funding_cycle diff --git a/src/eke.knowledge/src/eke/knowledge/templates/eke.knowledge/data-sharing.html b/src/eke.knowledge/src/eke/knowledge/templates/eke.knowledge/data-sharing.html index 832e0603..64315d00 100644 --- a/src/eke.knowledge/src/eke/knowledge/templates/eke.knowledge/data-sharing.html +++ b/src/eke.knowledge/src/eke/knowledge/templates/eke.knowledge/data-sharing.html @@ -1,15 +1,14 @@ {% extends 'base.html' %} -{% load wagtailcore_tags static knowledge_tags %} -{% block title %}Data Sharing Policies{% endblock title %} +{% block title %}External Data Sharing and Reuse Policy{% endblock title %} {% block content %}
The following shows which sites have data sharing policies and which do not. -
Number of sites: {{agreed|length}}
Number of sites: {{not_agreed|length}}