openrightsgroup / blocked-org-uk

Template front-end code, markup, style-sheets, images and other assets for the Censorship Monitoring Project (blocked.org.uk)
https://www.blocked.org.uk/
GNU General Public License v3.0
13 stars 5 forks source link

Toggle 'View past blocks for this site' and 'Show all results' on block pages #393

Closed edjw closed 5 years ago

edjw commented 5 years ago

On a page like this one, we currently have a link "View past blocks for this site" that reveals all past blocks and a "Show all results" link that reveals all results.

We should allow users to toggle that content rather than a one-way reveal.

When the content is revealed, the links should change to "Hide past results" and "Hide all results". Then, if those links are clicked, the content hides again.

dantheta commented 5 years ago

That's live now.

edjw commented 5 years ago

(Re-opening this rather than starting a new issue)

@dantheta – the link should say "Hide past results" if the past results are shown when the page is first loaded

CleanShot 2019-06-07 at 12 21 04@2x
dantheta commented 5 years ago

I've improved this a bit - the logic in the show/hide parts of this page may need rethinking.

We were previously hiding the non-blocked results when there were blocked results present, in order to emphasize those. If there are no blocked results, then we were showing everything. The past blocks got caught halfway between the two.

I've fixed it in the short term by only displaying the show/hide links when there are blocked results present, preserving the intent of the original show/hide ticket.

There's probably going to be a revisit of this page, as I've got some template refactoring to do and some tests to write.