From 654b7e9e7aee068dbdffe5bef37833dbefb3efe0 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Feb 2026 17:43:36 +0000 Subject: [PATCH 1/3] Fix needs_photos table horizontal scroll on mobile Changed overflow-hidden to overflow-x-auto on table container to allow horizontal scrolling when content is wider than viewport. https://claude.ai/code/session_01VWH3EjFJziBh9EN1YnyAtp --- app/views/curator/locations/needs_photos.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/curator/locations/needs_photos.html.erb b/app/views/curator/locations/needs_photos.html.erb index fa2201d..aded113 100644 --- a/app/views/curator/locations/needs_photos.html.erb +++ b/app/views/curator/locations/needs_photos.html.erb @@ -32,7 +32,7 @@ <%# Results %> <% if @locations.any? %> -
+
From dcf90344839900c21254e93c27548e3120a1e461 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Feb 2026 17:46:44 +0000 Subject: [PATCH 2/3] Simplify needs_photos page with cards and load-more pagination - Replace table with simple card layout (mobile-friendly) - Add load-more pagination instead of traditional pagination - Each card shows: name, city, photo count badge, add photo button - Reduced page size to 12 items per page https://claude.ai/code/session_01VWH3EjFJziBh9EN1YnyAtp --- .../curator/locations_controller.rb | 9 +- .../locations/_needs_photo_item.html.erb | 18 ++++ .../locations/_needs_photo_items.html.erb | 3 + .../curator/locations/needs_photos.html.erb | 86 ++++++------------- 4 files changed, 54 insertions(+), 62 deletions(-) create mode 100644 app/views/curator/locations/_needs_photo_item.html.erb create mode 100644 app/views/curator/locations/_needs_photo_items.html.erb diff --git a/app/controllers/curator/locations_controller.rb b/app/controllers/curator/locations_controller.rb index bd79b38..f70911c 100644 --- a/app/controllers/curator/locations_controller.rb +++ b/app/controllers/curator/locations_controller.rb @@ -45,7 +45,14 @@ def needs_photos @locations = @locations.having("COUNT(active_storage_attachments.id) <= ?", params[:max_photos].to_i) end - @locations = @locations.page(params[:page]).per(30) + page = params[:items_page] || params[:page] || 1 + @locations = @locations.page(page).per(12) + + # Handle partial loading for load-more + if params[:partial] == "items" && request.xhr? + return render partial: "curator/locations/needs_photo_items", locals: { locations: @locations }, layout: false + end + @city_names = Location.where.not(city: [ nil, "" ]).distinct.pluck(:city).sort end diff --git a/app/views/curator/locations/_needs_photo_item.html.erb b/app/views/curator/locations/_needs_photo_item.html.erb new file mode 100644 index 0000000..60421aa --- /dev/null +++ b/app/views/curator/locations/_needs_photo_item.html.erb @@ -0,0 +1,18 @@ +
+
+ <%= link_to location.name, curator_location_path(location), + class: "font-medium text-gray-900 dark:text-white hover:text-emerald-600 dark:hover:text-emerald-400 truncate block" %> +

<%= location.city %>

+
+ + <% photos_count = location.photos_count.to_i %> + + <%= photos_count %> + + + <%= link_to new_curator_location_photo_suggestion_path(location), + class: "flex-shrink-0 rounded-md bg-emerald-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-emerald-500" do %> + + <%= t("curator.locations.needs_photos.add_photo") %> + <% end %> +
diff --git a/app/views/curator/locations/_needs_photo_items.html.erb b/app/views/curator/locations/_needs_photo_items.html.erb new file mode 100644 index 0000000..c57847e --- /dev/null +++ b/app/views/curator/locations/_needs_photo_items.html.erb @@ -0,0 +1,3 @@ +<% locations.each do |location| %> + <%= render "curator/locations/needs_photo_item", location: location %> +<% end %> diff --git a/app/views/curator/locations/needs_photos.html.erb b/app/views/curator/locations/needs_photos.html.erb index aded113..f8f4019 100644 --- a/app/views/curator/locations/needs_photos.html.erb +++ b/app/views/curator/locations/needs_photos.html.erb @@ -32,68 +32,32 @@ <%# Results %> <% if @locations.any? %> -
-
- - - - - - - - - - <% @locations.each do |location| %> - - - - - - - <% end %> - -
- <%= t("curator.locations.name") %> - - <%= t("curator.locations.city") %> - - <%= t("curator.locations.needs_photos.photo_count") %> - - <%= t("common.actions") %> -
-
- <% if location.photos.attached? && location.photos.first.present? %> - <%= image_tag rails_blob_path(location.photos.first.variant(:thumb), disposition: "inline"), - class: "h-10 w-10 rounded-lg object-cover flex-shrink-0" %> - <% else %> -
- - - -
- <% end %> -
- <%= link_to location.name, curator_location_path(location), - class: "text-sm font-medium text-gray-900 dark:text-white hover:text-emerald-600 dark:hover:text-emerald-400 truncate block" %> -
-
-
- <%= location.city %> - - <% photos_count = location.photos_count.to_i %> - - <%= photos_count %> <%= t("curator.locations.needs_photos.photos") %> - - - <%= link_to t("curator.locations.needs_photos.add_photo"), - new_curator_location_photo_suggestion_path(location), - class: "text-emerald-600 dark:text-emerald-400 hover:text-emerald-800 dark:hover:text-emerald-300 font-medium" %> -
-
+
+ +
+ <%= render "curator/locations/needs_photo_items", locations: @locations %> +
-
- <%= paginate @locations %> + <%# Load More %> +
+ + +
<% else %>
From 6101632ae010e7e4691ffc5eac403f3ccbb96a8b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Feb 2026 17:47:59 +0000 Subject: [PATCH 3/3] Hide reviews sections from curator dashboard - Remove reviews stats cards (total reviews, recent reviews) - Remove recent reviews list section - Keep audio stats in a 2-column grid https://claude.ai/code/session_01VWH3EjFJziBh9EN1YnyAtp --- app/views/curator/dashboard/index.html.erb | 60 +--------------------- 1 file changed, 2 insertions(+), 58 deletions(-) diff --git a/app/views/curator/dashboard/index.html.erb b/app/views/curator/dashboard/index.html.erb index b775a09..dcd2506 100644 --- a/app/views/curator/dashboard/index.html.erb +++ b/app/views/curator/dashboard/index.html.erb @@ -21,25 +21,8 @@
- -
-
-
<%= t("curator.dashboard.total_reviews") %>
-
<%= @stats[:reviews_count] %>
-
- - - - - <%= @stats[:average_rating] %> <%= t("curator.dashboard.avg") %> - -
-
-
-
<%= t("curator.dashboard.recent_reviews") %>
-
<%= @stats[:pending_reviews] %>
-
<%= t("curator.dashboard.last_7_days") %>
-
+ +
<%= t("curator.dashboard.audio_tours") %>
<%= @stats[:audio_tours_with_audio] %>/<%= @stats[:audio_tours_count] %>
@@ -175,45 +158,6 @@
- -
-
-
-

<%= t("curator.dashboard.recent_reviews_title") %>

- <%= link_to curator_reviews_path, class: "text-sm text-emerald-600 dark:text-emerald-400 hover:text-emerald-900 dark:hover:text-emerald-300" do %> - <%= t("common.view_all") %> - <% end %> -
-
    - <% @stats[:recent_reviews].each do |review| %> -
  • - <%= link_to curator_review_path(review), class: "block hover:bg-gray-50 dark:hover:bg-gray-700 -mx-2 px-2 py-1 rounded-md" do %> -
    -
    -
    - <% review.rating.times do %> - - - - <% end %> - <%= review.reviewable_type %> -
    -
    <%= review.comment.presence&.truncate(50) || t("curator.reviews.no_comment") %>
    -
    - - - -
    - <% end %> -
  • - <% end %> - <% if @stats[:recent_reviews].empty? %> -
  • <%= t("curator.dashboard.no_reviews") %>
  • - <% end %> -
-
-
-