diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2729fcdc3..2ef9ad48c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -11,6 +11,13 @@ module ApplicationHelper include ActionView::Helpers::FormHelper include Kernel + # Only to be used in tailwind theme + # TODO: Generalise to support all the variants + sig { params(body: String, url: String, html_options: T::Hash[Symbol, String]).returns(String) } + def pa_link_to(body, url, html_options = {}) + link_to(body, url, class: "#{html_options[:class]} text-fuchsia font-bold hover:underline") + end + sig { params(path: String, extra_classes: T::Array[Symbol], block: T.untyped).returns(T.untyped) } def menu_item(path, extra_classes: [], &block) li_selected(current_page?(path), extra_classes:) do diff --git a/app/views/_tailwind/applications/_comments_text.html.erb b/app/views/_tailwind/applications/_comments_text.html.erb index 55a10fc39..27dbdb1cb 100644 --- a/app/views/_tailwind/applications/_comments_text.html.erb +++ b/app/views/_tailwind/applications/_comments_text.html.erb @@ -1,2 +1,2 @@ -<%= link_to pluralize(comments.count, "comment"), "#comments", class: "text-fuchsia font-bold underline" %> +<%= pa_link_to pluralize(comments.count, "comment"), "#comments" %> made here on Planning Alerts diff --git a/app/views/_tailwind/applications/_notified_text.html.erb b/app/views/_tailwind/applications/_notified_text.html.erb index 94f0c9968..cd4d6b31c 100644 --- a/app/views/_tailwind/applications/_notified_text.html.erb +++ b/app/views/_tailwind/applications/_notified_text.html.erb @@ -5,4 +5,4 @@ people were <% end %> notified of this application via Planning Alerts -<%= link_to "email alerts", new_alert_path, class: "text-fuchsia font-bold underline" %> +<%= pa_link_to "email alerts", new_alert_path %> diff --git a/app/views/_tailwind/applications/show.html.erb b/app/views/_tailwind/applications/show.html.erb index ca1a76cfd..dcdd949ed 100644 --- a/app/views/_tailwind/applications/show.html.erb +++ b/app/views/_tailwind/applications/show.html.erb @@ -29,9 +29,8 @@
<%= @application.description %>
Planning Authority
- <%= link_to @application.authority.full_name, - authority_path(@application.authority.short_name_encoded), - class: "hover:underline" %> + <%= pa_link_to @application.authority.full_name, + authority_path(@application.authority.short_name_encoded) %>
& Reference number
@@ -114,9 +113,9 @@

Save this search as an email alert?

<% if current_user.nil? %>

- <%= link_to "Create an account", new_user_registration_path, class: "text-fuchsia font-bold hover:underline" %> + <%= pa_link_to "Create an account", new_user_registration_path %> or - <%= link_to "sign in", new_user_session_path, class: "text-fuchsia font-bold hover:underline" %>. + <%= pa_link_to "sign in", new_user_session_path %>.

It only takes a moment. @@ -153,7 +152,7 @@ <%# TODO: Handle situation with 0 comments differently %>

Comments made here were sent to <%= @application.comment_authority_with_fallback %>. - <%= link_to "Add your own comment", "#add-comment", class: "text-fuchsia font-bold" %>. + <%= pa_link_to "Add your own comment", "#add-comment" %>.

<% @comments.each do |comment| %>
<%= render comment %>
diff --git a/app/views/_tailwind/comments/_actions.html.erb b/app/views/_tailwind/comments/_actions.html.erb index 5278507b1..2843f1a93 100644 --- a/app/views/_tailwind/comments/_actions.html.erb +++ b/app/views/_tailwind/comments/_actions.html.erb @@ -2,5 +2,5 @@ <%= link_to "Report this comment", new_comment_report_path(comment), class: "text-fuchsia text-xl hover:underline" %> <% end %> <% if current_user&.admin? %> - <%= link_to "Admin", admin_comment_path(comment), class: "block text-fuchsia text-xl hover:underline" %> + <%= pa_link_to "Admin", admin_comment_path(comment), class: "block text-xl" %> <% end %> diff --git a/app/views/_tailwind/comments/_delivery_status.html.erb b/app/views/_tailwind/comments/_delivery_status.html.erb index ebc6578f4..bdc2dbfbf 100644 --- a/app/views/_tailwind/comments/_delivery_status.html.erb +++ b/app/views/_tailwind/comments/_delivery_status.html.erb @@ -21,7 +21,7 @@ on <%= comment.last_delivered_at.utc.to_fs(:long) %> UTC Please follow up by - <%= link_to "contacting us", documentation_contact_path %> + <%= pa_link_to "contacting us", documentation_contact_path %> so that we can try to help resolve this issue <% end %> <% end %>