Permalink
Commits on Feb 7, 2017
  1. Merge pull request #3014 from alphagov/connect-offsite-link-types-for…

    …m-to-models
    
    Connect type dropdown in UI and model validations for OffsiteLinks
    h-lame committed on GitHub Feb 7, 2017
  2. Connect type dropdown in UI and model validations for OffsiteLinks

    In the UI the dropdown for allowable types was a hand-coded list that
    needs to be kept manually in sync with the list of allowable values for
    the link_type attribute.  By extracting the types to a separate concern
    we can connect the source for the validation and the source for the
    values in the dropdown.
    h-lame committed Feb 7, 2017
  3. Merge pull request #3010 from alphagov/allow-nhs.uk-urls-in-offsite-l…

    …inks
    
    Allow nhs.uk urls in offsite links
    h-lame committed on GitHub Feb 7, 2017
Commits on Feb 6, 2017
  1. Harden whitelisted urls validation for offsite links

    We want to let people use the whitelisted domains, but we need to be sure
    it's only the whitelisted domains, not things that look like them. So we
    make sure the whitelisted domain is either preceded by the start of the
    string, or by a "." indicating a subdomain (which we allow).
    
    e.g. www.nhs.uk is ok, but not-the-nhs.uk is not.
    h-lame committed Feb 1, 2017
Commits on Jan 18, 2017
  1. Merge pull request #2948 from alphagov/content-operating-model-report

    Add script for generating report for Content Operating Model team
    h-lame committed on GitHub Jan 18, 2017
Commits on Jan 5, 2017
  1. Add script for generating report for Content Operating Model team

    The report is to show the organisation, url, format, status, date of
    first publication, and date of the last change to the status for all
    the editioned documents in the system.
    
    We expect that this is a one-off, but it might be useful for the code
    that generates it to persist as this kind of report could be needed
    again, or could be used as a jumping off point for future reports.
    
    The trello card describing the report is: https://trello.com/c/e3nDUdE2/88-report-for-content-operating-model
    h-lame committed Jan 5, 2017
Commits on Dec 13, 2016
  1. Merge pull request #2921 from alphagov/its-Blog-post-not-Blog-Post

    Provide translation for blog_post document type
    h-lame committed on GitHub Dec 13, 2016
  2. Merge pull request #2923 from alphagov/copy-changes-to-10-downing-str…

    …eet-page
    
    Copy changes to 10 Downing Street history page
    h-lame committed on GitHub Dec 13, 2016
Commits on Dec 12, 2016
  1. Add "active" state to virtual tour links

    The intention is to make this list look more like the list of previous
    prime ministers by having an "off" state for the current tour.  The prime
    ministers page does this serverside by having that list entry not be a
    link.  We have to do it client-side by adding a class and having that
    change the styling to no longer look like a link.
    h-lame committed Dec 12, 2016
  2. Provide translation for blog_post document type

    Without a translation we humanize and titleize the document type so we
    get "Blog Post" but this would contravene the GOV.UK style guide so we
    provide this translation to give us "Blog post" instead.  We only have
    the English translation so the others will fall back to this, although
    we do add the empty translations to avoid causing the i18n_key_test to
    fail.
    h-lame committed Dec 12, 2016
Commits on Dec 6, 2016
  1. Merge pull request #2886 from alphagov/revert-2884-revert-2876-change…

    …-welsh-language-scheme-corp-info-page-link-text
    
    Simplify language around welsh language scheme v2
    h-lame committed on GitHub Dec 6, 2016
  2. Add new link_text translation key for corp info page types

    When translating the title of a corporate information page we always
    use the corporate_information_page.type.title.{type} key.  When writing the link
    that is used inside the sentence on the about page (the link embedded in
    the worldwide_organisation.corporate_information_page.{type}_html keys) we
    first look for a corporiate_information_page.type.link_text.{type} key before
    falling back to corporiate_information_page.type.title.{type}.  This lets
    us use "Welsh language scheme" for the page title, but "publishing in Welsh"
    for the link text.
    
    This moves the existing translations from corporate_information_page.type.{type}
    to corporate_information_page.type.title.{type} so we have to touch all the
    locale files to update them.
    h-lame committed Nov 29, 2016
Commits on Nov 29, 2016
  1. Merge pull request #2884 from alphagov/revert-2876-change-welsh-langu…

    …age-scheme-corp-info-page-link-text
    
    Revert "Simplify language around welsh language scheme"
    h-lame committed on GitHub Nov 29, 2016
  2. Merge pull request #2876 from alphagov/change-welsh-language-scheme-c…

    …orp-info-page-link-text
    
    Simplify language around welsh language scheme
    h-lame committed on GitHub Nov 29, 2016
  3. Merge pull request #2880 from alphagov/stop-role-lists-duplicating-ro…

    …les-with-translations
    
    Stop with_translations from returning duplicate records
    h-lame committed on GitHub Nov 29, 2016
Commits on Nov 28, 2016
  1. Update welsh translation for new welsh language scheme sentence

    Thanks to Rhiannon Britton from User Support for the translation assist.
    h-lame committed Nov 28, 2016
  2. Simplify language around welsh language scheme

    Go from "Find out about our commitment to publishing in the <Welsh
    language scheme>." to "Find out about our commitment to <publishing in
    Welsh>.".  This only changes the English translation, all other languages
    that have translations use the old wording and link text.
    h-lame committed Nov 25, 2016
  3. Stop with_translations from returning duplicate records

    The intention of the globalize with_translations scope when called without any
    arguments is that it will preload all translations for the records it returns.
    However, even since [#329](globalize/globalize#329)
    (released in v4.0.1 of globalize) it has done so by duplicating in the results
    any records that have multiple translations.  This is fixed in
    [#489](globalize/globalize#489) (unreleased at time of
    writing).
    
    This commit backports the fix from globalize 5.1.0 as patch with a timebomb
    that will explode when we change the version of globalize.  We also add a test
    to make sure that things still behave as we expect if we do remove the patch.
    
    We have been susceptible to this since we [upgraded to rails
    4.0.13](d215782)
    in Jan 2015 as this is when we moved to globalize 4.0.3 (from globalize3 0.3.0).
    However, we've not encountered the problem as there aren't many places where we
    use with_translations without specifying a locale in many places, or without
    some other part of the query making the result set unique.  The other reason for
    not seeing the bug much is that in the places we are using the API this way we
    don't have much data that would cause the bug (most things only have one
    english translation).  One place that did exhibit the bug is in displaying
    ministers on the org show pages (plain orgs, not worldwide orgs).  If a role
    has translations and there is a person assigned to that role then they would
    have the role listed as many times as there are translations, instead of just
    the once.
    h-lame committed Nov 28, 2016
Commits on Nov 24, 2016
  1. Merge pull request #2863 from alphagov/order-world-locations-to-respe…

    …ct-accented-characters
    
    Sort and group world locations to respect accented characters
    h-lame committed on GitHub Nov 24, 2016
Commits on Nov 23, 2016
  1. Sort and group world locations to respect accented characters

    In 3c0eb7e we changed the sort order of
    world locations on the public index page to ignore "The" prefixes, so that
    places like "The Occupied Palestinian Territories" appear under "O" not
    "T".  Unfortunately this meant sorting in ruby and this didn't respect
    accented characters, meaning places like "São Tomé and Principe" appeared
    at the end of "S" rather than inbetween "San Marino" and "Saudi Arabia".
    
    The order before we account for "The" prefixes is correct for accented
    characters, because it comes from the DB which has the correct collation
    settings.  The version of the name without the prefix does not live in the
    DB so we have to do the sort in memory, and this breaks the ordering for
    accented characters.
    
    The solution, much like that used in Frontend (alphagov/frontend#1053)
    is to use `ActiveSupport::Inflector.transliterate` to convert accented
    characters to their de-accented variants and sort using that version of
    the name.  This makes the grouping marginally more complex as we also
    use the first char of the prefix-less name to group by, and we don't want
    to create a group for the accented characters, and we don't want to
    transliterate the name twice either.
    h-lame committed Nov 23, 2016
Commits on Apr 20, 2016
Commits on Mar 1, 2016
  1. Merge pull request #2482 from alphagov/full_latest_news_for_no10_and_…

    …civilservice
    
    Link to all latest news for organisations allowed promotional features
    h-lame committed Mar 1, 2016
Commits on Feb 19, 2016
  1. Merge pull request #2471 from alphagov/reslug-dclg-management-board-g…

    …roup
    
    Reslug DCLG management board group
    h-lame committed Feb 19, 2016
Commits on Feb 18, 2016
  1. Reslug DCLG management board group

    The Title has already been changed to DCLG Departmental Board so we
    need to change the slug to match.
    h-lame committed Feb 18, 2016
Commits on Jun 4, 2013
  1. Add a .sort to the files selected by the DataMigrator

    Without this we occasionally get test failures.  I think that the order of files from Dir[] is probably undetermined, but it just so happens it often uses alphabetical order by convenient luck.
    h-lame committed Jun 4, 2013
Commits on Jun 3, 2013
  1. Stop creating imported attachments with names like blah.pdf.pdf

    The bug was that File.extname('blah.pdf') returns '.pdf' and we compare that against a whitelist of the form ['pdf', 'csv', ...].  We have to strip the trailing '.' before comparing against the contents of the whitelist.
    h-lame committed Jun 3, 2013
Commits on May 30, 2013
  1. Fix /specialist-guides/ links in detailed guide body text

    Some detailed guides have cross links to the old admin url for detailed guides /admin/specialist-guides/ and so these don't get govspokenified on frontend to refer to the public url for the latest edition of that guide.
    
    To fix we look for all published or draft detailed guides that have /specialist-guides/ urls in their body text.  We then fix them by replacing that string with /detailed-guides/.  For drafts we just save it directly, but for published editions we re-edition and then publish that one.
    h-lame committed May 30, 2013
  2. Tidy view_test in the admin edition attachments macros

    Mostly we can check the assigned object and what the state of its edition_attachments is like rather that checking that the fields are on the page.
    h-lame committed May 28, 2013