Skip to content
Open
5 changes: 4 additions & 1 deletion app/helpers/works_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,12 @@ def get_inspired_by(work)
end

def related_work_note(related_work, relation, download: false)
default_locale = download ? :en : nil

return t(".#{relation}.deleted", locale: default_locale) if related_work.nil?

work_link = link_to related_work.title, polymorphic_url(related_work)
language = tag.span(related_work.language.name, lang: related_work.language.short) if related_work.language
default_locale = download ? :en : nil

creator_link = if download
byline(related_work, visibility: "public", only_path: false)
Expand Down
4 changes: 3 additions & 1 deletion app/views/downloads/_download_preface.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@
<%# i18n-tasks-use t("downloads.download_preface.inspired_by.restricted_html") %>
<%# i18n-tasks-use t("downloads.download_preface.inspired_by.revealed_html") %>
<%# i18n-tasks-use t("downloads.download_preface.inspired_by.unrevealed") %>
<%# i18n-tasks-use t("downloads.download_preface.inspired_by.deleted") %>
<%# i18n-tasks-use t("downloads.download_preface.translation_of.restricted_html") %>
<%# i18n-tasks-use t("downloads.download_preface.translation_of.revealed_html") %>
<%# i18n-tasks-use t("downloads.download_preface.translation_of.unrevealed") %>
<%# i18n-tasks-use t("downloads.download_preface.translation_of.deleted") %>
<% translations = @work.approved_related_works.where(translation: true) %>
<% related_works = @work.parent_work_relationships.reject { |wr| !wr.parent } %>
<% related_works = @work.parent_work_relationships %>
<% if translations.any? || related_works.any? %>
<ul>
<% translations.each do |related_work| %>
Expand Down
28 changes: 14 additions & 14 deletions app/views/works/_standard_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
<%= check_box_tag "parent-options-show", "1", check_parent_box(@work), class: "toggle_formfield" %>
</dt>
<dd class="parent">
<%= label_tag "parent-options-show", ts("This work is a remix, a translation, a podfic, or was inspired by another work") %>
<%= label_tag "parent-options-show", t("works.associations.parent.header") %>
<%= link_to_help "parent-works-help" %>

<!-- Toggles on with parent checkbox -->
Expand Down Expand Up @@ -137,20 +137,20 @@
<% unless existing_parents.blank? %>
<dt><%= ts("Current parent works") %></dt>
<% existing_parents.each do |related_work| %>
<% if related_work.parent %>
<dd>
<ul class="actions" role="navigation">
<li>
<dd>
<ul class="actions" role="navigation">
<li>
<% if related_work.parent %>
<%= link_to related_work.parent.title, related_work.parent %>
</li>
<li>
<%= link_to ts("Remove"), related_work,
data: { confirm: ts("Are you sure you want to delete the connection to this work?") },
method: :delete %>
</li>
</ul>
</dd>
<% end %>
<% else %>
<%= t("works.associations.parent.deleted") %>
<% end %>
</li>
<li>
<%= link_to t("works.associations.parent.delete_button"), related_work, data: { confirm: t("works.associations.parent.delete_confirm") }, method: :delete %>
</li>
</ul>
</dd>
<% end %>
<% end %>
</dl>
Expand Down
11 changes: 5 additions & 6 deletions app/views/works/_work_header_notes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
<%# i18n-tasks-use t("works.work_header_notes.inspired_by.restricted_html") %>
<%# i18n-tasks-use t("works.work_header_notes.inspired_by.revealed_html") %>
<%# i18n-tasks-use t("works.work_header_notes.inspired_by.unrevealed") %>
<%# i18n-tasks-use t("works.work_header_notes.inspired_by.deleted") %>
<% for related_work in @work.parents_after_saving %>
<% if related_work.parent %>
<li>
<% relation = related_work.translation ? "translation_of" : "inspired_by" %>
<%= related_work_note(related_work.parent, relation) %>
</li>
<% end %>
<li>
<% relation = related_work.translation ? "translation_of" : "inspired_by" %>
<%= related_work_note(related_work.parent, relation) %>
</li>
<% end %>

<%# prompts %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/controllers/e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
1 change: 1 addition & 0 deletions config/locales/devise/e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
1 change: 1 addition & 0 deletions config/locales/helpers/e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
1 change: 1 addition & 0 deletions config/locales/mailers/e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
1 change: 1 addition & 0 deletions config/locales/models/e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
1 change: 1 addition & 0 deletions config/locales/validators/e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
1 change: 1 addition & 0 deletions config/locales/views/e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--- {}
8 changes: 8 additions & 0 deletions config/locales/views/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,7 @@ en:
end_notes_with_work_notes: more notes
end_notes_without_work_notes: notes
inspired_by:
deleted: Inspired by a deleted work
restricted_html: Inspired by [Restricted Work] by %{creator_link}
revealed_html: Inspired by %{work_link} by %{creator_link}
unrevealed: Inspired by a work in an unrevealed collection
Expand All @@ -960,6 +961,7 @@ en:
revealed_html: 'Translation into %{language} available: %{work_link} by %{creator_link}'
unrevealed_html: 'Translation into %{language} available: A work in an unrevealed collection'
translation_of:
deleted: A translation of a deleted work
restricted_html: A translation of [Restricted Work] by %{creator_link}
revealed_html: A translation of %{work_link} by %{creator_link}
unrevealed: A translation of a work in an unrevealed collection
Expand Down Expand Up @@ -3170,6 +3172,11 @@ en:
associations:
language:
choose: Choose a language
parent:
delete_button: Remove
delete_confirm: Are you sure you want to delete the connection to this work?
deleted: Deleted work
header: This work is a remix, a translation, a podfic, or was inspired by another work
title: Associations
byline:
add_co-creators: Add co-creators
Expand Down Expand Up @@ -3265,6 +3272,7 @@ en:
heading: Download
work_header_notes:
inspired_by:
deleted: Inspired by a deleted work
other_works_inspired_by_this_one: other works inspired by this one
restricted_html: Inspired by [Restricted Work] by %{creator_link} (Log in to access.)
revealed_html: Inspired by %{work_link} by %{creator_link}
Expand Down
Loading