fix dashboard search

pull/133/head
Alex Turchyn 2 years ago
parent 5643094a7a
commit cf85bea0df

@ -51,7 +51,7 @@ class DashboardController < ApplicationController
def filter_templates(templates) def filter_templates(templates)
rel = templates.active.preload(:author).order(id: :desc) rel = templates.active.preload(:author).order(id: :desc)
.where(folder_id: current_account.default_template_folder.id) rel = rel.where(folder_id: current_account.default_template_folder.id) if params[:q].blank?
Templates.search(rel, params[:q]) Templates.search(rel, params[:q])
end end

@ -1,5 +1,5 @@
<% if Docuseal.demo? %><%= render 'shared/demo_alert' %><% end %> <% if Docuseal.demo? %><%= render 'shared/demo_alert' %><% end %>
<% if @pagy.count > 0 || params[:q].present? %> <% if @pagy.count > 0 || params[:q].present? || @template_folders.present? %>
<div class="flex justify-between mb-4 items-center"> <div class="flex justify-between mb-4 items-center">
<h1 class="text-4xl font-bold"><span class="hidden md:inline">Document</span> Templates</h1> <h1 class="text-4xl font-bold"><span class="hidden md:inline">Document</span> Templates</h1>
<div class="flex space-x-2"> <div class="flex space-x-2">

Loading…
Cancel
Save