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 @@
- <%= 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| %>