From b4b17d847e96d2727502f2e5151f64bc289073d8 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Fri, 17 May 2024 12:08:06 +0300 Subject: [PATCH] add view archived to template page --- app/views/templates/show.html.erb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/templates/show.html.erb b/app/views/templates/show.html.erb index 509a8fc7..67101c1c 100644 --- a/app/views/templates/show.html.erb +++ b/app/views/templates/show.html.erb @@ -57,20 +57,6 @@
<%= render partial: 'submission', collection: @submissions, locals: { template: @template } %>
- <% view_archived_html = capture do %> - <% if @template.submissions.where.not(archived_at: nil).exists? && !@template.archived_at? %> -
- View Archived -
- <% end %> - <% end %> - <% if @pagy.pages > 1 %> - <%= render 'shared/pagination', pagy: @pagy, items_name: 'submissions', left_additional_html: view_archived_html %> - <% else %> -
- <%= view_archived_html %> -
- <% end %> <% else %>
@@ -102,3 +88,17 @@
<% end %> +<% view_archived_html = capture do %> + <% if @template.submissions.where.not(archived_at: nil).exists? && !@template.archived_at? %> +
+ View Archived +
+ <% end %> +<% end %> +<% if @pagy.pages > 1 %> + <%= render 'shared/pagination', pagy: @pagy, items_name: 'submissions', left_additional_html: view_archived_html %> +<% else %> +
+ <%= view_archived_html %> +
+<% end %>