• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / pdc_describe / 95ff1d10-5774-4415-8b66-ffb4f4f58024

pending completion
95ff1d10-5774-4415-8b66-ffb4f4f58024

Pull #725

circleci

Carolyn Cole
Updating manifest not to include the javascript for edit This seems to do nothing, so I am removing it
Pull Request #725: Updating manifest not to include the javascript for edit

1638 of 1684 relevant lines covered (97.27%)

102.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.3
/app/helpers/application_helper.rb
1
# frozen_string_literal: true
2
module ApplicationHelper
1✔
3
  ##
4
  # Attributes to add to the <html> tag (e.g. lang and dir)
5
  # @return [Hash]
6
  def html_tag_attributes
1✔
7
    { lang: I18n.locale }
86✔
8
  end
9

10
  # rubocop:disable Rails/OutputSafety
11
  def person_orcid_link(name, orcid, add_separator)
1✔
12
    return if name.blank?
60✔
13

14
    icon_html = '<i class="bi bi-person-fill"></i>'
60✔
15
    separator = add_separator ? ";" : ""
60✔
16
    name_html = "#{name}#{separator}"
60✔
17
    if orcid.present?
60✔
18
      icon_html = '<img alt="ORCID logo" src="https://info.orcid.org/wp-content/uploads/2019/11/orcid_16x16.png" width="16" height="16" />'
2✔
19
      name_html = '<a href="https://orcid.org/' + orcid + '" target="_blank">' + name + "</a>" + separator
2✔
20
    end
21

22
    html = <<-HTML
60✔
23
    <span class="author-name">
24
      #{icon_html}
25
      #{name_html}
26
    </span>
27
    HTML
28
    html.html_safe
60✔
29
  end
30
  # rubocop:enable Rails/OutputSafety
31

32
  # rubocop:disable Rails/OutputSafety
33
  # rubocop:disable Metrics/MethodLength
34
  def contributor_link(contributor, add_separator)
1✔
35
    return if contributor.value.blank?
2✔
36

37
    icon_html = ""
2✔
38
    separator = add_separator ? ";" : ""
2✔
39
    display_name = if contributor.type.present?
2✔
40
                     "#{contributor.value} (#{contributor.type.titleize})"
2✔
41
                   else
42
                     contributor.value
×
43
                   end
44
    if contributor.orcid.present?
2✔
45
      icon_html = '<img alt="ORCID logo" src="https://info.orcid.org/wp-content/uploads/2019/11/orcid_16x16.png" width="16" height="16" />'
1✔
46
      name_html = '<a href="https://orcid.org/' + contributor.orcid + '" target="_blank">' + display_name + "</a>" + separator
1✔
47
    else
48
      name_html = display_name + separator
1✔
49
    end
50

51
    html = <<-HTML
2✔
52
      <span class="author-name">
53
        #{icon_html}
54
        #{name_html}
55
      </span>
56
    HTML
57
    html.html_safe
2✔
58
  end
59
  # rubocop:enable Rails/OutputSafety
60
  # rubocop:enable Metrics/MethodLength
61

62
  def pre_curation_uploads_file_name(file:)
1✔
63
    value = file.filename.to_s
42✔
64
    return if value.blank?
42✔
65

66
    value[0..79]
42✔
67
  end
68
  alias post_curation_uploads_file_name pre_curation_uploads_file_name
1✔
69

70
  def ark_url(ark_value)
1✔
71
    return nil if ark_value.blank?
17✔
72
    # This was originally in Work#ark_url as: "https://ezid.cdlib.org/id/#{ark}"
73
    "http://arks.princeton.edu/#{ark_value}"
17✔
74
  end
75

76
  def doi_url(doi_value)
1✔
77
    return nil if doi_value.blank?
58✔
78
    "https://doi.org/#{doi_value}"
58✔
79
  end
80
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc