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

Add links to Climate Action Plan Explorer plans #1331

Closed
garethrees opened this issue Aug 3, 2022 · 2 comments
Closed

Add links to Climate Action Plan Explorer plans #1331

garethrees opened this issue Aug 3, 2022 · 2 comments
Labels
we want to do this but can't yet Things that we really want to do, but need to be part of a bigger piece of funded work

Comments

@garethrees
Copy link
Member

e.g. WhatDoTheyKnow: Aberdeen City CouncilUK Climate Action Plan Explorer: Aberdeen City Council

@garethrees
Copy link
Member Author

The simplest way to do this is by adding a new item in the body sidebar (as we've done for NI charities and MapIt areas.

Screenshot 2022-08-03 at 12 33 47

The existing pattern for linking out to external databases is to use a tag of the form database:record_idmapit:1234, for example. I think we should continue that pattern here.

While CAPE does have some lookup code, I don't think we want to use that here. CAPE is currently only focused on local councils, which is ~1% of the bodies on WDTK. While we could generate a link for every authority for CAPE to look up based on a WDTK body identifier, the majority of them will 404 since CAPE won't have a listing.

We already have a spreadsheet mapping WDTK bodies to CAPE records, so it should be pretty trivial to write a script to apply tags to bodies in the form cape:aberdeen-city-council, and similarly trivial to add the sidebar link:

<% if public_body.has_tag?('cape') %>
  <% public_body.get_tag_values('cape').each do |tag_value| %>
      <%= link_to _('Climate Action Plan'),
                    "https://data.climateemergency.uk/councils/#{ tag_value }" %><br>
  <% end %>
<% end %>

I'm not too concerned about the maintenance aspect here, since the generation of the WDTK/CAPE slug mapping is automatable and we're dealing with a handful of authorities that don't change too frequently.

If we want some fancier styling then I'm sure @zarino can arrange that within the confines of the sidebar.

@garethrees
Copy link
Member Author

Just noting that this might be a nice issue for our new cross-programme developer to work on as a relatively easy intro to both CAPE and Alaveteli/WDTK, and includes a bit of data munging (script to add/update tags) + a bit of UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
we want to do this but can't yet Things that we really want to do, but need to be part of a bigger piece of funded work
Projects
None yet
Development

No branches or pull requests

2 participants