Skip to content

Commit

Permalink
Use consistent link style (I hope) on application detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Oct 1, 2023
1 parent f22fef2 commit d3cd275
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
7 changes: 7 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/_tailwind/applications/_comments_text.html.erb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion app/views/_tailwind/applications/_notified_text.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
11 changes: 5 additions & 6 deletions app/views/_tailwind/applications/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@
<dd><%= @application.description %></dd>
<dt class="font-bold">Planning Authority</dt>
<dd>
<%= 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) %>
</dd>
<dt class="font-bold">& Reference number</dt>
<dd>
Expand Down Expand Up @@ -114,9 +113,9 @@
<h2 class="text-3xl font-bold font-display text-navy">Save this search as an email alert?</h2>
<% if current_user.nil? %>
<p class="mt-4 text-2xl text-navy">
<%= 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 %>.
</p>
<p class="text-2xl text-navy">
It only takes a moment.
Expand Down Expand Up @@ -153,7 +152,7 @@
<%# TODO: Handle situation with 0 comments differently %>
<p class="text-2xl text-navy">
Comments made here were sent to <strong><%= @application.comment_authority_with_fallback %></strong>.
<%= link_to "Add your own comment", "#add-comment", class: "text-fuchsia font-bold" %>.
<%= pa_link_to "Add your own comment", "#add-comment" %>.
</p>
<% @comments.each do |comment| %>
<div class="mt-12"><%= render comment %></div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/_tailwind/comments/_actions.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
2 changes: 1 addition & 1 deletion app/views/_tailwind/comments/_delivery_status.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>

0 comments on commit d3cd275

Please sign in to comment.