2023-09-15 00:42:51 +03:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class TemplatesArchivedController < ApplicationController
|
2023-09-17 00:45:57 +03:00
|
|
|
load_and_authorize_resource :template, parent: false
|
|
|
|
|
|
2023-09-15 00:42:51 +03:00
|
|
|
def index
|
2023-12-30 00:37:03 +02:00
|
|
|
@templates = @templates.where.not(archived_at: nil).preload(:author, :folder).order(id: :desc)
|
2023-09-17 00:45:57 +03:00
|
|
|
@templates = Templates.search(@templates, params[:q])
|
2023-09-15 00:42:51 +03:00
|
|
|
|
2023-09-17 00:45:57 +03:00
|
|
|
@pagy, @templates = pagy(@templates, items: 12)
|
2023-09-15 00:42:51 +03:00
|
|
|
end
|
|
|
|
|
end
|