Browse Source

Use govuk_link_to and govuk_button_link_to helpers

pull/117/head
Paul Robert Lloyd 3 years ago
parent
commit
69a97d34f4
  1. 4
      app/helpers/check_answers_helper.rb
  2. 4
      app/helpers/tasklist_helper.rb
  3. 2
      app/views/case_logs/_log_list.html.erb
  4. 2
      app/views/case_logs/index.html.erb
  5. 2
      app/views/devise/mailer/confirmation_instructions.html.erb
  6. 2
      app/views/devise/mailer/reset_password_instructions.html.erb
  7. 2
      app/views/devise/mailer/unlock_instructions.html.erb
  8. 12
      app/views/devise/shared/_links.html.erb
  9. 2
      app/views/form/_check_answers_table.html.erb
  10. 2
      app/views/test/index.html.erb
  11. 2
      app/views/users/account/index.html.erb

4
app/helpers/check_answers_helper.rb

@ -1,3 +1,5 @@
include GovukLinkHelper
module CheckAnswersHelper
def display_answered_questions_summary(subsection, case_log)
total = subsection.applicable_questions_count(case_log)
@ -15,6 +17,6 @@ private
def create_next_missing_question_link(subsection, case_log)
pages_to_fill_in = subsection.unanswered_questions(case_log).map(&:page)
url = "/case_logs/#{case_log.id}/#{pages_to_fill_in.first.id}"
link_to("Answer the missing questions", url, class: "govuk-link").html_safe
govuk_link_to("Answer the missing questions", url).html_safe
end
end

4
app/helpers/tasklist_helper.rb

@ -1,3 +1,5 @@
include GovukLinkHelper
module TasklistHelper
STATUSES = {
not_started: "Not started",
@ -38,6 +40,6 @@ module TasklistHelper
else
"#"
end
link_to(subsection.label, next_page_path, class: "task-name govuk-link")
govuk_link_to(subsection.label, next_page_path, class: "task-name")
end
end

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), class: "govuk-link" %>
<%= govuk_link_to log.id, case_log_path(log) %>
</th>
<td class="govuk-table__cell govuk-table__cell">
<%= log.property_postcode %>

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

@ -4,7 +4,7 @@
</div>
<div class="govuk-grid-column-two-thirds-from-desktop">
<%= link_to "Create new log", case_logs_path, method: :post, class: "govuk-button" %>
<%= govuk_button_link_to "Create new log", case_logs_path, method: :post %>
<% if @in_progress_case_logs.present? %>
<%= render partial: "log_list", locals: { case_logs: @in_progress_case_logs, title: "Logs you need to complete", date_title: "Last Changed" } %>

2
app/views/devise/mailer/confirmation_instructions.html.erb

@ -2,4 +2,4 @@
<p>You can confirm your account email through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
<p><%= govuk_link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>

2
app/views/devise/mailer/reset_password_instructions.html.erb

@ -2,7 +2,7 @@
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p><%= govuk_link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>

2
app/views/devise/mailer/unlock_instructions.html.erb

@ -4,4 +4,4 @@
<p>Click the link below to unlock your account:</p>
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
<p><%= govuk_link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>

12
app/views/devise/shared/_links.html.erb

@ -1,25 +1,25 @@
<%- if controller_name != 'sessions' %>
<p class="govuk-body">Already have an account? <%= link_to "Sign in", new_session_path(resource_name) %>.</p><br />
<p class="govuk-body">Already have an account? <%= govuk_link_to "Sign in", new_session_path(resource_name) %>.</p><br />
<% end %>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
<%= govuk_link_to "Sign up", new_registration_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<p class="govuk-body"> You can <%= link_to "reset your password", new_password_path(resource_name) %> if you've forgotten it.<p><br />
<p class="govuk-body"> You can <%= govuk_link_to "reset your password", new_password_path(resource_name) %> if you've forgotten it.<p><br />
<% end %>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<%= govuk_link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<%= govuk_link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
<% end %>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %><br />
<%= govuk_link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %><br />
<% end %>
<% end %>

2
app/views/form/_check_answers_table.html.erb

@ -6,6 +6,6 @@
<%= question.answer_label(@case_log) %>
</dd>
<dd class="govuk-summary-list__actions">
<%= link_to(question.update_answer_link_name(@case_log), "/case_logs/#{@case_log.id}/#{question.page.id}", class: "govuk-link").html_safe %>
<%= govuk_link_to(question.update_answer_link_name(@case_log), "/case_logs/#{@case_log.id}/#{question.page.id}").html_safe %>
</dd>
</div>

2
app/views/test/index.html.erb

@ -27,4 +27,4 @@
end
end %>
<%= link_to('About', about_path) %>
<%= govuk_link_to('About', about_path) %>

2
app/views/users/account/index.html.erb

@ -43,7 +43,7 @@
••••••••
</dd>
<dd class="govuk-summary-list__actions">
<%= link_to "Change", edit_user_registration_path, id: "change-password" %>
<%= govuk_link_to "Change", edit_user_registration_path, id: "change-password" %>
</dd>
</div>
<div class="govuk-summary-list__row">

Loading…
Cancel
Save