adjust search

This commit is contained in:
Pete Matsyburka
2026-06-25 09:27:59 +03:00
parent 1eaf4e5bab
commit dc1c386d7e
7 changed files with 70 additions and 26 deletions
+11 -2
View File
@@ -13,13 +13,13 @@
<% end %>
</h1>
<div class="flex space-x-2">
<% if params[:q].present? || @pagy.pages > 1 %>
<% if params[:q].present? || @pagy.count.nil? || @pagy.count > 1 %>
<%= render 'shared/search_input' %>
<% end %>
</div>
</div>
<% view_archived_html = capture do %>
<% if @has_archived %>
<% if @has_archived && params[:q].blank? %>
<div>
<a href="<%= templates_shared_index_path(archived: true) %>" class="link text-sm"><%= t('view_archived') %></a>
</div>
@@ -35,6 +35,15 @@
<%= t('templates_not_found') %>
</div>
</div>
<% if @related_submissions.present? %>
<h1 class="text-2xl md:text-3xl sm:text-4xl font-bold mt-8 md:mt-4">
<%= t('submissions') %>
</h1>
<div class="space-y-4 mt-4">
<%= render partial: 'templates/submission', collection: @related_submissions, locals: { with_template: true } %>
</div>
<%= render 'shared/pagination', pagy: @related_submissions_pagy, items_name: 'submissions' %>
<% end %>
<% end %>
<% if @pagy.pages > 1 %>
<%= render 'shared/pagination', pagy: @pagy, items_name: 'templates', left_additional_html: view_archived_html %>