diff --git a/app/controllers/curator/locations_controller.rb b/app/controllers/curator/locations_controller.rb index bd79b384..f70911c9 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/dashboard/index.html.erb b/app/views/curator/dashboard/index.html.erb index b775a09b..dcd25062 100644 --- a/app/views/curator/dashboard/index.html.erb +++ b/app/views/curator/dashboard/index.html.erb @@ -21,25 +21,8 @@ - -
<%= location.city %>
+| - <%= 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" %> - | -