mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
add page themes for admins
This commit is contained in:
17
app/queries/admins/page_themes_query.rb
Normal file
17
app/queries/admins/page_themes_query.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class Admins::PageThemesQuery < ApplicationQuery
|
||||
include CustomSortable
|
||||
|
||||
attr_reader :params
|
||||
|
||||
sort_columns :created_at, default_by: :created_at, default_direction: :desc
|
||||
|
||||
def initialize(params)
|
||||
@params = params
|
||||
end
|
||||
|
||||
def call
|
||||
language_frame = params[:language_frame].blank? ? [0..99] : params[:language_frame]
|
||||
page_themes = PageTheme.where(language_frame: language_frame)
|
||||
custom_sort(page_themes, params[:sort_by], params[:sort_direction])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user