ai tags: respect the user's posts-per-page setting on the /ai_tags page.
This commit is contained in:
@@ -4,12 +4,13 @@ class AITagsController < ApplicationController
|
|||||||
respond_to :js, :html, :json, :xml
|
respond_to :js, :html, :json, :xml
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@ai_tags = authorize AITag.visible(CurrentUser.user).paginated_search(params, count_pages: false)
|
limit = params[:limit].presence || CurrentUser.user.per_page
|
||||||
@ai_tags = @ai_tags.includes(:media_asset, :tag, :post) if request.format.html?
|
|
||||||
|
|
||||||
@mode = params.fetch(:mode, "gallery")
|
@mode = params.fetch(:mode, "gallery")
|
||||||
@preview_size = params[:size].presence || cookies[:post_preview_size].presence || MediaAssetGalleryComponent::DEFAULT_SIZE
|
@preview_size = params[:size].presence || cookies[:post_preview_size].presence || MediaAssetGalleryComponent::DEFAULT_SIZE
|
||||||
|
|
||||||
|
@ai_tags = authorize AITag.visible(CurrentUser.user).paginated_search(params, limit: limit, count_pages: false)
|
||||||
|
@ai_tags = @ai_tags.includes(:media_asset, :tag, :post) if request.format.html?
|
||||||
|
|
||||||
respond_with(@ai_tags)
|
respond_with(@ai_tags)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user