Browse Source

Bug fixes (#90)

* Use the correct blue

* Use SASS for hover

* Use govuk frontend classes

* Don't add new stylesheet
pull/91/head
Daniel Baark 3 years ago committed by GitHub
parent
commit
6c4bb79b6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/javascript/styles/_task-list.scss
  2. 9
      app/javascript/styles/application.scss
  3. 4
      app/models/case_log.rb
  4. 2
      app/views/case_logs/_log_list.html.erb
  5. 2
      app/views/case_logs/edit.html.erb

5
app/javascript/styles/_task-list.scss

@ -81,11 +81,6 @@
}
}
// turbo-frame {
// display: block;
// border: 1px solid blue
// }
.app-task-list__item:target,
.tasklist_item_highlight{
background-color: $govuk-focus-colour;

9
app/javascript/styles/application.scss

@ -11,4 +11,11 @@ $govuk-image-url-function: frontend-image-url;
@import "~govuk-frontend/govuk/all";
@import '_task-list'
@import '_task-list';
$govuk-global-styles: true;
// turbo-frame {
// display: block;
// border: 1px solid blue
// }

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

2
app/views/case_logs/_log_list.html.erb

@ -12,7 +12,7 @@
<% case_logs.map do |log| %>
<tr class="govuk-table__row">
<th scope="row" class="govuk-table__header">
<%= link_to log.id, case_log_path(log) %>
<%= link_to log.id, case_log_path(log), class: "govuk-link" %>
</th>
<td class="govuk-table__cell govuk-table__cell">
<%= log.property_postcode %>

2
app/views/case_logs/edit.html.erb

@ -9,7 +9,7 @@
<p class="govuk-body govuk-!-margin-bottom-7">You've completed <%= get_subsections_count(@form, @case_log, :completed) %> of <%= get_subsections_count(@form, @case_log, :all) %> sections.</p>
<p class="govuk-body govuk-!-margin-bottom-7">
<% next_incomplete_section=get_next_incomplete_section(@form, @case_log) %>
<a href="#<%= next_incomplete_section %>"
<a class="govuk-link" href="#<%= next_incomplete_section %>"
data-controller="tasklist"
data-action="tasklist#addHighlight"
data-info=<%= next_incomplete_section %>>

Loading…
Cancel
Save