Skip to content

Commit

Permalink
Merge branch 'grants-monthly' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
RabiaSajjad committed Oct 31, 2024
2 parents 35bd9a7 + dc6dc09 commit bbde2bf
Show file tree
Hide file tree
Showing 8 changed files with 907 additions and 2 deletions.
26 changes: 26 additions & 0 deletions bin/filter/filter_grants_monthly.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
"filter for grantsmonthly.csv"

import csv
import sys

REMOVE_COLUMNS = [
'record_created',
'record_modified',
'user_modified',
]

def main():
reader = csv.DictReader(sys.stdin)
outnames = [f for f in reader.fieldnames if f not in REMOVE_COLUMNS]
writer = csv.DictWriter(sys.stdout, outnames)
writer.writeheader()
for row in reader:
try:
for rem in REMOVE_COLUMNS:
del row[rem]
writer.writerow(row)
except ValueError:
pass

main()
21 changes: 21 additions & 0 deletions changes/1525.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
New recombinant PD template for Grants (monthly). This template would be separate from
the existing Grants template and is targeted only for the Staging environment. Major difference
between the two templates are:
* Data collection is done quarterly for Grants vs monthly for Grants (monthly)
* The following fields exist in Grants but deprecated in Grants (monthly):
- 3.9 research_organization_name
- 3.14 federal_riding_name_en
- 3.15 federal_riding_name_fr
- 3.21 agreement_title_en
- 3.22 agreement_title_fr
- 3.25 foreign_currency_type
- 3.26 foreign_currency_value
- 3.29 coverage
- 3.32 naics_identifier
- 3.35 additional_information_en
- 3.36 additional_information_fr
* The following fields are new in the Grants (monthly) template:
- 3.26 dem_intended_beneficiary
- 3.27 other_dem_intended_beneficiary_description_en
- 3.28 other_dem_intended_beneficiary_description_fr
- 3.29 reason_amendment
1 change: 1 addition & 0 deletions ckanext/canada/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ def update_config(self, config):
assert 'ckanext.canada:tables/contracts.yaml' in recombinant_definitions
assert 'ckanext.canada:tables/contractsa.yaml' in recombinant_definitions
assert 'ckanext.canada:tables/grants.yaml' in recombinant_definitions
assert 'ckanext.canada:tables/grantsmonthly.yaml' in recombinant_definitions
assert 'ckanext.canada:tables/hospitalityq.yaml' in recombinant_definitions
assert 'ckanext.canada:tables/reclassification.yaml' in recombinant_definitions
assert 'ckanext.canada:tables/travela.yaml' in recombinant_definitions
Expand Down
852 changes: 852 additions & 0 deletions ckanext/canada/tables/grantsmonthly.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ckanext/canada/templates/home/quick_links.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ <h2 class="h5">{{ _('Proactive Publication') }}</h2>
{{ quick_link_pd('contracts') }}
{{ quick_link_pd('dac') }}
{{ quick_link_pd('grants') }}
{{ quick_link_pd('grantsmonthly') }}
{{ quick_link_pd('hospitalityq') }}
{{ quick_link_pd('reclassification') }}
{{ quick_link_pd('qpnotes') }}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/canada/templates/recombinant/create_pd_record.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
'required': required,
'help_text': description,
'choices': choice_fields[f.datastore_id],
'sorted_choices': true,
'sorted_choices': false if f.choice_order_expression else true,
'form_include_blank_choice': true,
}, data=data, errors=errors %}
{%- else %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/canada/templates/recombinant/update_pd_record.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
'required': required,
'help_text': description,
'choices': choice_fields[f.datastore_id],
'sorted_choices': true,
'sorted_choices': false if f.choice_order_expression else true,
'form_include_blank_choice': true,
}, data=data, errors=errors %}
{%- else %}
Expand Down
4 changes: 4 additions & 0 deletions ckanext/canada/templates/snippets/cdts/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
"subhref": {{ recombinant_menu_link('grants') | tojson }},
"subtext": {{ recombinant_menu_text('grants') | tojson }},
},
{
"subhref": {{ recombinant_menu_link('grantsmonthly') | tojson }},
"subtext": {{ recombinant_menu_text('grantsmonthly') | tojson }},
},
{
"subhref": {{ recombinant_menu_link('hospitalityq') | tojson }},
"subtext": {{ recombinant_menu_text('hospitalityq') | tojson }},
Expand Down

0 comments on commit bbde2bf

Please sign in to comment.