From 30d391adda31b441a5c67d4ca51438f5a5976476 Mon Sep 17 00:00:00 2001 From: syed-ali-tw Date: Tue, 6 Aug 2024 15:47:35 +0100 Subject: [PATCH 1/3] Add erb_lint dependency for erb file linting --- .erb-lint.yml | 40 ++++++++++++++++++++++++++++++++++++++++ Gemfile | 1 + Gemfile.lock | 16 ++++++++++++++++ lib/tasks/lint.rake | 5 +++++ 4 files changed, 62 insertions(+) create mode 100644 .erb-lint.yml diff --git a/.erb-lint.yml b/.erb-lint.yml new file mode 100644 index 000000000..fc4af28c2 --- /dev/null +++ b/.erb-lint.yml @@ -0,0 +1,40 @@ +--- +EnableDefaultLinters: false +glob: "**/*.{html,text,js}{+*,}.erb" +exclude: + - '**/vendor/**/*' + - '**/node_modules/**/*' +linters: + SpaceAroundErbTag: + enabled: true + Rubocop: + enabled: true + exclude: + - "**/vendor/**/*" + - "**/vendor/**/.*" + - "bin/**" + - "db/**/*" + - "spec/**/*" + - "config/**/*" + - "node_modules/**/*" + rubocop_config: + inherit_from: + - .rubocop.yml + AllCops: + DisabledByDefault: true + Layout/InitialIndentation: + Enabled: false + Layout/TrailingEmptyLines: + Enabled: false + Layout/TrailingWhitespace: + Enabled: false + Naming/FileName: + Enabled: false + Style/FrozenStringLiteralComment: + Enabled: false + Layout/LineLength: + Enabled: false + Lint/UselessAssignment: + Enabled: false + Layout/FirstHashElementIndentation: + Enabled: false diff --git a/Gemfile b/Gemfile index cf012ca12..4e2045ff6 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ gem "aws-sdk-s3", "~> 1" gem "bootsnap", require: false gem "bootstrap-kaminari-views" gem "diffy" +gem "erb_lint" gem "erubis" gem "flipflop" gem "gds-api-adapters" diff --git a/Gemfile.lock b/Gemfile.lock index cdcfd6ade..e29141c29 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,6 +96,13 @@ GEM aws-sigv4 (1.9.1) aws-eventstream (~> 1, >= 1.0.2) base64 (0.2.0) + better_html (2.1.1) + actionview (>= 6.0) + activesupport (>= 6.0) + ast (~> 2.0) + erubi (~> 1.4) + parser (>= 2.4) + smart_properties bigdecimal (3.1.8) bootsnap (1.18.4) msgpack (~> 1.2) @@ -143,6 +150,13 @@ GEM diffy (3.4.2) docile (1.4.0) domain_name (0.6.20240107) + erb_lint (0.6.0) + activesupport + better_html (>= 2.0.1) + parser (>= 2.7.1.4) + rainbow + rubocop (>= 1) + smart_properties erubi (1.13.0) erubis (2.7.0) execjs (2.9.1) @@ -748,6 +762,7 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) + smart_properties (1.17.0) snaky_hash (2.0.1) hashie version_gem (~> 1.1, >= 1.1.1) @@ -819,6 +834,7 @@ DEPENDENCIES climate_control database_cleaner-mongoid diffy + erb_lint erubis factory_bot_rails flipflop diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake index 3817bfb01..28def6270 100644 --- a/lib/tasks/lint.rake +++ b/lib/tasks/lint.rake @@ -1,5 +1,10 @@ desc "Run all linters" task lint: :environment do + if Rails.env.development? + sh "bundle exec erblint --lint-all --autocorrect" + else + sh "bundle exec erblint --lint-all" + end sh "bundle exec rubocop" sh "yarn run lint" end From f4725a90e011d96d4ac3596f0bbfe99c02cdf16c Mon Sep 17 00:00:00 2001 From: syed-ali-tw Date: Tue, 6 Aug 2024 15:48:51 +0100 Subject: [PATCH 2/3] Autocorrect erb_lint violations --- app/views/answers/_fields.html.erb | 6 +-- app/views/artefacts/new.html.erb | 6 +-- app/views/campaigns/_fields.html.erb | 4 +- app/views/campaigns/_image_upload.html.erb | 2 +- .../completed_transactions/_fields.html.erb | 34 ++++++++--------- app/views/downtimes/_datetime_fields.html.erb | 4 +- app/views/downtimes/_form.html.erb | 2 +- app/views/downtimes/_time_input.html.erb | 11 +++--- app/views/downtimes/delete.html.erb | 10 ++--- app/views/downtimes/edit.html.erb | 14 +++---- app/views/downtimes/index.html.erb | 12 +++--- app/views/downtimes/new.html.erb | 14 +++---- app/views/editions/_reviewer_field.html.erb | 2 +- app/views/editions/diagram.html.erb | 2 +- app/views/editions/diff.html.erb | 2 +- app/views/editions/show.html.erb | 10 ++--- .../event_mailer/_approve_fact_check.text.erb | 2 +- .../event_mailer/_approve_review.text.erb | 2 +- app/views/event_mailer/_assign.text.erb | 4 +- .../_cancel_scheduled_publishing.text.erb | 2 +- app/views/event_mailer/_create.text.erb | 2 +- app/views/event_mailer/_new_version.text.erb | 2 +- app/views/event_mailer/_publish.text.erb | 2 +- .../event_mailer/_receive_fact_check.text.erb | 2 +- .../event_mailer/_request_amendments.text.erb | 2 +- .../event_mailer/_request_review.text.erb | 2 +- .../event_mailer/_resend_fact_check.text.erb | 2 +- .../_schedule_for_publishing.text.erb | 2 +- .../event_mailer/_send_fact_check.text.erb | 4 +- .../event_mailer/_skip_fact_check.text.erb | 2 +- app/views/event_mailer/_skip_review.text.erb | 2 +- app/views/event_mailer/_start_work.text.erb | 2 +- .../event_mailer/request_fact_check.text.erb | 2 +- app/views/guides/_fields.html.erb | 8 ++-- app/views/help_pages/_fields.html.erb | 6 +-- .../homepage/popular_links/_sidebar.html.erb | 8 ++-- .../_version_and_status.html.erb | 8 ++-- .../homepage/popular_links/edit.html.erb | 8 ++-- .../homepage/popular_links/show.html.erb | 6 +-- app/views/layouts/design_system.html.erb | 4 +- app/views/layouts/legacy_application.html.erb | 14 +++---- app/views/legacy_root/_amends_needed.html.erb | 2 +- app/views/legacy_root/_archived.html.erb | 2 +- app/views/legacy_root/_drafts.html.erb | 2 +- .../legacy_root/_fact_check_received.html.erb | 2 +- app/views/legacy_root/_in_review.html.erb | 2 +- .../legacy_root/_out_for_fact_check.html.erb | 2 +- app/views/legacy_root/_publication.html.erb | 12 +++--- app/views/legacy_root/_published.html.erb | 2 +- app/views/legacy_root/_ready.html.erb | 2 +- .../_scheduled_for_publishing.html.erb | 2 +- app/views/legacy_root/index.html.erb | 12 +++--- app/views/licences/_fields.html.erb | 6 +-- app/views/licences/new.html.erb | 6 +-- .../_link_check_report.html.erb | 10 ++--- app/views/link_check_reports/create.js.erb | 2 +- app/views/link_check_reports/show.js.erb | 2 +- .../_devolved_administrations.html.erb | 8 ++-- app/views/local_transactions/_fields.html.erb | 12 +++--- app/views/local_transactions/new.html.erb | 6 +-- app/views/places/_fields.html.erb | 10 ++--- app/views/programmes/_fields.html.erb | 6 +-- app/views/reports/index.html.erb | 32 ++++++++-------- app/views/shared/_clone_buttons.html.erb | 2 +- .../_common_edition_attributes.html.erb | 6 +-- .../shared/_common_part_attributes.html.erb | 14 +++---- .../shared/_edition_activity_fields.html.erb | 15 +++++--- app/views/shared/_edition_header.html.erb | 4 +- app/views/shared/_error_summary.html.erb | 2 +- app/views/shared/_fact_check.html.erb | 2 +- .../shared/_fact_check_received.html.erb | 8 ++-- app/views/shared/_flash.html.erb | 6 +-- app/views/shared/_history.html.erb | 8 ++-- app/views/shared/_important_note.html.erb | 4 +- app/views/shared/_metadata.html.erb | 8 ++-- app/views/shared/_part.html.erb | 2 +- app/views/shared/_ready.html.erb | 4 +- .../_ready_or_review_or_fact_check.html.erb | 10 ++--- .../shared/_related_external_links.html.erb | 6 +-- app/views/shared/_review.html.erb | 8 ++-- app/views/shared/_tagging.html.erb | 38 +++++++++---------- app/views/shared/_unpublish.html.erb | 6 +-- app/views/shared/_workflow_buttons.html.erb | 6 +-- .../simple_smart_answers/_fields.html.erb | 6 +-- app/views/simple_smart_answers/_node.html.erb | 6 +-- app/views/transactions/_fields.html.erb | 16 ++++---- app/views/user_search/index.html.erb | 6 +-- app/views/videos/_fields.html.erb | 6 +-- 88 files changed, 289 insertions(+), 287 deletions(-) diff --git a/app/views/answers/_fields.html.erb b/app/views/answers/_fields.html.erb index 5706828cc..ad99bef3b 100644 --- a/app/views/answers/_fields.html.erb +++ b/app/views/answers/_fields.html.erb @@ -5,15 +5,15 @@

Edit Answer

- <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %> <%= form_group(f, :body) do %> <%= f.text_area :body, rows: 20, disabled: @resource.locked_for_edits?, class: "input-md-10 form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %> -<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/artefacts/new.html.erb b/app/views/artefacts/new.html.erb index be7bda516..4f1818c5c 100644 --- a/app/views/artefacts/new.html.erb +++ b/app/views/artefacts/new.html.erb @@ -1,11 +1,11 @@ <%= content_for :page_title, "New artefact" %> -<%= form_for(@artefact, html: { class: 'artefact', id: 'edit_artefact' }) do |f| %> +<%= form_for(@artefact, html: { class: "artefact", id: "edit_artefact" }) do |f| %>

<%= yield :page_title %>

-<%= render :partial => 'shared/legacy_error_summary', locals: { object: @artefact} %> +<%= render :partial => "shared/legacy_error_summary", locals: { object: @artefact} %>
@@ -24,7 +24,7 @@ <%= f.select :kind, formats.map { |s| [s.humanize, s]}, { include_blank: "Select a format" }, { class: "input-md-4 form-control" } %> <% end %> - <%= f.hidden_field :owning_app, value: 'publisher' %> + <%= f.hidden_field :owning_app, value: "publisher" %> <%= form_group(f, :language) do %> <%= f.select :language, { "English" => "en", "Welsh" => "cy" }, {}, { class: "input-md-4 form-control" } %> diff --git a/app/views/campaigns/_fields.html.erb b/app/views/campaigns/_fields.html.erb index 5b203404c..007457a9c 100644 --- a/app/views/campaigns/_fields.html.erb +++ b/app/views/campaigns/_fields.html.erb @@ -1,7 +1,7 @@
- <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %>
@@ -69,4 +69,4 @@
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/campaigns/_image_upload.html.erb b/app/views/campaigns/_image_upload.html.erb index f5b5c0a77..da980d166 100644 --- a/app/views/campaigns/_image_upload.html.erb +++ b/app/views/campaigns/_image_upload.html.erb @@ -14,7 +14,7 @@ <% end %>

<% end %> -

<%= label_tag do %>Remove image? <%= check_box_tag "edition[remove_#{format}_image]", "1", false, disabled: @resource.locked_for_edits?, class: 'js-no-ajax' %><% end %>

+

<%= label_tag do %>Remove image? <%= check_box_tag "edition[remove_#{format}_image]", "1", false, disabled: @resource.locked_for_edits?, class: "js-no-ajax" %><% end %>

<% end %>
diff --git a/app/views/completed_transactions/_fields.html.erb b/app/views/completed_transactions/_fields.html.erb index d523a99ed..37b248d2b 100644 --- a/app/views/completed_transactions/_fields.html.erb +++ b/app/views/completed_transactions/_fields.html.erb @@ -5,7 +5,7 @@

Edit Completed transaction

- <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %> <%= form_group(f, :body, help: "The body text is overwritten by the service feedback survey") do %> <%= f.text_area :body, rows: 20, disabled: "disabled", class: "input-md-10 form-control" %> @@ -27,25 +27,25 @@

- <%= f.radio_button :promotion_choice, 'none', - { checked: (f.object.promotion_choice == "none"), disabled: @resource.locked_for_edits?, class: 'promotion-choice-none' } %> - <%= f.label :promotion_choice, "Don't promote anything on this page", value: 'none' %> + <%= f.radio_button :promotion_choice, "none", + { checked: (f.object.promotion_choice == "none"), disabled: @resource.locked_for_edits?, class: "promotion-choice-none" } %> + <%= f.label :promotion_choice, "Don't promote anything on this page", value: "none" %>
- <%= f.radio_button :promotion_choice, 'organ_donor', - { checked: (f.object.promotion_choice == "organ_donor"), disabled: @resource.locked_for_edits?, class: 'promotion-choice-organ-donor' } %> - <%= f.label :promotion_choice, "Promote organ donation", value: 'organ_donor' %> + <%= f.radio_button :promotion_choice, "organ_donor", + { checked: (f.object.promotion_choice == "organ_donor"), disabled: @resource.locked_for_edits?, class: "promotion-choice-organ-donor" } %> + <%= f.label :promotion_choice, "Promote organ donation", value: "organ_donor" %>
- <%= f.radio_button :promotion_choice, 'bring_id_to_vote', - { checked: (f.object.promotion_choice == "bring_id_to_vote"), disabled: @resource.locked_for_edits?, class: 'promotion-choice-bring-id-to-vote' } %> - <%= f.label :promotion_choice, "Promote bring photo ID to vote", value: 'bring_id_to_vote' %> + <%= f.radio_button :promotion_choice, "bring_id_to_vote", + { checked: (f.object.promotion_choice == "bring_id_to_vote"), disabled: @resource.locked_for_edits?, class: "promotion-choice-bring-id-to-vote" } %> + <%= f.label :promotion_choice, "Promote bring photo ID to vote", value: "bring_id_to_vote" %>
- <%= f.radio_button :promotion_choice, 'mot_reminder', - { checked: (f.object.promotion_choice == "mot_reminder"), disabled: @resource.locked_for_edits?, class: 'promotion-choice-mot-reminder' } %> - <%= f.label :promotion_choice, "Promote MOT reminders", value: 'mot_reminder' %> + <%= f.radio_button :promotion_choice, "mot_reminder", + { checked: (f.object.promotion_choice == "mot_reminder"), disabled: @resource.locked_for_edits?, class: "promotion-choice-mot-reminder" } %> + <%= f.label :promotion_choice, "Promote MOT reminders", value: "mot_reminder" %>
- <%= f.radio_button :promotion_choice, 'electric_vehicle', - { checked: (f.object.promotion_choice == "electric_vehicle"), disabled: @resource.locked_for_edits?, class: 'promotion-choice-electric-vehicle' } %> - <%= f.label :promotion_choice, "Promote electric vehicles", value: 'electric_vehicle' %> + <%= f.radio_button :promotion_choice, "electric_vehicle", + { checked: (f.object.promotion_choice == "electric_vehicle"), disabled: @resource.locked_for_edits?, class: "promotion-choice-electric-vehicle" } %> + <%= f.label :promotion_choice, "Promote electric vehicles", value: "electric_vehicle" %> <%= form_group(f, :promotion_choice_url, attributes: { id: "promotion-choice-url" }) do %> <%= f.text_field :promotion_choice_url, disabled: @resource.locked_for_edits?, class: "input-md-8 form-control" %> @@ -63,4 +63,4 @@
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/downtimes/_datetime_fields.html.erb b/app/views/downtimes/_datetime_fields.html.erb index eb7dd10f7..acf10eb0b 100644 --- a/app/views/downtimes/_datetime_fields.html.erb +++ b/app/views/downtimes/_datetime_fields.html.erb @@ -26,7 +26,7 @@
<%= render "govuk_publishing_components/components/fieldset", { legend_text: date_legend_text, - heading_size: "m" + heading_size: "m", } do %> <%= render "govuk_publishing_components/components/date_input", { hint: "For example, 01 08 2022", @@ -38,7 +38,7 @@
<%= render "govuk_publishing_components/components/fieldset", { legend_text: time_legend_text, - heading_size: "m" + heading_size: "m", } do %> <%= render "time_input", { hint: "For example, 9:30 or 19:30", diff --git a/app/views/downtimes/_form.html.erb b/app/views/downtimes/_form.html.erb index 8a64f5f4d..ca1c6b926 100644 --- a/app/views/downtimes/_form.html.erb +++ b/app/views/downtimes/_form.html.erb @@ -80,7 +80,7 @@ margin_bottom: 8, label: { heading_size: "m", - text: "Message" + text: "Message", }, hint: "Message is auto-generated once a schedule has been made.", id: "downtime_message", diff --git a/app/views/downtimes/_time_input.html.erb b/app/views/downtimes/_time_input.html.erb index 9af41dca0..63f888fbe 100644 --- a/app/views/downtimes/_time_input.html.erb +++ b/app/views/downtimes/_time_input.html.erb @@ -1,10 +1,9 @@ <% - id ||= "input-#{SecureRandom.hex(4)}" name ||= nil items ||= [ { :name => "hour", :width => 2 }, - { :name => "minute", :width => 2 } + { :name => "minute", :width => 2 }, ] legend_text ||= nil @@ -37,7 +36,7 @@ <%= render "govuk_publishing_components/components/hint", { id: hint_id, text: hint, - margin_bottom: 2 + margin_bottom: 2, } %> <% end %> @@ -54,7 +53,7 @@ <%= tag.div class: "govuk-date-input__item" do %> <%= render "govuk_publishing_components/components/input", { label: { - text: item[:label] || item[:name].capitalize + text: item[:label] || item[:name].capitalize, }, grouped: true, has_error: has_error, @@ -63,7 +62,7 @@ width: item[:width], id: item[:id], type: "number", - data: item[:data] + data: item[:data], } %> <% end %> <% end %> @@ -75,7 +74,7 @@ describedby: aria_described_by, legend_text: legend_text, text: fieldset_content, - role: "group" + role: "group", } %> <% else %> <%= fieldset_content %> diff --git a/app/views/downtimes/delete.html.erb b/app/views/downtimes/delete.html.erb index 036c1612c..8a09a160c 100644 --- a/app/views/downtimes/delete.html.erb +++ b/app/views/downtimes/delete.html.erb @@ -1,17 +1,17 @@ -<% content_for :page_title, 'Remove downtime message' %> -<% content_for :title, 'Remove downtime message' %> +<% content_for :page_title, "Remove downtime message" %> +<% content_for :title, "Remove downtime message" %>
<%= render "govuk_publishing_components/components/lead_paragraph", { text: "Are you sure you want to remove the scheduled downtime message for \"#{@downtime.artefact.name}\"?", - margin_bottom: 8 + margin_bottom: 8, } %> - <%= form_for @downtime, url: edition_downtime_path(@edition), html: { class: 'form well remove-top-margin', 'data-module': 'downtime-message' } do |f| %> + <%= form_for @downtime, url: edition_downtime_path(@edition), html: { class: "form well remove-top-margin", 'data-module': "downtime-message" } do |f| %>
<%= render "govuk_publishing_components/components/button", { text: "Remove", - destructive: true + destructive: true, } %> <%= link_to "Cancel", downtimes_path, class: "govuk-link govuk-link--no-visited-state" %>
diff --git a/app/views/downtimes/edit.html.erb b/app/views/downtimes/edit.html.erb index 9318d0b24..17371c999 100644 --- a/app/views/downtimes/edit.html.erb +++ b/app/views/downtimes/edit.html.erb @@ -1,23 +1,23 @@ -<% content_for :page_title, 'Edit downtime message' %> -<% content_for :title, 'Edit downtime message' %> +<% content_for :page_title, "Edit downtime message" %> +<% content_for :title, "Edit downtime message" %> <% content_for :title_context, @downtime.artefact.name %> <% unless @downtime.errors.empty? %> - <% content_for :error_summary, render("shared/error_summary", { object: @downtime }) %> + <% content_for :error_summary, render("shared/error_summary", { object: @downtime }) %> <% end %>
<%= render "govuk_publishing_components/components/lead_paragraph", { text: "Downtime message appear on the service's start page one day before the downtime is due to occur.", - margin_bottom: 6 + margin_bottom: 6, } %> -<%= form_for @downtime, url: edition_downtime_path(@edition), html: { class: 'form well remove-top-margin', 'data-module': 'downtime-message' } do |f| %> - <%= render 'form', f: f %> +<%= form_for @downtime, url: edition_downtime_path(@edition), html: { class: "form well remove-top-margin", 'data-module': "downtime-message" } do |f| %> + <%= render "form", f: f %>
<%= render "govuk_publishing_components/components/button", { text: "Save", value: "save", - name: "save" + name: "save", } %> <%= link_to "Cancel", downtimes_path, class: "govuk-link govuk-link--no-visited-state" %> diff --git a/app/views/downtimes/index.html.erb b/app/views/downtimes/index.html.erb index da7c746cf..29d2f8c37 100644 --- a/app/views/downtimes/index.html.erb +++ b/app/views/downtimes/index.html.erb @@ -1,11 +1,11 @@ -<% content_for :page_title, 'Downtime messages' %> +<% content_for :page_title, "Downtime messages" %> <% content_for :title, "Downtime messages" %>
<%= render "govuk_publishing_components/components/lead_paragraph", { text: "Show a message on a published transaction start page for a specific time.", - margin_bottom: 6 + margin_bottom: 6, } %> <%= render "govuk_publishing_components/components/table", { @@ -19,12 +19,12 @@ text: "Service Status", }, { - text: tag.span("Action", class: "govuk-visually-hidden") + text: tag.span("Action", class: "govuk-visually-hidden"), }, { - text: tag.span("Link to view live on GOV.UK", class: "govuk-visually-hidden") - } + text: tag.span("Link to view live on GOV.UK", class: "govuk-visually-hidden"), + }, ], - rows: transactions_table_entries(@transactions.to_a) + rows: transactions_table_entries(@transactions.to_a), } %>
diff --git a/app/views/downtimes/new.html.erb b/app/views/downtimes/new.html.erb index 3905d8844..5879b7704 100644 --- a/app/views/downtimes/new.html.erb +++ b/app/views/downtimes/new.html.erb @@ -1,24 +1,24 @@ -<% content_for :page_title, 'Schedule downtime' %> -<% content_for :title, 'Add downtime message' %> +<% content_for :page_title, "Schedule downtime" %> +<% content_for :title, "Add downtime message" %> <% content_for :title_context, @downtime.artefact.name %> <% unless @downtime.errors.empty? %> - <% content_for :error_summary, render("shared/error_summary", { object: @downtime }) %> + <% content_for :error_summary, render("shared/error_summary", { object: @downtime }) %> <% end %>
<%= render "govuk_publishing_components/components/lead_paragraph", { text: "Downtime message appear on the service's start page one day before the downtime is due to occur.", - margin_bottom: 6 + margin_bottom: 6, } %> - <%= form_for @downtime, url: edition_downtime_path(@edition), html: { class: 'form well remove-top-margin', 'data-module' => 'downtime-message' } do |f| %> - <%= render 'form', f: f %> + <%= form_for @downtime, url: edition_downtime_path(@edition), html: { class: "form well remove-top-margin", "data-module" => "downtime-message" } do |f| %> + <%= render "form", f: f %>
<%= render "govuk_publishing_components/components/button", { text: "Save", value: "save", - name: "save" + name: "save", } %> <%= link_to "Cancel", downtimes_path, class: "govuk-link govuk-link--no-visited-state" %> diff --git a/app/views/editions/_reviewer_field.html.erb b/app/views/editions/_reviewer_field.html.erb index a19cd1f20..390dcae1d 100644 --- a/app/views/editions/_reviewer_field.html.erb +++ b/app/views/editions/_reviewer_field.html.erb @@ -1,3 +1,3 @@ <%= form_group(f, :reviewer, label: "Reviewer") do %> - <%= f.select :reviewer, User.enabled.order_by([[:name, :asc]]).collect{ |p| [p.name, p.name] }, { :include_blank => true }, { :class => "form-control input-md-3", :disabled => @resource.locked_for_edits?, "data-module" => 'assignee-select'} %> + <%= f.select :reviewer, User.enabled.order_by([[:name, :asc]]).collect{ |p| [p.name, p.name] }, { :include_blank => true }, { :class => "form-control input-md-3", :disabled => @resource.locked_for_edits?, "data-module" => "assignee-select"} %> <% end %> diff --git a/app/views/editions/diagram.html.erb b/app/views/editions/diagram.html.erb index b5894629f..7171587fc 100644 --- a/app/views/editions/diagram.html.erb +++ b/app/views/editions/diagram.html.erb @@ -1,4 +1,4 @@ -<%= render 'shared/edition_header' %> +<%= render "shared/edition_header" %>
diff --git a/app/views/editions/diff.html.erb b/app/views/editions/diff.html.erb
index 9ed8294a0..3d7f466bf 100644
--- a/app/views/editions/diff.html.erb
+++ b/app/views/editions/diff.html.erb
@@ -1,4 +1,4 @@
-  <%= render 'shared/edition_header' %>
+  <%= render "shared/edition_header" %>
 
   

<%= link_to "Back to current edition", edition_path(@resource.history.first), :class => "btn btn-default" %> diff --git a/app/views/editions/show.html.erb b/app/views/editions/show.html.erb index 62015ad06..343392388 100644 --- a/app/views/editions/show.html.erb +++ b/app/views/editions/show.html.erb @@ -1,5 +1,5 @@ <% @edition = @resource %> - <%= render 'shared/edition_header' %> + <%= render "shared/edition_header" %> <% errors_hash = errors_to_display(@edition) %> <% if !errors_hash.empty? %> @@ -25,15 +25,15 @@

-
+
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/help_pages/_fields.html.erb b/app/views/help_pages/_fields.html.erb index da612e20d..8b63347f4 100644 --- a/app/views/help_pages/_fields.html.erb +++ b/app/views/help_pages/_fields.html.erb @@ -5,15 +5,15 @@

Edit Help page

- <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %> <%= form_group(f, :body) do %> <%= f.text_area :body, rows: 20, disabled: @resource.locked_for_edits?, class: "form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %>
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/homepage/popular_links/_sidebar.html.erb b/app/views/homepage/popular_links/_sidebar.html.erb index e7af7524a..aa007adec 100644 --- a/app/views/homepage/popular_links/_sidebar.html.erb +++ b/app/views/homepage/popular_links/_sidebar.html.erb @@ -2,14 +2,14 @@ <%= render "govuk_publishing_components/components/heading", { text: "Options", font_size: "s", - padding: true + padding: true, } %> <% if @latest_popular_links.state == "published" %> <%= render "govuk_publishing_components/components/list", { items: [ primary_button_for(@latest_popular_links, create_popular_links_path, "Create new edition"), - link_to("View on GOV.UK (opens in new tab)", view_homepage_path, rel:"noreferrer noopener", target:"_blank", class: "govuk-link") - ] + link_to("View on GOV.UK (opens in new tab)", view_homepage_path, rel:"noreferrer noopener", target:"_blank", class: "govuk-link"), + ], } %> <% else %> <%= render "govuk_publishing_components/components/list", { @@ -21,4 +21,4 @@ ] } %> <% end %> -
\ No newline at end of file +
diff --git a/app/views/homepage/popular_links/_version_and_status.html.erb b/app/views/homepage/popular_links/_version_and_status.html.erb index a2abf47cf..9d3cd9f36 100644 --- a/app/views/homepage/popular_links/_version_and_status.html.erb +++ b/app/views/homepage/popular_links/_version_and_status.html.erb @@ -5,11 +5,11 @@ items: [ { field: "Edition", - value: version + value: version, }, { field: "Status", - value: status_tag - } - ] + value: status_tag, + }, + ], } %> \ No newline at end of file diff --git a/app/views/homepage/popular_links/edit.html.erb b/app/views/homepage/popular_links/edit.html.erb index 174aa495f..36dbd4703 100644 --- a/app/views/homepage/popular_links/edit.html.erb +++ b/app/views/homepage/popular_links/edit.html.erb @@ -1,6 +1,6 @@ -<% content_for :page_title, 'Edit popular links' %> -<% content_for :title, 'Edit popular links' %> -<% content_for :title_context, 'Popular on GOV.UK' %> +<% content_for :page_title, "Edit popular links" %> +<% content_for :title, "Edit popular links" %> +<% content_for :title_context, "Popular on GOV.UK" %> <% unless @latest_popular_links.errors.empty? %> <% content_for :error_summary do %> <%= render("govuk_publishing_components/components/error_summary", { @@ -11,7 +11,7 @@ text: error.message, href: "##{error.attribute.to_s}", } - end + end, }) %> <% end %> <% end %> diff --git a/app/views/homepage/popular_links/show.html.erb b/app/views/homepage/popular_links/show.html.erb index d1aa34c28..6e8458a12 100644 --- a/app/views/homepage/popular_links/show.html.erb +++ b/app/views/homepage/popular_links/show.html.erb @@ -1,6 +1,6 @@ -<% content_for :page_title, 'Popular on GOV.UK' %> -<% content_for :title, 'Popular on GOV.UK' %> -<% content_for :title_context, 'Homepage' %> +<% content_for :page_title, "Popular on GOV.UK" %> +<% content_for :title, "Popular on GOV.UK" %> +<% content_for :title_context, "Homepage" %>
<%= render "homepage/popular_links/version_and_status", version: @latest_popular_links.version_number, status: @latest_popular_links.state %> <% @latest_popular_links.link_items.each_with_index do |item, index| %> diff --git a/app/views/layouts/design_system.html.erb b/app/views/layouts/design_system.html.erb index 0710978e5..02e98e0c1 100644 --- a/app/views/layouts/design_system.html.erb +++ b/app/views/layouts/design_system.html.erb @@ -8,7 +8,7 @@ product_title: "Publisher", browser_title: yield(:page_title), environment: environment, - head: yield(:head) + head: yield(:head), } do %> <% render "layouts/google_tag_manager" %> @@ -18,7 +18,7 @@ <%= render "govuk_publishing_components/components/layout_header", { product_name: "Publisher", environment: environment, - navigation_items: navigation_items(is_editor: current_user.govuk_editor?, path: request.path, user_name: current_user.name) + navigation_items: navigation_items(is_editor: current_user.govuk_editor?, path: request.path, user_name: current_user.name), } %>
diff --git a/app/views/layouts/legacy_application.html.erb b/app/views/layouts/legacy_application.html.erb index db47a5b1d..0115f7e2b 100644 --- a/app/views/layouts/legacy_application.html.erb +++ b/app/views/layouts/legacy_application.html.erb @@ -1,4 +1,4 @@ -<% content_for :page_title, ' | GOV.UK Publisher' %> +<% content_for :page_title, " | GOV.UK Publisher" %> <% content_for :favicon do %> <% environment_style = GovukAdminTemplate.environment_style %> <% favicon = environment_style ? "favicon-#{environment_style}.png" : "favicon.png" %> @@ -16,15 +16,15 @@ <% end %> <% content_for :navbar_items do %> - <%= nav_link 'Publications', root_path %> + <%= nav_link "Publications", root_path %> <% if current_user.govuk_editor? %> - <%= nav_link 'Add artefact', new_artefact_path %> - <%= nav_link 'Downtime', downtimes_path %> + <%= nav_link "Add artefact", new_artefact_path %> + <%= nav_link "Downtime", downtimes_path %> <% end %> - <%= nav_link 'Reports', reports_path %> - <%= nav_link 'Search by user', user_search_path %> + <%= nav_link "Reports", reports_path %> + <%= nav_link "Search by user", user_search_path %> <% end %> <% content_for :content do %> @@ -59,4 +59,4 @@ <% end %> <%# use the govuk_admin_template layout %> -<%= render :template => 'layouts/govuk_admin_template' %> +<%= render :template => "layouts/govuk_admin_template" %> diff --git a/app/views/legacy_root/_amends_needed.html.erb b/app/views/legacy_root/_amends_needed.html.erb index 3b4c4dda1..1ee9aa0dc 100644 --- a/app/views/legacy_root/_amends_needed.html.erb +++ b/app/views/legacy_root/_amends_needed.html.erb @@ -8,6 +8,6 @@ - <%= render :collection => @presenter.amends_needed, :partial => 'publication', :locals => {:tab => :amends_needed} %> + <%= render :collection => @presenter.amends_needed, :partial => "publication", :locals => {:tab => :amends_needed} %> diff --git a/app/views/legacy_root/_archived.html.erb b/app/views/legacy_root/_archived.html.erb index dcf9746cf..ce0414e75 100644 --- a/app/views/legacy_root/_archived.html.erb +++ b/app/views/legacy_root/_archived.html.erb @@ -9,6 +9,6 @@ - <%= render :collection => @presenter.archived, :partial => 'publication', :locals => {:tab => :archived} %> + <%= render :collection => @presenter.archived, :partial => "publication", :locals => {:tab => :archived} %> diff --git a/app/views/legacy_root/_drafts.html.erb b/app/views/legacy_root/_drafts.html.erb index 8f172d9fb..c4f6dafbb 100644 --- a/app/views/legacy_root/_drafts.html.erb +++ b/app/views/legacy_root/_drafts.html.erb @@ -8,6 +8,6 @@ - <%= render :collection => @presenter.draft, :partial => 'publication', :locals => {:tab => :draft} %> + <%= render :collection => @presenter.draft, :partial => "publication", :locals => {:tab => :draft} %> diff --git a/app/views/legacy_root/_fact_check_received.html.erb b/app/views/legacy_root/_fact_check_received.html.erb index 7a74622c2..d197efbf3 100644 --- a/app/views/legacy_root/_fact_check_received.html.erb +++ b/app/views/legacy_root/_fact_check_received.html.erb @@ -8,6 +8,6 @@ - <%= render :collection => @presenter.fact_check_received, :partial => 'publication', :locals => {:tab => :fact_check_received} %> + <%= render :collection => @presenter.fact_check_received, :partial => "publication", :locals => {:tab => :fact_check_received} %> diff --git a/app/views/legacy_root/_in_review.html.erb b/app/views/legacy_root/_in_review.html.erb index 8485ab8c9..57af36ad6 100644 --- a/app/views/legacy_root/_in_review.html.erb +++ b/app/views/legacy_root/_in_review.html.erb @@ -10,6 +10,6 @@ - <%= render :collection => @presenter.in_review, :partial => 'publication', :locals => {:tab => :in_review} %> + <%= render :collection => @presenter.in_review, :partial => "publication", :locals => {:tab => :in_review} %> diff --git a/app/views/legacy_root/_out_for_fact_check.html.erb b/app/views/legacy_root/_out_for_fact_check.html.erb index 7449498a8..58738f103 100644 --- a/app/views/legacy_root/_out_for_fact_check.html.erb +++ b/app/views/legacy_root/_out_for_fact_check.html.erb @@ -9,6 +9,6 @@ - <%= render :collection => @presenter.fact_check, :partial => 'publication', :locals => {:tab => :fact_check} %> + <%= render :collection => @presenter.fact_check, :partial => "publication", :locals => {:tab => :fact_check} %> diff --git a/app/views/legacy_root/_publication.html.erb b/app/views/legacy_root/_publication.html.erb index 2fbe0ded2..8f2327d02 100644 --- a/app/views/legacy_root/_publication.html.erb +++ b/app/views/legacy_root/_publication.html.erb @@ -11,14 +11,14 @@ <% if publication.published? %> - <%= link_to "/#{publication.slug}", "#{Plek.website_root}/#{publication.slug}", class: 'link-muted' %> + <%= link_to "/#{publication.slug}", "#{Plek.website_root}/#{publication.slug}", class: "link-muted" %> <% elsif publication.safe_to_preview? %> - <%= link_to "/#{publication.slug}", preview_edition_path(publication), class: 'link-muted' %> + <%= link_to "/#{publication.slug}", preview_edition_path(publication), class: "link-muted" %> <% end %> · #<%= publication.version_number %> <% if tab && (tab == :published || tab == :archived) && publication.subsequent_siblings.first.present? %> - – <%= link_to "##{publication.subsequent_siblings.first.version_number} in #{publication.subsequent_siblings.first.state.humanize.downcase}", edition_path(publication.subsequent_siblings.first), class: 'link-inherit' %> + – <%= link_to "##{publication.subsequent_siblings.first.version_number} in #{publication.subsequent_siblings.first.state.humanize.downcase}", edition_path(publication.subsequent_siblings.first), class: "link-inherit" %> <% end %> @@ -56,7 +56,7 @@ <%= time_ago_in_words(publication.review_requested_at) %> - <%= render partial: 'reviewer', locals: { publication: publication } %> + <%= render partial: "reviewer", locals: { publication: publication } %> <% end %> <% if tab && tab == :published %> @@ -68,9 +68,9 @@ <% if current_user.has_editor_permissions?(publication) %> <% if publication.can_create_new_edition? %> - <%= link_to 'Create new edition', duplicate_edition_path(publication), class: 'btn btn-default', method: :post %> + <%= link_to "Create new edition", duplicate_edition_path(publication), class: "btn btn-default", method: :post %> <% elsif publication.in_progress_sibling %> - <%= link_to 'Edit newer edition', edition_path(publication.in_progress_sibling), html_options = { "class" => "btn btn-info"} %> + <%= link_to "Edit newer edition", edition_path(publication.in_progress_sibling), html_options = { "class" => "btn btn-info"} %> <% end %> <% end %> diff --git a/app/views/legacy_root/_published.html.erb b/app/views/legacy_root/_published.html.erb index 9ba324bb5..7ff5590f9 100644 --- a/app/views/legacy_root/_published.html.erb +++ b/app/views/legacy_root/_published.html.erb @@ -10,6 +10,6 @@ - <%= render :collection => @presenter.published, :partial => 'publication', :as => 'publication', :locals => {:tab => :published} %> + <%= render :collection => @presenter.published, :partial => "publication", :as => "publication", :locals => {:tab => :published} %> diff --git a/app/views/legacy_root/_ready.html.erb b/app/views/legacy_root/_ready.html.erb index 87acd4f07..4fa1ccb7c 100644 --- a/app/views/legacy_root/_ready.html.erb +++ b/app/views/legacy_root/_ready.html.erb @@ -8,6 +8,6 @@ - <%= render :collection => @presenter.ready, :partial => 'publication', :locals => {:tab => :ready} %> + <%= render :collection => @presenter.ready, :partial => "publication", :locals => {:tab => :ready} %> diff --git a/app/views/legacy_root/_scheduled_for_publishing.html.erb b/app/views/legacy_root/_scheduled_for_publishing.html.erb index cd28b5178..f81fc14c8 100644 --- a/app/views/legacy_root/_scheduled_for_publishing.html.erb +++ b/app/views/legacy_root/_scheduled_for_publishing.html.erb @@ -9,6 +9,6 @@ - <%= render :collection => @presenter.scheduled_for_publishing, :partial => 'publication', :locals => {:tab => :scheduled_for_publishing} %> + <%= render :collection => @presenter.scheduled_for_publishing, :partial => "publication", :locals => {:tab => :scheduled_for_publishing} %> diff --git a/app/views/legacy_root/index.html.erb b/app/views/legacy_root/index.html.erb index a0b8b84b3..25a580037 100644 --- a/app/views/legacy_root/index.html.erb +++ b/app/views/legacy_root/index.html.erb @@ -31,18 +31,18 @@ <%= select_tag("user_filter", options_for_select( - [["All", "all"], ["Nobody", "nobody"]] + + [%w[All all], %w[Nobody nobody]] + User.enabled.alphabetized.map{ |u| [u.name, u.uid] }, @user_filter - ), class: 'form-control js-user-filter', "data-module" => 'assignee-select') + ), class: "form-control js-user-filter", "data-module" => "assignee-select") %> - <%= text_field_tag "string_filter", params[:string_filter], class: 'form-control', type: "search" %> + <%= text_field_tag "string_filter", params[:string_filter], class: "form-control", type: "search" %> <%= select_tag("format_filter", options_for_select( legacy_format_filter_selection_options, - params[:format_filter] - ), class: 'form-control') %> + params[:format_filter], + ), class: "form-control") %>
@@ -58,7 +58,7 @@
<%= render @list %> - <%= paginate @presenter.send(@list), theme: 'twitter-bootstrap-3' %> + <%= paginate @presenter.send(@list), theme: "twitter-bootstrap-3" %>
diff --git a/app/views/licences/_fields.html.erb b/app/views/licences/_fields.html.erb index 3db441eb4..d9e505e64 100644 --- a/app/views/licences/_fields.html.erb +++ b/app/views/licences/_fields.html.erb @@ -5,7 +5,7 @@

Edit License

- <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %> <%= form_group(f, :licence_identifier, label: "Licence identifier") do %> <%= f.text_field :licence_identifier, disabled: @resource.locked_for_edits?, class: "input-md-3 form-control" %> @@ -25,11 +25,11 @@ <%= form_group(f, :licence_overview) do %> <%= f.text_area :licence_overview, rows: 20, disabled: @resource.locked_for_edits?, class: "input-md-10 form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %>
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/licences/new.html.erb b/app/views/licences/new.html.erb index f75f713e4..388a7b188 100644 --- a/app/views/licences/new.html.erb +++ b/app/views/licences/new.html.erb @@ -8,9 +8,9 @@ We need a bit more information to create your licence.

-<%= render :partial => 'shared/legacy_error_summary', locals: { object: @publication } %> +<%= render :partial => "shared/legacy_error_summary", locals: { object: @publication } %> -<%= form_for(@publication, :url => editions_path, :as => :edition, :html => { :id => 'edition-form' } ) do |f| %> +<%= form_for(@publication, :url => editions_path, :as => :edition, :html => { :id => "edition-form" } ) do |f| %> <%= form_group(f, :licence_identifier) do %> <%= f.text_field :licence_identifier, class: "form-control" %> <% end %> @@ -21,5 +21,5 @@ <%= f.hidden_field :title %> <%= f.hidden_field :slug %> - <%= f.submit "Create Licence edition", class: 'btn btn-success' %> + <%= f.submit "Create Licence edition", class: "btn btn-success" %> <% end %> diff --git a/app/views/link_check_reports/_link_check_report.html.erb b/app/views/link_check_reports/_link_check_report.html.erb index d581d2606..ce41f417d 100644 --- a/app/views/link_check_reports/_link_check_report.html.erb +++ b/app/views/link_check_reports/_link_check_report.html.erb @@ -5,14 +5,14 @@ - <%= render 'link_check_reports/form', edition: edition, button_text: 'Check for broken links' %> + <%= render "link_check_reports/form", edition: edition, button_text: "Check for broken links" %> <% elsif report.in_progress? %> <% elsif report.broken_links.any? || report.caution_links.any? %> @@ -24,7 +24,7 @@
    <% links.each do |link| %>
  • - <%= link_to link.uri.truncate(50), link.uri, title: link.uri, class: 'link-inherit' %> + <%= link_to link.uri.truncate(50), link.uri, title: link.uri, class: "link-inherit" %>
    See more details about this link

    <%= link.problem_summary %>

    @@ -36,12 +36,12 @@ <% end %>
<% end %> - <%= render 'link_check_reports/form', edition: edition, button_text: 'Check again' %> + <%= render "link_check_reports/form", edition: edition, button_text: "Check again" %> <% else %>

This edition contains no broken links.

- <%= render 'link_check_reports/form', edition: edition, button_text: 'Check again' %> + <%= render "link_check_reports/form", edition: edition, button_text: "Check again" %>
<% end %>
diff --git a/app/views/link_check_reports/create.js.erb b/app/views/link_check_reports/create.js.erb index 743d7a7cd..c0fe0cc31 100644 --- a/app/views/link_check_reports/create.js.erb +++ b/app/views/link_check_reports/create.js.erb @@ -1 +1 @@ -$('.broken-links-report').replaceWith('<%=escape_javascript render("link_check_reports/link_check_report", report: @report, edition: @edition ) %>'); +$('.broken-links-report').replaceWith('<%= escape_javascript render("link_check_reports/link_check_report", report: @report, edition: @edition ) %>'); diff --git a/app/views/link_check_reports/show.js.erb b/app/views/link_check_reports/show.js.erb index a584d7ecb..8a89136d0 100644 --- a/app/views/link_check_reports/show.js.erb +++ b/app/views/link_check_reports/show.js.erb @@ -1,3 +1,3 @@ <% if @report.completed? %> - $('.broken-links-report').replaceWith('<%=escape_javascript render("link_check_reports/link_check_report", report: @report, edition: @edition ) %>'); + $('.broken-links-report').replaceWith('<%= escape_javascript render("link_check_reports/link_check_report", report: @report, edition: @edition ) %>'); <% end %> diff --git a/app/views/local_transactions/_devolved_administrations.html.erb b/app/views/local_transactions/_devolved_administrations.html.erb index 350ca93b3..11da60202 100644 --- a/app/views/local_transactions/_devolved_administrations.html.erb +++ b/app/views/local_transactions/_devolved_administrations.html.erb @@ -1,7 +1,7 @@ <% administrations = { "Scotland" => :scotland_availability, "Wales" => :wales_availability, - "Northern Ireland" => :northern_ireland_availability + "Northern Ireland" => :northern_ireland_availability, } %> <% administrations.each do |title, field_name| %> <%= f.fields_for field_name do |f| %> @@ -10,7 +10,7 @@
<%= f.label :type_local_authority_service, class: "control-label" do %> - <%= f.radio_button :type, 'local_authority_service', disabled: @resource.locked_for_edits? %> + <%= f.radio_button :type, "local_authority_service", disabled: @resource.locked_for_edits? %> Service available from local council <% end %>
@@ -19,7 +19,7 @@
<%= f.label :type_devolved_administration_service, class: "control-label" do %> - <%= f.radio_button :type, 'devolved_administration_service', disabled: @resource.locked_for_edits? %> + <%= f.radio_button :type, "devolved_administration_service", disabled: @resource.locked_for_edits? %> Service available from devolved administration (or a similar service is available) <% end %>
@@ -32,7 +32,7 @@
<%= f.label :type_unavailable, class: "control-label" do %> - <%= f.radio_button :type, 'unavailable', disabled: @resource.locked_for_edits? %> + <%= f.radio_button :type, "unavailable", disabled: @resource.locked_for_edits? %> Service not available <% end %>
diff --git a/app/views/local_transactions/_fields.html.erb b/app/views/local_transactions/_fields.html.erb index 098d79b14..a4312a66c 100644 --- a/app/views/local_transactions/_fields.html.erb +++ b/app/views/local_transactions/_fields.html.erb @@ -13,29 +13,29 @@ <%= f.text_field :lgil_code, disabled: @resource.locked_for_edits?, class: "input-md-4 form-control" %> <% end %> - <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %> <%= form_group(f, :introduction, label: "Introductory paragraph", help: "Set the scene for the user. Explain that it's the responsibility of the local council and that we'll take you there.") do %> <%= f.text_area :introduction, rows: 8, disabled: @resource.locked_for_edits?, class: "input-md-7 form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %> <%= form_group(f, :more_information) do %> <%= f.text_area :more_information, disabled: @resource.locked_for_edits?, class: "input-md-7 form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %> <%= form_group(f, :need_to_know, label: "What you need to know") do %> <%= f.text_area :need_to_know, rows: 4, disabled: @resource.locked_for_edits?, class: "input-md-7 form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %> - <%= render partial: 'local_transactions/devolved_administrations', locals: { f: f, resource: @resource } %> + <%= render partial: "local_transactions/devolved_administrations", locals: { f: f, resource: @resource } %>
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/local_transactions/new.html.erb b/app/views/local_transactions/new.html.erb index 1d72c712b..b20d0c70e 100644 --- a/app/views/local_transactions/new.html.erb +++ b/app/views/local_transactions/new.html.erb @@ -7,9 +7,9 @@ We need a bit more information to create your local transaction.

-<%= render :partial => 'shared/legacy_error_summary', locals: { object: @publication} %> +<%= render :partial => "shared/legacy_error_summary", locals: { object: @publication} %> -<%= form_for(@publication, as: :edition, url: editions_path, html: { id: 'edition-form', novalidate: 'novalidate' } ) do |f| %> +<%= form_for(@publication, as: :edition, url: editions_path, html: { id: "edition-form", novalidate: "novalidate" } ) do |f| %>
<%= form_group(f, :lgsl_code, label: "LGSL code") do %> <%= f.text_field :lgsl_code, class: "form-control" %> @@ -24,5 +24,5 @@ <%= f.text_field :lgil_code, class: "form-control" %> <% end %>
- <%= f.submit "Create Local transaction edition", class: 'btn btn-success' %> + <%= f.submit "Create Local transaction edition", class: "btn btn-success" %> <% end %> diff --git a/app/views/places/_fields.html.erb b/app/views/places/_fields.html.erb index e9f849285..c2725b564 100644 --- a/app/views/places/_fields.html.erb +++ b/app/views/places/_fields.html.erb @@ -5,7 +5,7 @@

Edit Place

- <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %> <%= form_group(f, :place_type, label: "This is the 'slug' assigned in the places manager app") do %> <%= f.text_field :place_type, disabled: @resource.locked_for_edits?, class: "input-md-7 form-control" %> @@ -13,23 +13,23 @@ <%= form_group(f, :introduction) do %> <%= f.text_area :introduction, rows: 5, disabled: @resource.locked_for_edits?, class: "input-md-10 form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %> <%= form_group(f, :more_information) do %> <%= f.text_area :more_information, rows: 20, disabled: @resource.locked_for_edits?, class: "input-md-10 form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %> <%= form_group(f, :need_to_know, label: "What you need to know", attributes: { class: %w[add-top-margin] }) do %> <%= f.text_area :need_to_know, rows: 4, disabled: @resource.locked_for_edits?, class: "input-md-7 form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %>
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/programmes/_fields.html.erb b/app/views/programmes/_fields.html.erb index b5c04e395..55ea13499 100644 --- a/app/views/programmes/_fields.html.erb +++ b/app/views/programmes/_fields.html.erb @@ -1,7 +1,7 @@
- <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %>
@@ -22,11 +22,11 @@
<%= f.fields_for :parts, @ordered_parts do |part| %> - <%= render partial: '/shared/common_part_attributes', locals: { f: part, editable: false, child_record_type: 'part' } %> + <%= render partial: "/shared/common_part_attributes", locals: { f: part, editable: false, child_record_type: "part" } %> <% end %>
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> diff --git a/app/views/reports/index.html.erb b/app/views/reports/index.html.erb index 356ac6c94..5356f8adb 100644 --- a/app/views/reports/index.html.erb +++ b/app/views/reports/index.html.erb @@ -4,7 +4,7 @@
<%= render "govuk_publishing_components/components/lead_paragraph", { text: "These reports are updated every hour.", - margin_bottom: 6 + margin_bottom: 6, } %> <%= render "govuk_publishing_components/components/document_list", { @@ -13,74 +13,74 @@ { link: { text: "All documents for departmental distribution", - path: organisation_content_report_path(format: :csv) + path: organisation_content_report_path(format: :csv), }, metadata: { updated_at_time: report_generated_time_message("organisation_content"), public_updated_at: report_last_updated("organisation_content"), - } + }, }, { link: { text: "Churn in non-archived editions", - path: edition_churn_report_path(format: :csv) + path: edition_churn_report_path(format: :csv), }, metadata: { updated_at_time: report_generated_time_message("edition_churn"), public_updated_at: report_last_updated("edition_churn"), - } + }, }, { link: { text: "Churn in all editions", - path: all_edition_churn_report_path(format: :csv) + path: all_edition_churn_report_path(format: :csv), }, metadata: { updated_at_time: report_generated_time_message("all_edition_churn"), public_updated_at: report_last_updated("all_edition_churn"), - } + }, }, { link: { text: "Progress on all non-archived editions", - path: progress_report_path(format: :csv) + path: progress_report_path(format: :csv), }, metadata: { updated_at_time: report_generated_time_message("editorial_progress"), public_updated_at: report_last_updated("editorial_progress"), - } + }, }, { link: { text: "Content summary and workflow history for all published editions", - path: content_workflow_report_path(format: :csv) + path: content_workflow_report_path(format: :csv), }, metadata: { updated_at_time: report_generated_time_message("content_workflow"), public_updated_at: report_last_updated("content_workflow"), - } + }, }, { link: { text: "Content summary and workflow history for all editions", - path: all_content_workflow_report_path(format: :csv) + path: all_content_workflow_report_path(format: :csv), }, metadata: { updated_at_time: report_generated_time_message("all_content_workflow"), public_updated_at: report_last_updated("all_content_workflow"), - } + }, }, { link: { text: "All URLs", - path: all_urls_report_path(format: :csv) + path: all_urls_report_path(format: :csv), }, metadata: { updated_at_time: report_generated_time_message("all_urls"), public_updated_at: report_last_updated("all_urls"), - } + }, }, - ] + ], } %>
diff --git a/app/views/shared/_clone_buttons.html.erb b/app/views/shared/_clone_buttons.html.erb index b3550e07e..807a613c8 100644 --- a/app/views/shared/_clone_buttons.html.erb +++ b/app/views/shared/_clone_buttons.html.erb @@ -8,7 +8,7 @@ <%= form_for @resource, url: duplicate_edition_path(@resource, from: edition_class.to_s), method: "post" do |f| %> <%= f.label :to, "Create as new", for: :to %> - <%= select_tag :to, options_for_select(format_conversion_select_options(@resource)), class: "form-control input-md-3 add-bottom-margin"%> + <%= select_tag :to, options_for_select(format_conversion_select_options(@resource)), class: "form-control input-md-3 add-bottom-margin" %> <%= f.submit "Change format", class: "btn btn-default" %> <% end %> <% end %> diff --git a/app/views/shared/_common_edition_attributes.html.erb b/app/views/shared/_common_edition_attributes.html.erb index 83c51d06a..aaad73d13 100644 --- a/app/views/shared/_common_edition_attributes.html.erb +++ b/app/views/shared/_common_edition_attributes.html.erb @@ -2,11 +2,11 @@ <% if current_user.has_editor_permissions?(@resource) %>
- <%= f.select :assigned_to_id, enabled_users_select_options, {}, {:class => 'form-control input-md-3', :disabled => @resource.locked_for_edits?, "data-module" => 'assignee-select'} %> + <%= f.select :assigned_to_id, enabled_users_select_options, {}, {:class => "form-control input-md-3", :disabled => @resource.locked_for_edits?, "data-module" => "assignee-select"} %>
<% end %> -<%= render partial: 'reviewer_field', locals: { f: f } if @resource.in_review? %> -<%= render partial: 'major_change_fields', locals: { f: f } if @resource.published_edition %> +<%= render partial: "reviewer_field", locals: { f: f } if @resource.in_review? %> +<%= render partial: "major_change_fields", locals: { f: f } if @resource.published_edition %> <%= form_group(f, :title, label: "Title") do %> <%= f.text_field :title, disabled: @resource.locked_for_edits?, class: "input-md-7 form-control" %> diff --git a/app/views/shared/_common_part_attributes.html.erb b/app/views/shared/_common_part_attributes.html.erb index c7dd495bd..cecea8d0c 100644 --- a/app/views/shared/_common_part_attributes.html.erb +++ b/app/views/shared/_common_part_attributes.html.erb @@ -1,19 +1,19 @@
-
+
" class="js-part-toggle-target panel-collapse collapse in" aria-expanded="true">
<% - slug_input_html = { class: 'slug form-control', disabled: !editable } + slug_input_html = { class: "slug form-control", disabled: !editable } if @resource.version_number == 1 - slug_input_html['data-accepts-generated-value'] = true + slug_input_html["data-accepts-generated-value"] = true end %> @@ -27,10 +27,10 @@ <%= render partial: "/shared/#{child_record_type}", locals: {f: f, editable: ! @resource.locked_for_edits? } %> - <%= f.hidden_field :order, class: 'order', disabled: !editable %> + <%= f.hidden_field :order, class: "order", disabled: !editable %> <% unless @resource.locked_for_edits? %> - <%= f.link_to_remove class: 'btn btn-default btn-sm' do %> + <%= f.link_to_remove class: "btn btn-default btn-sm" do %> Remove this <%= child_record_type %> <% end %> <% end %> diff --git a/app/views/shared/_edition_activity_fields.html.erb b/app/views/shared/_edition_activity_fields.html.erb index f09914806..a489f6d2b 100644 --- a/app/views/shared/_edition_activity_fields.html.erb +++ b/app/views/shared/_edition_activity_fields.html.erb @@ -36,7 +36,7 @@ <% end %> + class="form-control" cols="60" rows="14"><%= render :template => "event_mailer/request_fact_check", formats: [:text] %> <% elsif activity == :resend_fact_check %> <% latest_status_action = form_builder.object.latest_status_action %> <% if latest_status_action&.is_fact_check_request? %> @@ -62,11 +62,14 @@ Publish at * <% end %>
- <%= activity_fields.time_select :publish_at, {}, { class: 'date form-control' } %> - — - <%= activity_fields.date_select :publish_at, { order: [:day, :month, :year], - default: Date.tomorrow, start_year: Date.today.year, end_year: Date.today.year.next }, - { class: 'date form-control' } %> + <%= activity_fields.time_select :publish_at, {}, { class: "date form-control" } %> + — + <%= activity_fields.date_select :publish_at, + { order: [:day, :month, :year], + default: Date.tomorrow, + start_year: Time.zone.today.year, + end_year: Time.zone.today.year.next }, + { class: "date form-control" } %>
<% end %>

diff --git a/app/views/shared/_edition_header.html.erb b/app/views/shared/_edition_header.html.erb index ee128ed40..c4d831b45 100644 --- a/app/views/shared/_edition_header.html.erb +++ b/app/views/shared/_edition_header.html.erb @@ -9,7 +9,7 @@

<% important_note = @resource.important_note %> -<%= render partial: 'shared/important_note', locals: {important_note: @resource.important_note} %> +<%= render partial: "shared/important_note", locals: {important_note: @resource.important_note} %> <% if @resource.artefact.state == "archived" %>

You can’t edit this publication

@@ -23,5 +23,5 @@
<% else %> - <%= render 'shared/ready_or_review_or_fact_check' %> + <%= render "shared/ready_or_review_or_fact_check" %> <% end %> diff --git a/app/views/shared/_error_summary.html.erb b/app/views/shared/_error_summary.html.erb index ba1ab8b79..337ed021f 100644 --- a/app/views/shared/_error_summary.html.erb +++ b/app/views/shared/_error_summary.html.erb @@ -7,6 +7,6 @@ text: error.full_message, href: "##{model.to_s.underscore + "_" + error.attribute.to_s}", } - end + end, } %> <% end %> diff --git a/app/views/shared/_fact_check.html.erb b/app/views/shared/_fact_check.html.erb index e764c0b93..77ca6d140 100644 --- a/app/views/shared/_fact_check.html.erb +++ b/app/views/shared/_fact_check.html.erb @@ -8,6 +8,6 @@

Someone requested this edition be fact checked. We’re awaiting a response.

<% end %> <% if current_user.has_editor_permissions?(@resource) %> - <%= render 'shared/request_amendments' %> + <%= render "shared/request_amendments" %> <% end %>
diff --git a/app/views/shared/_fact_check_received.html.erb b/app/views/shared/_fact_check_received.html.erb index 224bd4e6f..22f6dff40 100644 --- a/app/views/shared/_fact_check_received.html.erb +++ b/app/views/shared/_fact_check_received.html.erb @@ -1,14 +1,14 @@

We have received a fact check response for this edition.

- <% if current_user.has_editor_permissions?(@resource)%> + <% if current_user.has_editor_permissions?(@resource) %>

Please check the response in History & Notes, and select an action below.

- <%= fact_check_buttons(@resource)%> + <%= fact_check_buttons(@resource) %>
<% if activity_forms_required? %> - <%= fact_check_forms(@resource)%> + <%= fact_check_forms(@resource) %> <% end %> - <% end%> + <% end %>
diff --git a/app/views/shared/_flash.html.erb b/app/views/shared/_flash.html.erb index 36794c8e8..9adbb4a9e 100644 --- a/app/views/shared/_flash.html.erb +++ b/app/views/shared/_flash.html.erb @@ -1,15 +1,15 @@ <% [:success, :info, :warning, :danger, :notice, :alert].select { |k| flash[k].present? }.each do |k| %> <% if k == :warning || k == :danger || k == :alert %> <%= render "govuk_publishing_components/components/error_alert", { - message: sanitize(flash[k]) + message: sanitize(flash[k]), } %> <% elsif k == :notice || k == :info %> <%= render "govuk_publishing_components/components/notice", { - description: sanitize(flash[k]) + description: sanitize(flash[k]), } %> <% elsif k == :success %> <%= render "govuk_publishing_components/components/success_alert", { - message: sanitize(flash[k]) + message: sanitize(flash[k]), } %> <% end %> <% end %> diff --git a/app/views/shared/_history.html.erb b/app/views/shared/_history.html.erb index 261ecbb66..bbebecca0 100644 --- a/app/views/shared/_history.html.erb +++ b/app/views/shared/_history.html.erb @@ -49,14 +49,14 @@ <%= f.label :comment, "Important note" %> - <%= f.text_area :comment, rows: 6, cols: 120, value: @resource.important_note ? @resource.important_note.comment : '', class: "form-control" %> + <%= f.text_area :comment, rows: 6, cols: 120, value: @resource.important_note ? @resource.important_note.comment : "", class: "form-control" %>

Add important notes that anyone who works on this edition needs to see, eg “(Doesn’t) need fact check, don’t publish.” Each edition can have only one important note at a time.

Cancel - <%= f.submit :class=>"btn btn-success", :value=>'Save important note' %> + <%= f.submit :class=>"btn btn-success", :value=>"Save important note" %>
<% end %> @@ -78,7 +78,7 @@ <% if @resource.important_note %> <%= form_for(@resource.important_note, :url=> resolve_note_path, :html => { :class => "add-left-margin inline" }, :method => "put") do |f| %> <%= hidden_field_tag :edition_id, resource.id %> - <%= f.submit :class=>"btn btn-default", :value => 'Delete important note' %> + <%= f.submit :class=>"btn btn-default", :value => "Delete important note" %> <% end %> <% end %> @@ -96,6 +96,6 @@

- <%= render collection: @resource.history, partial: '/shared/edition_history', as: 'edition' %> + <%= render collection: @resource.history, partial: "/shared/edition_history", as: "edition" %>
diff --git a/app/views/shared/_important_note.html.erb b/app/views/shared/_important_note.html.erb index f066f0d7d..f3222b36b 100644 --- a/app/views/shared/_important_note.html.erb +++ b/app/views/shared/_important_note.html.erb @@ -5,8 +5,8 @@ <%= action_note(@resource.important_note) %>
- Note <%= with_history ? 'updated' : 'created' %> - <% if important_note.requester.present? %> by <%= mail_to important_note.requester.email, important_note.requester.name, { class: 'link-inherit' } %><% end %> + Note <%= with_history ? "updated" : "created" %> + <% if important_note.requester.present? %> by <%= mail_to important_note.requester.email, important_note.requester.name, { class: "link-inherit" } %><% end %> <% if with_history %> See history <% end %> diff --git a/app/views/shared/_metadata.html.erb b/app/views/shared/_metadata.html.erb index 1b5d06293..a4f608118 100644 --- a/app/views/shared/_metadata.html.erb +++ b/app/views/shared/_metadata.html.erb @@ -1,7 +1,7 @@

Metadata

<% if Edition::PUBLISHING_API_DRAFT_STATES.include? publication.state %> - <%= form_for(@artefact, :html => { :class => 'artefact', :id => 'edit_artefact'}) do |f| %> + <%= form_for(@artefact, :html => { :class => "artefact", :id => "edit_artefact"}) do |f| %>
<%= f.hidden_field :id, value: @artefact.id %> @@ -15,14 +15,14 @@ <% end %>
- <%= f.submit 'Update metadata', class: "btn btn-success btn-large" %> + <%= f.submit "Update metadata", class: "btn btn-success btn-large" %> <% end %> <% else %>
- <% @artefact.attributes.slice('slug', 'language').each do |key, value| %> + <% @artefact.attributes.slice("slug", "language").each do |key, value| %> <%= content_tag :label, key.humanize, for: key %> - <%= text_field_tag key, value, class: "form-control add-bottom-margin", disabled: 'disabled' %> + <%= text_field_tag key, value, class: "form-control add-bottom-margin", disabled: "disabled" %> <% end %>
diff --git a/app/views/shared/_part.html.erb b/app/views/shared/_part.html.erb index 1e22f8051..d30214eb7 100644 --- a/app/views/shared/_part.html.erb +++ b/app/views/shared/_part.html.erb @@ -1,5 +1,5 @@ <%= form_group(f, :body) do %> <%= f.text_area :body, rows: 25, disabled: @resource.locked_for_edits?, class: "input-md-7 form-control body", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %> diff --git a/app/views/shared/_ready.html.erb b/app/views/shared/_ready.html.erb index 6802601ba..abb5697c9 100644 --- a/app/views/shared/_ready.html.erb +++ b/app/views/shared/_ready.html.erb @@ -1,6 +1,6 @@ - <% if current_user.has_editor_permissions?(@resource)%> + <% if current_user.has_editor_permissions?(@resource) %>

Request this edition to be amended further.

- <%= render 'shared/request_amendments' %> + <%= render "shared/request_amendments" %>
<% end %> diff --git a/app/views/shared/_ready_or_review_or_fact_check.html.erb b/app/views/shared/_ready_or_review_or_fact_check.html.erb index 786e5305a..94a3d3116 100644 --- a/app/views/shared/_ready_or_review_or_fact_check.html.erb +++ b/app/views/shared/_ready_or_review_or_fact_check.html.erb @@ -1,14 +1,14 @@ <% if @resource.in_review? %> - <%= render '/shared/review' %> + <%= render "/shared/review" %> <% elsif @resource.fact_check? %> - <%= render '/shared/fact_check' %> + <%= render "/shared/fact_check" %> <% elsif @resource.fact_check_received? %> - <%= render '/shared/fact_check_received' %> + <%= render "/shared/fact_check_received" %> <% elsif @resource.fact_check_skipped? %>

Fact check was skipped for this edition.

- <%= render '/shared/ready' %> + <%= render "/shared/ready" %> <% elsif @resource.ready? %> - <%= render '/shared/ready' %> + <%= render "/shared/ready" %> <% end %> diff --git a/app/views/shared/_related_external_links.html.erb b/app/views/shared/_related_external_links.html.erb index b168f8bdb..ecc86758f 100644 --- a/app/views/shared/_related_external_links.html.erb +++ b/app/views/shared/_related_external_links.html.erb @@ -12,11 +12,11 @@
<%= link.label :title, "Title" %> - <%= link.text_field :title, class: 'form-control' %> + <%= link.text_field :title, class: "form-control" %>
<%= link.label :url, "URL" %> - <%= link.text_field :url, class: 'form-control' %> + <%= link.text_field :url, class: "form-control" %>
<% unless @resource.retired_format? %> <%= link.link_to_remove "Remove this URL", class: "remove-row remove-row-related" %> @@ -34,6 +34,6 @@ <% unless @resource.retired_format? %>
- <%= f.submit 'Save links', class: "btn btn-success btn-large" %> + <%= f.submit "Save links", class: "btn btn-success btn-large" %> <% end %> <% end %> diff --git a/app/views/shared/_review.html.erb b/app/views/shared/_review.html.erb index 138a56d48..180ae2dd6 100644 --- a/app/views/shared/_review.html.erb +++ b/app/views/shared/_review.html.erb @@ -8,17 +8,17 @@ <% else %>

<%= @resource.latest_status_action(Action::REQUEST_REVIEW).requester.name %> has sent this edition to be reviewed.

- <%= review_buttons(@resource)%> + <%= review_buttons(@resource) %>
<% if activity_forms_required? %> - <%= review_forms(@resource)%> + <%= review_forms(@resource) %> <% end %> <% end %> <% else %>

We're having trouble accessing the action data. This edition has been sent to be reviewed.

- <%= review_buttons(@resource)%> + <%= review_buttons(@resource) %>
- <%= review_forms(@resource)%> + <%= review_forms(@resource) %> <% end %>
diff --git a/app/views/shared/_tagging.html.erb b/app/views/shared/_tagging.html.erb index b3f11bbb7..20d5b83fd 100644 --- a/app/views/shared/_tagging.html.erb +++ b/app/views/shared/_tagging.html.erb @@ -7,13 +7,13 @@
- <%= f.label :mainstream_browse_pages, "Mainstream browse pages", class: 'control-label' %> + <%= f.label :mainstream_browse_pages, "Mainstream browse pages", class: "control-label" %> <%= f.select :mainstream_browse_pages, @linkables.mainstream_browse_pages, {}, { multiple: true, - class: 'select2', - data: { module: "tagging", placeholder: 'Choose mainstream browse pages…' } } %> + class: "select2", + data: { module: "tagging", placeholder: "Choose mainstream browse pages\u2026" } } %>

Mainstream browse pages live under /browse. @@ -23,13 +23,13 @@

- <%= f.label :parent, "Breadcrumb", class: 'control-label' %> + <%= f.label :parent, "Breadcrumb", class: "control-label" %> <%= f.select :parent, @linkables.mainstream_browse_pages, { include_blank: true }, { multiple: false, - class: 'select2', - data: { module: "tagging", placeholder: 'Choose a breadcrumb…' } } %> + class: "select2", + data: { module: "tagging", placeholder: "Choose a breadcrumb\u2026" } } %>
- <%= f.label :organisations, "Organisations", class: 'control-label' %> + <%= f.label :organisations, "Organisations", class: "control-label" %> <%= f.select :organisations, @linkables.organisations, {}, { multiple: true, - class: 'select2', - data: { placeholder: 'Choose Organisations…' } } %> + class: "select2", + data: { placeholder: "Choose Organisations\u2026" } } %>

Tagging a page to an organisation will make it show up in search when filtered to the organisation(s). @@ -58,13 +58,13 @@

- <%= f.label :meets_user_needs, 'User Needs', class: 'control-label' %> + <%= f.label :meets_user_needs, "User Needs", class: "control-label" %> <%= f.select :meets_user_needs, @linkables.meets_user_needs, {}, { multiple: true, - class: 'select2', - data: { module: "tagging", placeholder: 'Choose user needs…' } } %> + class: "select2", + data: { module: "tagging", placeholder: "Choose user needs\u2026" } } %>

Needs are managed through Maslow, and the list of user needs which a @@ -83,16 +83,16 @@

    <% Array(@tagging_update.ordered_related_items).each do |related_item| %>
  • - <%= text_field_tag 'tagging_tagging_update_form[ordered_related_items][]', - related_item['base_path'], - class: 'form-control', - data: { title: related_item['title'] } %> + <%= text_field_tag "tagging_tagging_update_form[ordered_related_items][]", + related_item["base_path"], + class: "form-control", + data: { title: related_item["title"] } %>
  • <% end %> <% 5.times do %>
  • - <%= text_field_tag 'tagging_tagging_update_form[ordered_related_items][]', '', - class: 'form-control' %> + <%= text_field_tag "tagging_tagging_update_form[ordered_related_items][]", "", + class: "form-control" %>
  • <% end %>
@@ -112,6 +112,6 @@ <% unless @resource.retired_format? %>
- <%= f.submit 'Update tags', class: "btn btn-success btn-large" %> + <%= f.submit "Update tags", class: "btn btn-success btn-large" %> <% end %> <% end %> diff --git a/app/views/shared/_unpublish.html.erb b/app/views/shared/_unpublish.html.erb index ff3c4469f..238fc2a3c 100644 --- a/app/views/shared/_unpublish.html.erb +++ b/app/views/shared/_unpublish.html.erb @@ -15,10 +15,10 @@ For example: https://www.gov.uk/redirect-to-replacement-page - <%= text_field_tag 'redirect_url', '', class: "form-control input-md-12" %> + <%= text_field_tag "redirect_url", "", class: "form-control input-md-12" %>
- <%= button_tag 'Unpublish', - "data-module" => 'confirm', + <%= button_tag "Unpublish", + "data-module" => "confirm", "data-message" => "This will remove ‘#{@artefact.name}’ from the website.\n\n Are you sure?", :class => "btn btn-danger" %> <% end %> diff --git a/app/views/shared/_workflow_buttons.html.erb b/app/views/shared/_workflow_buttons.html.erb index b695c7749..e454e585d 100644 --- a/app/views/shared/_workflow_buttons.html.erb +++ b/app/views/shared/_workflow_buttons.html.erb @@ -7,16 +7,16 @@ <%= preview_button(@resource) %> <% if current_user.has_editor_permissions?(@resource) %> <% if @resource.can_create_new_edition? %> - <%= link_to 'Create new edition', duplicate_edition_path(@resource), class: 'btn btn-primary btn-large', method: :post %> + <%= link_to "Create new edition", duplicate_edition_path(@resource), class: "btn btn-primary btn-large", method: :post %> <% end %> <% if @resource.in_progress_sibling.present? %> - <%= link_to 'Edit existing newer edition', edition_path(@resource.in_progress_sibling), html_options: { "class" => "btn btn-primary btn-large"} %> + <%= link_to "Edit existing newer edition", edition_path(@resource.in_progress_sibling), html_options: { "class" => "btn btn-primary btn-large"} %> <% end %> <% end %> <%= progress_buttons(@resource, skip_disabled_buttons: true) %> <% else %> <% if current_user.has_editor_permissions?(@resource) && !@resource.retired_format? %> - <%= f.submit 'Save', id: 'save-edition', class: 'btn btn-success btn-large js-save' %> + <%= f.submit "Save", id: "save-edition", class: "btn btn-success btn-large js-save" %> <% end %> <%= preview_button(@resource) %> <%= progress_buttons(@resource) %> diff --git a/app/views/simple_smart_answers/_fields.html.erb b/app/views/simple_smart_answers/_fields.html.erb index 4d92f99a7..3278c03bf 100644 --- a/app/views/simple_smart_answers/_fields.html.erb +++ b/app/views/simple_smart_answers/_fields.html.erb @@ -5,12 +5,12 @@

Edit Simple smart answer

- <%= render :partial => 'shared/common_edition_attributes', :locals => {:f => f} %> + <%= render :partial => "shared/common_edition_attributes", :locals => {:f => f} %>
<%= form_group(f, :body) do %> <%= f.text_area :body, rows: 20, disabled: @resource.locked_for_edits?, class: "form-control", data: { - module: "paste-html-to-govspeak" + module: "paste-html-to-govspeak", } %> <% end %>
@@ -50,7 +50,7 @@
-<%= render partial: 'shared/workflow_buttons', locals: { f: f } %> +<%= render partial: "shared/workflow_buttons", locals: { f: f } %> <% content_for :extra_javascript do %>