Calendars (bank holidays, clocks changing) in a clear and accessible format, along with JSON and iCal
Ruby HTML CSS Shell
Latest commit b245819 Aug 15, 2016 @jackscotti jackscotti committed on GitHub Merge pull request #117 from alphagov/upgrade-rails-fix-xss-vulnerabi…
…lity

Upgrade rails to 4.2.7.1 (CVE-2016-6316)
Permalink
Failed to load latest commit information.
app Add CORS headers for JSON requests Aug 5, 2016
bin
config
docs
lib Fix ruby style violations Mar 18, 2016
log
public Update rails to 4.2.4 Oct 12, 2015
test
vendor Initial import and model creation Nov 8, 2011
.gitignore Exclude .DS_Store files from .gitignore Dec 11, 2012
.ruby-version
Gemfile
Gemfile.lock
LICENCE.txt
README.md Add content-store as dependency of this app Sep 17, 2015
Rakefile
config.ru
jenkins-schema.sh
jenkins.sh

README.md

Calendars

Serves calendars in a clear and accessible format, along with JSON and iCal exports of the data.

Screenshots

Screenshot

Live examples

Nomenclature

  • scope: sach type of calendar (eg daylight saving, bank holidays) is known as a scope. A scope has its own view templates, JSON data source and primary route.

Technical documentation

This is a Ruby on Rails application that serves static pages based on JSON files. It does not use a database.

JSON data files are stored in lib/data/<scope>.json, with a divisions hash for separate data per region (united-kingdom, england-and-wales, scotland or northern-ireland).

Each scope's data file contains a list of divisions, containing a list of years, each with a list of events:

{
  "title": "UK bank holidays",
  "description": "UK bank holidays calendar - see UK bank holidays and public holidays for 2012 and 2013",
  "divisions": {
    "england-and-wales": {
      "title": "England and Wales",
      "2011": [{
        "title": "New Year's Day",
        "date": "02/01/2011",
        "notes": "Substitute day"
      }]
    }
  }
}

The division title attribute is optional. If this is not present the slug will be humanized and used instead.

Dependencies

  • panopticon: this app sends data to panopticon to register URLs and for search indexing.
  • publishing-api: this app sends data to the content-store.

Additional information

Publishing to GOV.UK

  • bundle exec rake panopticon:register will send the calendars to panopticon. Panopticon will register the URL and send the data to Rummager for indexing in search.

Generate bank holidays JSON

A rake task has been created to generate the bank holidays JSON for a given year. They need to be then inserted, and modified to take into account any additions/modifications made by proclamation. Run the rake task like this:

bundle exec rake bank_holidays:generate_json[2016]

Canonical sources

Running the application

bundle exec bowl calendar www

Running the test suite

bundle exec rake

Licence

MIT License