From cd830d23cdc9566e37e7bfc7618c388aabe21a60 Mon Sep 17 00:00:00 2001 From: techlingyi <166869872+techlingyi@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:40:35 +0000 Subject: [PATCH 01/32] AO3-7144 Update Collections index page header --- app/views/collections/index.html.erb | 20 ++++++++------------ config/locales/views/en.yml | 8 ++++---- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/app/views/collections/index.html.erb b/app/views/collections/index.html.erb index f3329008b9a..448d87d0ee9 100755 --- a/app/views/collections/index.html.erb +++ b/app/views/collections/index.html.erb @@ -1,23 +1,19 @@

- <% if @user %> - <%= t(".page_heading.users_collections", user: @user.login) %> + <% if @collections.empty? %> + <%# do we need this disclaimer? %> + <%= ts("Sorry, there were no collections found.") %> + <% elsif @user %> + <%= t(".page_heading.collections_by", collections: search_header(@collections, @query, ts("Collection")), user: @user.login) %> <% elsif @collection %> - <%= t(".page_heading.challenges_subcollections_in", collection: @collection.title) %> + <%= t(".page_heading.subcollections_in", subcollections: search_header(@collections, @query, ts("Subcollection")), collection: @collection.title) %> <% elsif @work %> - <%= t(".page_heading.collections_including", work: @work.title) %> + <%= t(".page_heading.collections_including", collections: search_header(@collections, @query, ts("Collection")), work: @work.title) %> <% else %> - <%= t(".page_heading.collections_in_the", archive: ArchiveConfig.APP_NAME) %> + <%= t(".page_heading.collections_in_the", collections: search_header(@collections, @query, ts("Collection")), archive: ArchiveConfig.APP_NAME) %> <% end %>

-

- <% if @collections.empty? %> - <%= ts("Sorry, there were no collections found.") %> - <% else %> - <%= search_header @collections, @query, ts("Collection") %> - <% end %> -

diff --git a/config/locales/views/en.yml b/config/locales/views/en.yml index c2e3a15cd7a..55bd4c8a751 100644 --- a/config/locales/views/en.yml +++ b/config/locales/views/en.yml @@ -803,10 +803,10 @@ en: label: Multifandom index: page_heading: - challenges_subcollections_in: Challenges/Subcollections in %{collection} - collections_in_the: Collections in the %{archive} - collections_including: Collections including %{work} - users_collections: "%{user}'s Collections" + collections_by: "%{collections} by %{user}" + collections_in_the: "%{collections} in the %{archive}" + collections_including: "%{collections} including %{work}" + subcollections_in: "%{subcollections} in %{collection}" sidebar: bookmarks: Bookmarked Items (%{count}) challenge_settings: Challenge Settings From c7d5cce90652935c314e5d060262921d464695c6 Mon Sep 17 00:00:00 2001 From: techlingyi <166869872+techlingyi@users.noreply.github.com> Date: Wed, 8 Apr 2026 22:45:04 +0000 Subject: [PATCH 02/32] AO3-7147 Add path for collection listings in a tag --- app/helpers/search_helper.rb | 9 +++++++++ app/views/bookmarks/index.html.erb | 1 + app/views/collections/index.html.erb | 8 ++++---- app/views/tags/show.html.erb | 1 + app/views/works/index.html.erb | 1 + config/locales/views/en.yml | 1 + config/routes.rb | 1 + features/support/paths.rb | 3 +++ 8 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index dcb9be97318..9b06612ec01 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -61,4 +61,13 @@ def bookmarks_original_path **params.slice(:tag_id, :collection_id, :pseud_id, :user_id).permit! ) end + + def collections_original_path + url_for( + controller: :collections, + action: :index, + only_path: true, + **params.slice(:tag_id, :fandom_id, :collection_id, :pseud_id, :user_id).permit! + ) + end end diff --git a/app/views/bookmarks/index.html.erb b/app/views/bookmarks/index.html.erb index 7293d1419f2..222b70f8a57 100755 --- a/app/views/bookmarks/index.html.erb +++ b/app/views/bookmarks/index.html.erb @@ -31,6 +31,7 @@ <% if @tag %>
  • <%= span_if_current t(".navigation.works"), tag_works_path(@tag) %>
  • <%= span_if_current t(".navigation.bookmarks"), tag_bookmarks_path(@tag) %>
  • +
  • <%= span_if_current t(".navigation.collections"), tag_collections_path(@tag) %>
  • <% end %> <% if @facets.present? %> <% # Filters button for narrow screens jumps to filters when JavaScript is disabled and opens filters when JavaScript is enabled %> diff --git a/app/views/collections/index.html.erb b/app/views/collections/index.html.erb index 448d87d0ee9..16f50271629 100755 --- a/app/views/collections/index.html.erb +++ b/app/views/collections/index.html.erb @@ -4,13 +4,13 @@ <%# do we need this disclaimer? %> <%= ts("Sorry, there were no collections found.") %> <% elsif @user %> - <%= t(".page_heading.collections_by", collections: search_header(@collections, @query, ts("Collection")), user: @user.login) %> + <%= t(".page_heading.collections_by", collections: search_header(@collections, @query, ts("Collection"), @owner), user: @user.login) %> <% elsif @collection %> - <%= t(".page_heading.subcollections_in", subcollections: search_header(@collections, @query, ts("Subcollection")), collection: @collection.title) %> + <%= t(".page_heading.subcollections_in", subcollections: search_header(@collections, @query, ts("Subcollection"), @owner), collection: @collection.title) %> <% elsif @work %> - <%= t(".page_heading.collections_including", collections: search_header(@collections, @query, ts("Collection")), work: @work.title) %> + <%= t(".page_heading.collections_including", collections: search_header(@collections, @query, ts("Collection"), @owner), work: @work.title) %> <% else %> - <%= t(".page_heading.collections_in_the", collections: search_header(@collections, @query, ts("Collection")), archive: ArchiveConfig.APP_NAME) %> + <%= t(".page_heading.collections_in_the", collections: search_header(@collections, @query, ts("Collection"), @owner), archive: ArchiveConfig.APP_NAME) %> <% end %> diff --git a/app/views/tags/show.html.erb b/app/views/tags/show.html.erb index 8b994f1c6a7..4e35daf39fc 100644 --- a/app/views/tags/show.html.erb +++ b/app/views/tags/show.html.erb @@ -8,6 +8,7 @@ <% if @tag.canonical || @tag.merger %>
  • <%= link_to ts("Works"), tag_works_path(@tag) %>
  • <%= link_to ts("Bookmarks"), tag_bookmarks_path(@tag) %>
  • +
  • <%= link_to ts("Collections"), tag_collections_path(@tag) %>
  • <% end %> <% if can_wrangle? %>
  • <%= link_to ts("Edit"), edit_tag_path(@tag) %>
  • diff --git a/app/views/works/index.html.erb b/app/views/works/index.html.erb index db80ac94b4e..56983ac6b53 100755 --- a/app/views/works/index.html.erb +++ b/app/views/works/index.html.erb @@ -26,6 +26,7 @@ <% if @tag && !@collection %>
  • <%= span_if_current ts("Works"), tag_works_path(@tag) %>
  • <%= span_if_current ts("Bookmarks"), tag_bookmarks_path(@tag) %>
  • +
  • <%= span_if_current ts("Collections"), tag_collections_path(@tag) %>
  • <% end %> <% if @facets.present? %> <%# Filters button for narrow screens jumps to filters when JavaScript is disabled and opens filters when JavaScript is enabled %> diff --git a/config/locales/views/en.yml b/config/locales/views/en.yml index 55bd4c8a751..ad5c0277741 100644 --- a/config/locales/views/en.yml +++ b/config/locales/views/en.yml @@ -653,6 +653,7 @@ en: choose_fandom: choose a fandom navigation: bookmarks: Bookmarks + collections: Collections edit: Edit Bookmark new: Bookmark new_external_work: Bookmark External Work diff --git a/config/routes.rb b/config/routes.rb index 43f2cc2e46c..22392feb8e3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -132,6 +132,7 @@ end resources :works resources :bookmarks + resources :collections resources :comments resource :troubleshooting, controller: :troubleshooting, only: [:show, :update] end diff --git a/features/support/paths.rb b/features/support/paths.rb index 7f8845055e5..30f84bfa476 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -197,6 +197,9 @@ def path_to(page_name) when /^the bookmarks (?:tagged|page for the tag) "(.*)"$/i step %{all indexing jobs have been run} tag_bookmarks_path(Tag.find_by_name(Regexp.last_match(1))) + when /^the collections "(.*)"$/i + step %{all indexing jobs have been run} + tag_collections_path(Tag.find_by_name($1)) when /^the bookmarks in collection "(.*)"$/i step %{all indexing jobs have been run} collection_bookmarks_path(Collection.find_by(title: $1)) From 4c0bbd2d28be53bdc4524c3736ef6946358eca21 Mon Sep 17 00:00:00 2001 From: techlingyi <166869872+techlingyi@users.noreply.github.com> Date: Thu, 9 Apr 2026 22:11:56 +0000 Subject: [PATCH 03/32] AO3-7147 Add appropriate buttons to tag listings of collections --- app/views/collections/index.html.erb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/views/collections/index.html.erb b/app/views/collections/index.html.erb index 16f50271629..6336d2d24e4 100755 --- a/app/views/collections/index.html.erb +++ b/app/views/collections/index.html.erb @@ -19,6 +19,18 @@

    <%= ts("Navigation") %>