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
|
2024-12-08 01:37:20 +02:00
|
|
|
@templates = @templates.where.not(archived_at: nil).preload(:author, :folder, :template_accesses).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
|
|
|
|
2024-10-04 16:37:41 +03:00
|
|
|
@pagy, @templates = pagy(@templates, limit: 12)
|
2023-09-15 00:42:51 +03:00
|
|
|
end
|
|
|
|
|
end
|