Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assessment Only spreadsheet upload #4269

Merged
merged 17 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/components/grouped_cards/card_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<% for field, value in fields %>
<div class="group__card__fields">
<span><%= field.humanize %>:</span>
<span><%= linked_value(value) %></span>
<%= linked_value(field, value) %>
</div>
<% end %>
</div>
Expand Down
23 changes: 20 additions & 3 deletions app/components/grouped_cards/card_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,28 @@ def linked_header
end

def fields
@data.without("header", "link", "status")
@data.without("header", "link", "status", "extension", "international_phone")
end

def linked_value(value)
Rinku.auto_link(h(value)).html_safe
def linked_value(field, value)
tags = []

if field == "telephone" && value.present?
tags << if @data["international_phone"].present?
# Although we present the national telephone number, we need to use the
# international_phone value in the URL to support overseas visitors
tag.span { link_to(value, "tel:#{@data['international_phone']}") }
else
tag.span { link_to(value, "tel:#{value}") }
end
# add extension here
if @data["extension"].present?
tags << tag.span(class: "extension") { @data["extension"] }
end
else
tags << tag.span { Rinku.auto_link(h(value)).html_safe }
end
safe_join tags
end

def link
Expand Down
Loading
Loading