Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
bddec1f
Update notes section to show a message when the inspiration/translati…
luis-pabon-tf Apr 6, 2026
807e2ad
Previously removed works can now be unlinked in the Edit page
luis-pabon-tf Apr 6, 2026
3f9c661
Allow deleted works to appear on downloads
luis-pabon-tf Apr 6, 2026
8e662c7
Make some style fixes
luis-pabon-tf Apr 6, 2026
85bbfe8
More style fixes
luis-pabon-tf Apr 6, 2026
9d1eb35
Hopefully the last style warning
luis-pabon-tf Apr 6, 2026
870fff6
Add annotations for some of the new translatable strings
luis-pabon-tf Apr 10, 2026
65ad4b6
Add missing translation tag
luis-pabon-tf Apr 10, 2026
a647f71
Remove translation tag that's not needed
luis-pabon-tf Apr 10, 2026
84358eb
Normalize I18n en files
luis-pabon-tf Apr 10, 2026
6bc0e31
Run normalization of english translatio, but properly
luis-pabon-tf Apr 10, 2026
3334dbb
Remove accidental files
luis-pabon-tf Apr 21, 2026
c3fae82
Using lazy loading for the newly added translation blocks
luis-pabon-tf Apr 21, 2026
4b813ce
Add missing translation and fix the order to match the yml
luis-pabon-tf Apr 21, 2026
6d95f00
Added feature test for checking the deleted relationship notes
luis-pabon-tf Apr 25, 2026
b0a3152
Merge remote-tracking branch 'upstream/master' into AO3-4274
luis-pabon-tf May 8, 2026
23eed6b
Remove uneeded role from ul tag
luis-pabon-tf May 8, 2026
b4b7cb8
Normalized english yml file
luis-pabon-tf May 8, 2026
bc2a3cc
Add feature test for downloaded works with a deleted inspiration
luis-pabon-tf May 10, 2026
7aaca24
Added test case for removing the connection to a deleted relationship
luis-pabon-tf May 10, 2026
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
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 @@ -64,14 +64,16 @@
<%# i18n-tasks-use t("downloads.download_preface.translated_to.restricted_html") %>
<%# i18n-tasks-use t("downloads.download_preface.translated_to.revealed_html") %>
<%# i18n-tasks-use t("downloads.download_preface.translated_to.unrevealed_html") %>
<%# i18n-tasks-use t("downloads.download_preface.inspired_by.deleted") %>
<%# 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.translation_of.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") %>
<% 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(".header") %>
<%= link_to_help_modal(help_works_parents_path, t(".works_parents_help_title")) %>

<!-- 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">
<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(".deleted_work") %>
<% end %>
</li>
<li>
<%= link_to t(".remove"), related_work, data: { confirm: t(".remove_confirm") }, method: :delete %>
</li>
</ul>
</dd>
<% end %>
<% end %>
</dl>
Expand Down
12 changes: 6 additions & 6 deletions app/views/works/_work_header_notes.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
<% end %>

<%# parent works %>
<%# i18n-tasks-use t("works.work_header_notes.translation_of.deleted") %>
<%# i18n-tasks-use t("works.work_header_notes.translation_of.restricted_html") %>
<%# i18n-tasks-use t("works.work_header_notes.translation_of.revealed_html") %>
<%# i18n-tasks-use t("works.work_header_notes.translation_of.unrevealed") %>
<%# 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
8 changes: 8 additions & 0 deletions config/locales/views/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,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 @@ -979,6 +980,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 @@ -3320,6 +3322,10 @@ en:
skin:
select: Select work skin
standard_form:
deleted_work: Deleted work
header: This work is a remix, a translation, a podfic, or was inspired by another work
remove: Remove
remove_confirm: Are you sure you want to remove the connection to this work?
works_languages_help_title: Languages help
works_parents_help_title: Parent works help
works_recipients_help_title: Recipients
Expand Down Expand Up @@ -3348,6 +3354,7 @@ en:
heading: Download
work_header_notes:
inspired_by:
deleted: Inspired by a deleted work
Comment thread
luis-pabon-tf marked this conversation as resolved.
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 All @@ -3363,6 +3370,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} (Log in to access.)
revealed_html: A translation of %{work_link} by %{creator_link}
unrevealed: A translation of a work in an unrevealed collection
Expand Down
38 changes: 38 additions & 0 deletions features/works/work_related.feature
Original file line number Diff line number Diff line change
Expand Up @@ -802,3 +802,41 @@ Scenario: Notification emails for translations are translated
And "encouragement" should receive 2 emails
And the last email to "encouragement" should be non-translated
And the last email should have "Related work notification" in the subject

Scenario: A note appears on deleted inspirations and translations
Comment thread
luis-pabon-tf marked this conversation as resolved.

Given I have related works setup
And I post a related work as remixer
And I post a translation as translator
When I am logged in as "inspiration"
And I delete the work "Worldbuilding"
When I view the work "Followup"
Then I should see "Inspired by a deleted work"
When I view the work "Worldbuilding Translated"
Then I should see "A translation of a deleted work"

Scenario: Downloaded works with a deleted inspiration display the correct note when downloaded

Given I have related works setup
And I post a related work as remixer
And I post a translation as translator
When I am logged in as "inspiration"
And I delete the work "Worldbuilding"
Then I should be able to download all versions of "Followup"
When I view the work "Followup"
And I follow "HTML"
Then I should see "Inspired by a deleted work"

Scenario: Deleted inspiration relationships can be deleted from the Edit Work page

Given I have related works setup
And I post a related work as remixer
And I post a translation as translator
When I am logged in as "inspiration"
And I delete the work "Worldbuilding"
When I am logged in as "remixer"
And I view the work "Followup"
And I follow "Edit"
Then I should see "Deleted work"
When I follow "Remove" within "#parent-options"
Then I should not see "Deleted work"
Loading