Files

36 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

2023-09-15 00:42:51 +03:00
<div>
2026-07-22 20:32:50 +03:00
<%= link_to root_path, class: 'flex items-center mb-1 md:mb-0' do %>
2025-07-20 08:28:19 +03:00
<%= svg_icon('chevron_left', class: 'w-5 h-5') %>
<span style="margin-left: 3px"><%= t('back_to_active') %></span>
2023-09-15 00:42:51 +03:00
<% end %>
</div>
2026-07-23 11:13:10 +03:00
<div class="group/header flex justify-between mb-4 items-center">
<div class="max-md:group-has-[search-input:focus-within]/header:hidden">
2025-07-20 08:28:19 +03:00
<h1 class="text-2xl md:text-3xl font-bold md:block <%= 'hidden' if params[:q].present? %>"><%= t('document_templates_html') %> <span class="badge badge-outline badge-lg align-middle"><%= t('archived') %></span></h1>
2024-08-14 16:34:30 +03:00
</div>
2023-09-15 02:11:48 +03:00
<% if params[:q].present? || @pagy.pages > 1 %>
2024-09-18 19:47:47 +03:00
<%= render 'shared/search_input', placeholder: "#{t('search')}..." %>
2023-09-15 02:11:48 +03:00
<% end %>
2023-09-15 00:42:51 +03:00
</div>
2025-05-28 22:48:15 +03:00
<% if @pagy.count.nil? || @pagy.count > 0 %>
2023-09-15 02:11:48 +03:00
<div class="grid gap-4 md:grid-cols-3">
2026-06-24 19:08:15 +03:00
<%= render partial: 'templates/template', collection: @templates, locals: { with_folder: true } %>
2023-09-15 02:11:48 +03:00
</div>
<% elsif params[:q].present? %>
<div class="text-center">
<div class="mt-16 text-3xl font-semibold">
2024-09-18 19:47:47 +03:00
<%= t('templates_not_found') %>
2023-09-15 02:11:48 +03:00
</div>
</div>
2025-07-20 08:28:19 +03:00
<% 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', next_page_path: submissions_archived_index_path(q: params[:q]) %>
<% end %>
2023-09-15 02:11:48 +03:00
<% end %>
2023-09-15 00:42:51 +03:00
<%= render 'shared/pagination', pagy: @pagy, items_name: 'templates' %>