<% is_show_tabs = @pagy.count >= 5 || params[:status].present? %> <% if Docuseal.demo? %><%= render 'shared/demo_alert' %><% end %>
<%= render 'dashboard/toggle_view', selected: 'submissions' %>

Submissions

<% if params[:q].present? || @pagy.pages > 1 %> <%= render 'shared/search_input' %> <% end %> <% if can?(:create, ::Template) %> <%= link_to new_template_path, class: 'white-button !border gap-2', data: { turbo_frame: :modal } do %> <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> <% end %> <% end %>
<% view_archived_html = capture do %> <% if current_account.submissions.where.not(archived_at: nil).exists? %>
View Archived
<% end %> <% end %> <% if is_show_tabs %>
<%= svg_icon('list', class: 'w-5 h-5') %> All
<%= svg_icon('clock', class: 'w-5 h-5') %> Pending
<%= svg_icon('circle_check', class: 'w-5 h-5') %> Completed
<% end %> <% if @pagy.count > 0 %>
<%= render partial: 'templates/submission', collection: @submissions, locals: { with_template: true } %>
<% end %> <% if params[:q].blank? && params[:status].blank? && @pagy.count < 5 %> <%= render 'templates/dropzone' %> <% end %> <% if @submissions.present? || params[:q].blank? %> <% if @pagy.pages > 1 %> <%= render 'shared/pagination', pagy: @pagy, items_name: 'submissions', left_additional_html: view_archived_html %> <% else %>
<%= view_archived_html %>
<% end %> <% elsif params[:q].present? %>
Submissions not Found
<% end %>