Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to the Charity Commission for Northern Ireland database #1267

Closed
mdeuk opened this issue Jul 8, 2022 · 3 comments · Fixed by #1284
Closed

Link to the Charity Commission for Northern Ireland database #1267

mdeuk opened this issue Jul 8, 2022 · 3 comments · Fixed by #1284

Comments

@mdeuk
Copy link
Collaborator

mdeuk commented Jul 8, 2022

From a recent discussion on Slack, it was noted by @RichardTaylor that:

I had forgotten we had magic to detect the type of Charity number and wondered if I needed to so something special with tagging Scottish charities - and found I don't.

We do this by handling the 'charity' tag through special functionality in /lib/views/public_body/_more_info.html.erb - however, this only works for charities that appear on the registers of the Charity Commission for England and Wales (CCEW), or the Office of the Scottish Charity Regulator (OSCR). We should add the Charity Commission for Northern Ireland (CCNI) to this.

The format for CCNI is broadly similar to CCEW (it appears to be the same software) - with a slight nuance. Charities in NI use an alphanumeric identifier (e.g. NIC102724), but the database only accepts the numeric identifier - so we will need to accommodate this.

https://www.charitycommissionni.org.uk/charity-search/?searchText=#{ tag_value } would seem to be a valid structure to use.

@garethrees
Copy link
Member

If I understand correctly, all we'd need is a minor change to the sidebar and to tag NI charities as NIC:102724?

diff --git a/lib/views/public_body/_more_info.html.erb b/lib/views/public_body/_more_info.html.erb
index 17a111c..8ee6c67 100644
--- a/lib/views/public_body/_more_info.html.erb
+++ b/lib/views/public_body/_more_info.html.erb
@@ -17,6 +17,9 @@
     <% if tag_value.match(/^SC/) %>
       <%= link_to _('Charity registration'),
                     "https://www.oscr.org.uk/about-charities/search-the-register/charity-details?number=#{ tag_value }" %><br>
+    <% elsif tag_value.match(/^NIC/) %>
+      <%= link_to _('Charity registration'),
+                    "https://www.charitycommissionni.org.uk/charity-search/?searchText=#{ tag_value }" %><br>
     <% else %>
       <%= link_to _('Charity registration'),
                     "https://register-of-charities.charitycommission.gov.uk/charity-search/-/results/page/1/delta/20/keywords/#{ tag_value }" %><br>

mysociety-pusher pushed a commit that referenced this issue Jul 14, 2022
mysociety-pusher pushed a commit that referenced this issue Jul 14, 2022
The NI Charity Commission site only accepts the numeric part of the ID
(i.e. without the "NIC" prefix), so we need to strip that for the query
param.

Fixes #1267.
@garethrees
Copy link
Member

Oh, no, I don't understand correctly. Usually we tag charity:SC1234. If we tagged charity:NIC1234 with the same linking method then we'd still be inputting the NIC prefix into the query param. That's easy enough to strip out though, and I think the consistency of using the full ID as the tag value (i.e. charity:NIC1234) and then manipulating that to construct the link is the best approach.

Drafted this improvement at #1284

@mdeuk
Copy link
Collaborator Author

mdeuk commented Jul 14, 2022

Oh, no, I don't understand correctly. Usually we tag charity:SC1234. If we tagged charity:NIC1234 with the same linking method then we'd still be inputting the NIC prefix into the query param. That's easy enough to strip out though, and I think the consistency of using the full ID as the tag value (i.e. charity:NIC1234) and then manipulating that to construct the link is the best approach.

Sorry, that's my fault - I should have been clearer as to what I meant.

Drafted this improvement at #1284

I haven't been able to test it, but this LGTM. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants