add view archived to template page
This commit is contained in:
@@ -57,20 +57,6 @@
|
||||
<div class="space-y-4">
|
||||
<%= render partial: 'submission', collection: @submissions, locals: { template: @template } %>
|
||||
</div>
|
||||
<% view_archived_html = capture do %>
|
||||
<% if @template.submissions.where.not(archived_at: nil).exists? && !@template.archived_at? %>
|
||||
<div>
|
||||
<a href="<%= template_archived_index_path(@template) %>" class="link text-sm">View Archived</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @pagy.pages > 1 %>
|
||||
<%= render 'shared/pagination', pagy: @pagy, items_name: 'submissions', left_additional_html: view_archived_html %>
|
||||
<% else %>
|
||||
<div class="mt-2">
|
||||
<%= view_archived_html %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="card bg-base-200">
|
||||
<div class="card-body text-center py-16">
|
||||
@@ -102,3 +88,17 @@
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% view_archived_html = capture do %>
|
||||
<% if @template.submissions.where.not(archived_at: nil).exists? && !@template.archived_at? %>
|
||||
<div>
|
||||
<a href="<%= template_archived_index_path(@template) %>" class="link text-sm">View Archived</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @pagy.pages > 1 %>
|
||||
<%= render 'shared/pagination', pagy: @pagy, items_name: 'submissions', left_additional_html: view_archived_html %>
|
||||
<% else %>
|
||||
<div class="mt-2">
|
||||
<%= view_archived_html %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user