Serves the new navigation pages, browse, topic and services and information pages on GOV.UK
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app Merge pull request #874 from alphagov/remove-our-policies-from-org-pages Sep 25, 2018
bin Upgrade to rails 5.0.2 May 4, 2017
config Remove the text for 'Our policies' from yml files Sep 25, 2018
docs Update README with orgs Jun 29, 2018
features Fix detection of “A to Z” string Jul 5, 2018
lib Add empty lines after guard clauses Sep 18, 2018
log Remove unwanted log file form the repo Oct 13, 2016
public Initial commit of Rails 4.0.4 app Apr 3, 2014
script Set up Cucumber for feature specs Apr 3, 2014
spec/javascripts Fix tracking of mainstream browse pages Aug 8, 2018
test Merge pull request #874 from alphagov/remove-our-policies-from-org-pages Sep 25, 2018
vendor/assets Initial commit of Rails 4.0.4 app Apr 3, 2014
.gitignore Ignore all files inside log/ Oct 12, 2016
.rubocop.yml Fix all Rubocop linter warnings Dec 13, 2016
.ruby-version Bump to ruby-2.5.1 May 29, 2018
Dockerfile Bump to ruby-2.5.1 May 29, 2018
Gemfile Bump govuk_publishing_components from 9.27.0 to 9.28.0 Sep 25, 2018
Gemfile.lock Bump govuk_publishing_components from 9.27.0 to 9.28.0 Sep 25, 2018
Jenkinsfile Set rubyLintDiff to false in the Jenkinsfile Sep 7, 2018
LICENCE.txt Correct copyright notice Feb 16, 2015
Procfile Configure procfile to work outside of Heroku Feb 21, 2018
README.md
Rakefile Add linter to default rake task Nov 1, 2017
app.json Configure procfile to work outside of Heroku Feb 21, 2018
config.ru Fix all Rubocop linter warnings Dec 13, 2016
startup.sh Add dummy content store to startup.sh Jan 29, 2018

README.md

Collections Frontend

Collections serves the GOV.UK navigation pages and organisation pages.

Browse page Topic page Subtopic page Services and information page Taxonomy page Worldwide taxonomy page Organisation index page Organisation page

(As of June 2018)

Live examples

Nomenclature

Topics

  • Curated list: a group of content tagged to a subtopic that has been curated into a named list.
  • Topic: a named group of sub-topics. (A deprecated name for this is "specialist sector".)
  • Sub-topic: a group of content within a topic. (A deprecated name for this is "specialist sub-sector".)

Browse pages

Taxonomy

The taxonomy is surfaced on taxon pages, which group together tagged content for that level of the taxonomy into supergroups on the page, e.g: Guidance and Regulation for Funding and finance for students gov.uk/education/funding-and-finance-for-students. Each taxon page also shows a grid of sub-topics at the next level of the taxonomy.

Worldwide taxonomy

The worldwide taxonomy is rendered on different types of pages depending on whether the taxon has any children.

For example:

  • Taxon with children: a content item of type taxon that has child_taxons links. None of those child taxons' links have child_taxons, in which case we display an accordion view: gov.uk/world/afghanistan
  • Taxon without children: a content item of type taxon that doesn't have child_taxons links. In this case we display an leaf view: gov.uk/world/living-in-afghanistan
  • Taxon with associated taxons: a content item of type taxon that has associated_taxons links. In this case the tagged content of the taxon will include content that is directly tagged to it and also content that has been tagged to any of the associated taxons.

Technical documentation

This is a public facing Ruby on Rails application that retrieves browse content from APIs and presents it. There is no underlying persistence layer and all content is retrieved from external sources.

Whitehall email and feed links for World Locations

A special case exists within Collections to allow email links on Taxon pages to be generated such that they point to the email subscription logic in Whitehall. This is currently implemented in app/helpers/email_helper.rb with the branching logic sitting in app/views/taxons/_email_alerts.html.

The intention is to migrate rendering of World Location pages from Whitehall to Collections. Whitehall serves these from /government/world/{world_location}. Collections will serve these from /world/{world_location}.

The helper currently tests for base_path starting with /world and provides two methods; one to create an atom link and one to create an email link.

Once email subscriptions for World Locations have been completely ported to use Email Alert Api, this functionality can be removed.

Content for taxon pages

Content for taxon pages is returned by a search in Rummager based on content_ids for world taxonomy pages and content_ids and supergroups for all other taxonomy pages.

Dependencies

  • content-store, provides:
    • Mainstream browse pages (Root, Top and Second level browse pages)
    • Topics
    • Subtopics and their curated lists
  • rummager, provides:
    • latest changes for Topics
    • content tagged to a particular Topic, Mainstream browse page or Organisation
  • email-alert-api, provides:
    • support for subscribing to notifications from a topic

Running the application

./startup.sh

The app should start on http://localhost:3070 or http://collections.dev.gov.uk on GOV.UK development machines.

./startup.sh --live

This will run the app and point it at the production GOV.UK content-store and static instances.

./startup.sh --dummy

This will run the app and point it at the dummy content store, which serves the content schema examples and random content.

Running the test suite

Use bundle exec rake to run the test suite, excluding JavaScript

Javascript tests

Use bundle exec rake spec:javascript to run Jasmine tests Alternatively, visit collections.dev.gov.uk/specs for a live debugger in your browser

License

MIT License