Browse Source

Use govuk frontend classes

pull/90/head
baarkerlounger 4 years ago
parent
commit
7bc2ccbcd6
  1. 17
      app/javascript/styles/_application-custom.scss
  2. 4
      app/models/case_log.rb

17
app/javascript/styles/_application-custom.scss

@ -1,19 +1,4 @@
.a, $govuk-global-styles: true;
.govuk-link {
color: #1d70b8;
&__link:link {
color: #003078;
}
&__visited {
color: #4c2c92;
}
&__link:focus {
color: #0b0c0c;
}
&__link:hover {
color: #003078;
}
}
// turbo-frame { // turbo-frame {
// display: block; // display: block;

4
app/models/case_log.rb

@ -10,7 +10,7 @@ class CaseLogValidator < ActiveModel::Validator
# If we've come from the form UI we only want to validate the specific fields # If we've come from the form UI we only want to validate the specific fields
# that have just been submitted. If we're submitting a log via API or Bulk Upload # that have just been submitted. If we're submitting a log via API or Bulk Upload
# we want to validate all data fields. # we want to validate all data fields.
page_to_validate = options[:page] page_to_validate = record.page
if page_to_validate if page_to_validate
public_send("validate_#{page_to_validate}", record) if respond_to?("validate_#{page_to_validate}") public_send("validate_#{page_to_validate}", record) if respond_to?("validate_#{page_to_validate}")
else else
@ -41,7 +41,7 @@ class CaseLog < ApplicationRecord
default_scope -> { kept } default_scope -> { kept }
scope :not_completed, -> { where.not(status: "completed") } scope :not_completed, -> { where.not(status: "completed") }
validates_with CaseLogValidator, ({ page: @page } || {}) validates_with CaseLogValidator
before_save :update_status! before_save :update_status!
attr_accessor :page attr_accessor :page

Loading…
Cancel
Save