mirror of
https://github.com/docusealco/docuseal
synced 2026-11-07 07:22:32 -05:00
add templates and submissions search
This commit is contained in:
1 parent
7f6c0af0e8
commit
53fa35fd01
12 files changed
+101
-23
No files matched your search
@@ -8,6 +8,7 @@ class DashboardController < ApplicationController
|
||||
return render 'pages/landing' unless signed_in?
|
||||
|
||||
templates = current_account.templates.active.preload(:author).order(id: :desc)
|
||||
templates = Templates.search(templates, params[:q])
|
||||
|
||||
@pagy, @templates = pagy(templates, items: 12)
|
||||
end
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
class TemplatesArchivedController < ApplicationController
|
||||
def index
|
||||
templates = current_account.templates.where.not(deleted_at: nil).preload(:author).order(id: :desc)
|
||||
templates = Templates.search(templates, params[:q])
|
||||
|
||||
@pagy, @templates = pagy(templates, items: 12)
|
||||
end
|
||||
|
||||
@@ -4,7 +4,10 @@ class TemplatesArchivedSubmissionsController < ApplicationController
|
||||
def show
|
||||
@template = current_account.templates.find(params[:template_id])
|
||||
|
||||
@pagy, @submissions = pagy(@template.submissions.where.not(deleted_at: nil).preload(:submitters).order(id: :desc))
|
||||
submissions = @template.submissions.where.not(deleted_at: nil)
|
||||
submissions = Submissions.search(submissions, params[:q])
|
||||
|
||||
@pagy, @submissions = pagy(submissions.preload(:submitters).order(id: :desc))
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
@@ -7,6 +7,7 @@ class TemplatesController < ApplicationController
|
||||
@template = current_account.templates.find(params[:id])
|
||||
submissions = @template.submissions
|
||||
submissions = submissions.active if @template.deleted_at.blank?
|
||||
submissions = Submissions.search(submissions, params[:q])
|
||||
|
||||
@pagy, @submissions = pagy(submissions.preload(:submitters).order(id: :desc))
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
|
||||
Reference in new issue
Block a user