mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 06:52:33 -05:00
add submissions dashboard view
This commit is contained in:
1 parent
5bb7ad571c
commit
2dba8ae366
20 files changed
+520
-269
No files matched your search
+7
-1
@@ -7,7 +7,7 @@ module Submissions
|
||||
|
||||
module_function
|
||||
|
||||
def search(submissions, keyword, search_values: false)
|
||||
def search(submissions, keyword, search_values: false, search_template: false)
|
||||
return submissions if keyword.blank?
|
||||
|
||||
term = "%#{keyword.downcase}%"
|
||||
@@ -20,6 +20,12 @@ module Submissions
|
||||
|
||||
arel = arel.or(Arel::Table.new(:submitters)[:values].matches(term)) if search_values
|
||||
|
||||
if search_template
|
||||
submissions = submissions.joins(:template)
|
||||
|
||||
arel = arel.or(Template.arel_table[:name].lower.matches("%#{keyword.downcase}%"))
|
||||
end
|
||||
|
||||
submissions.joins(:submitters).where(arel).distinct
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user