5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/helpers/decidim/external_domain_helper.rb', line 5
def highlight_domain
highlighted_domain = [
external_url.host,
(external_url.port && [80, 443].include?(external_url.port) ? "" : ":#{external_url.port}")
].join
path = [
external_url.path,
(external_url.query ? "?#{external_url.query}" : ""),
(external_url.fragment ? "##{external_url.fragment}" : "")
].join
tag.div do
content_tag(:span, "#{external_url.scheme}://") +
content_tag(:span, highlighted_domain, class: "text-alert") +
content_tag(:span, path)
end
end
|