Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwood committed Dec 10, 2024
1 parent b58c125 commit 4e76afe
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 38 deletions.
44 changes: 24 additions & 20 deletions cove/cove_360/templates/cove_360/components/explore/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,6 @@ <h3>This file contains</h3>
{% endif %}
</li>

<li>
{% trans "Unique grant identifiers:" %}&nbsp;
{% if grants_aggregates.unique_ids|length %}<button class="button button--small" data-toggle="modal" data-target-class="unique-ids" title="Show all grant identifiers">{% endif %}
{{ grants_aggregates.unique_ids|length}}
{% if grants_aggregates.unique_ids|length %}</button>{% endif %}
</li>
<li>
{% trans "Unique funder organisation identifiers:" %}&nbsp;
{% if grants_aggregates.distinct_funding_org_identifier|length %}<button class="button button--small" data-toggle="modal" data-target-class="distinct-funding-org-identifier" title="Show all funding organisation identifiers">{% endif %}
{{ grants_aggregates.distinct_funding_org_identifier|length}}
{% if grants_aggregates.distinct_funding_org_identifier|length %}</button>
{% endif %}
</li>
<li>
{% trans "Unique recipient organisation identifiers:" %}&nbsp;
{% if grants_aggregates.distinct_recipient_org_identifier|length %}<button class="button button--small" data-toggle="modal" data-target-class="distinct-recipient-org-identifier" title="Show all recipient organisation identifiers">{% endif %}
{{ grants_aggregates.distinct_recipient_org_identifier|length}}
{% if grants_aggregates.distinct_recipient_org_identifier|length %}</button>{% endif %}
</li>

{% if metadata.issued %}
<li>
The file was issued on <strong> {{metadata.issued|slice:":10"}} </strong>
Expand Down Expand Up @@ -160,6 +140,30 @@ <h3>This file contains</h3>
{% endif %}
</ul>

<h4>Identifiers</h4>
<ul>
<li>
{% trans "Unique grant identifiers:" %}&nbsp;
{% if grants_aggregates.unique_ids|length %}<button class="button button--small margin-bottom:1" data-toggle="modal" data-target-class="unique-ids" title="Show all grant identifiers">{% endif %}
{{ grants_aggregates.unique_ids|length}}
{% if grants_aggregates.unique_ids|length %}</button>{% endif %}
</li>
<li>
{% trans "Unique funder organisation identifiers:" %}&nbsp;
{% if grants_aggregates.distinct_funding_org_identifier|length %}<button class="button button--small margin-bottom:1" data-toggle="modal" data-target-class="distinct-funding-org-identifier" title="Show all funding organisation identifiers">{% endif %}
{{ grants_aggregates.distinct_funding_org_identifier|length}}
{% if grants_aggregates.distinct_funding_org_identifier|length %}</button>
{% endif %}
</li>
<li>
{% trans "Unique recipient organisation identifiers:" %}&nbsp;
{% if grants_aggregates.distinct_recipient_org_identifier|length %}<button class="button button--small margin-bottom:1" data-toggle="modal" data-target-class="distinct-recipient-org-identifier" title="Show all recipient organisation identifiers">{% endif %}
{{ grants_aggregates.distinct_recipient_org_identifier|length}}
{% if grants_aggregates.distinct_recipient_org_identifier|length %}</button>{% endif %}
</li>

</ul>

<p><strong>{% blocktrans %}Do these results look correct?{% endblocktrans %}</strong></p>
<ul >
<li>{% blocktrans %}Do the numbers of funders, grants and recipients match what you expect?{% endblocktrans %}</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ <h3>Potential opportunities</h3>
</td>
{% else %}
<td>
{# first 3 locations #}
<ul class="list-unstyled">
{% for location in json_location|slice:":3" %}
<li>{{location}}</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ <h2 class="base-card__title">
{% trans "Click the 'Submit your file' to fill out the 360Giving data file submission form. " %}
<a href="https://standard.threesixtygiving.org/en/latest/guidance/submit-data/" >{% trans "Guidance about using the submission form." %}</a>
</p>
<form>
<input type="checkbox" id="read-report-confirmed" required=required />
<label for="read-report-confirmed">Please confirm you have read and understood the <a href="#report">report</a> below</label>
</form>
<a class="button button--teal button--solid" style="opacity: 0.5" id="sf-form-link" href="https://d24000000jfkieay.my.site.com/dda/s/?id={{data_status.supplied_data.id}}" disabled>
Submit your file
</a>
Expand Down Expand Up @@ -108,17 +104,4 @@ <h1 id="report">Report</h1>
_paq.push(['trackPageView']);
});

(function () {
document.getElementById('read-report-confirmed').addEventListener('change', function () {
const link = document.getElementById('sf-form-link');

if (this.checked) {
link.removeAttribute('disabled');
link.style.opacity = 1;
} else {
link.setAttribute('disabled', 'disabled');
link.style.opacity = 0.5;
}
});
})();
</script>
2 changes: 1 addition & 1 deletion cove/cove_360/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def explore_360(request, pk, template='cove_360/explore.html'):
re.sub(r'([A-Z])', r'-\1', codelist_info['codelist'].split('.')[0]).lower()
)

if settings.GRANTS_TABLE and hasattr(json_data, 'get') and hasattr(json_data.get('grants'), '__iter__'):
if settings.get("GRANTS_TABLE", False) and hasattr(json_data, 'get') and hasattr(json_data.get('grants'), '__iter__'):
context['grants'] = json_data['grants']

context['metadata'] = {}
Expand Down

0 comments on commit 4e76afe

Please sign in to comment.