Skip to content

Commit

Permalink
AO3-6058 Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
weeklies committed Sep 15, 2023
1 parent 344e54b commit db3d115
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/helpers/works_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def get_inspired_by(work)

def related_work_note(related_work, relation, download: false)
work_link = link_to related_work.title, polymorphic_url(related_work)
language = tag.span(related_work.language.name, lang: related_work.language.short)
language = if related_work.language
tag.span(related_work.language.name, lang: related_work.language.short)
end

creator_link = if download
byline(related_work.work, visibility: "public", only_path: false)
Expand All @@ -127,7 +129,7 @@ def related_work_note(related_work, relation, download: false)
t(".#{relation}.unrevealed_html",
language: language)
else
t(".#{relation}.unrevealed_html")
t(".#{relation}.unrevealed")
end
elsif related_work.restricted? && !logged_in?
t(".#{relation}.restricted_html",
Expand Down
2 changes: 1 addition & 1 deletion app/views/downloads/_download_preface.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<% related_works.each do |work| %>
<li>
<% relation = work.translation ? "translation_of" : "inspired_by" %>
<%= related_work_note(child_work.work, relation, download: true) %>
<%= related_work_note(work.parent, relation, download: true) %>
</li>
<% end %>
</ul>
Expand Down

0 comments on commit db3d115

Please sign in to comment.