You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/app/views/templates_archived_submissions/index.html.erb

44 lines
2.1 KiB

<% filter_params = params.permit(Submissions::Filter::ALLOWED_PARAMS).compact_blank %>
<% with_filters = @pagy.pages > 1 || params[:q].present? || filter_params.present? %>
<%= render 'templates/title', template: @template %>
<div>
<%= link_to template_path(@template), class: 'flex items-center mb-1 md:mb-0' do %>
<%= svg_icon('chevron_left', class: 'w-5 h-5') %>
<span style="margin-left: 3px"><%= t('back_to_active') %></span>
<% end %>
</div>
<div class="flex flex-col md:flex-row md:items-center mb-4 gap-3">
<div class="group/header flex w-full md:flex-1 min-w-0 justify-between items-center">
<div class="max-md:group-has-[search-input:focus-within]/header:hidden">
<h2 class="text-2xl md:text-3xl font-bold md:block"><%= t('submissions') %> <span class="badge badge-outline badge-lg align-middle"><%= t('archived') %></span></h2>
</div>
<div class="max-md:has-[search-input:focus-within]:grow <%= 'max-md:grow' if params[:q].present? %>">
<% if with_filters %>
<%= render 'shared/search_input' %>
<% end %>
</div>
</div>
<div class="flex flex-nowrap md:flex-wrap justify-end items-center gap-2">
<%= render 'submissions_filters/applied_filters', filter_params: %>
<div class="shrink-0 md:order-first">
<%= link_to new_template_submissions_export_path(@template, archived: true), class: 'btn btn-ghost text-base h-10 min-h-10', data: { turbo_frame: 'modal' } do %>
<%= svg_icon('download', class: 'w-6 h-6 stroke-2') %>
<span class="hidden md:inline"><%= t('export') %></span>
<% end %>
</div>
<%= render 'submissions_filters/filter_button', filter_params: %>
</div>
</div>
<% if @pagy.count.nil? || @pagy.count > 0 %>
<div class="space-y-4">
<%= render partial: 'templates/submission', collection: @submissions, locals: { template: @template, archived: true } %>
</div>
<% elsif params[:q].present? || filter_params.present? %>
<div class="text-center">
<div class="mt-16 text-3xl font-semibold">
<%= t('submissions_not_found') %>
</div>
</div>
<% end %>
<%= render 'shared/pagination', pagy: @pagy, items_name: 'submissions' %>