ONSdigital / sdg-indicators

Development website for collecting and disseminating UK data for the Sustainable Development Goal global indicators.
https://ONSdigital.github.io/sdg-indicators/
37 stars 65 forks source link

No Poverty 1.2.2 - High Priority A - Links to non-html documents #1074

Closed gingerbenw closed 6 years ago

gingerbenw commented 6 years ago

screen shot 2017-11-02 at 10 54 57

There were links present that opened non-html documents, however this is not clear from the link text itself.

Current code Ref(s): <a href="https://unstats.un.org/sdgs/metadata/files/Metadata-01-02-01.pdf"> United Nations Sustainable Development Goals Metadata: 1.2.1 </a>

Solution: Every link that opens a non-html document MUST contain the file title, type and where possible size, and open in a new window to ensure that users that rely on the keyboard are able to return to the previous page. The fact that the link opens in a new window must also be declared within the link text.

Suggested Code: <a href="https://unstats.un.org/sdgs/metadata/files/Metadata-01-02-01.pdf"> United Nations Sustainable Development Goals Metadata: 1.2.1 (PDF 1mb) <span class=”visuallyhidden”>opens in a new window</span> </a>

CSS: .visuallyhidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

dougmet commented 6 years ago

Hi @MaxEngledewAdmin some of this applys to data coming in, so it's something to be aware of. Maybe a bulk fix is more appropriate here.

Mengledew commented 6 years ago

Yep, a bulk fix on this would be greatly appreciated! They should all be links to pdf (size may vary).

dougmet commented 6 years ago

Bulk fix implemented. I added a script that works out file size for each PDF and updated the text. I didn't add the part about opening in a new window because as far as I can tell the link doesn't open in new window

gingerbenw commented 6 years ago

It sounds as though the link needs to open in a new window for accessibility - this can be solved by adding target='_blank' to the opening <a> tag.

dougmet commented 6 years ago

What we're going to do is to make all metadata links open in new window and insert the span tag into each link text. https://github.com/datasciencecampus/sdg-indicators/blob/cc3684c99d6b0934aaaa40d865d9533f0de0accf/_includes/components/metadata.html#L18

AnnCorp commented 6 years ago

@gingerbenw We discussed rerunning the job to add file sizes once Max's team have updated some links

AnnCorp commented 6 years ago

@MaxEngledewAdmin please let Ben know once your link updates are all done and merged and he will rerun the job. Thanks!

Mengledew commented 6 years ago

Will do - won't be long now!

Mengledew commented 6 years ago

@gingerbenw this is ready to go but we're still updating other items in the metadata - will this cause conflicts with open metadata pull requests?

gingerbenw commented 6 years ago

Ahh! Hey Max; Apologies but I totally missed this message. So long as the same sections aren't being updated again it shouldn't. Thought it might be preferable to wait until it's all completed if we think it'll be finished before launch?

dougmet commented 6 years ago

The link text is accessible via prose so I think the hope was that after the initial bulk edit the link text would be maintained manually as the URLs change. How many is it?

AnnCorp commented 6 years ago

Agreed will do manually