diff --git a/app/views/templates/_submission.html.erb b/app/views/templates/_submission.html.erb index 001d651c..9b09eda8 100644 --- a/app/views/templates/_submission.html.erb +++ b/app/views/templates/_submission.html.erb @@ -61,7 +61,7 @@ - <% else %> + <% elsif !submission.archived_at? && !template.archived_at? %> <% if current_user.email == submitter.email %>
- <% elsif !is_submission_completed %> + <% elsif !template.archived_at? && !submission.archived_at? && !is_submission_completed %>
<% if current_user.email == submitter.email %>
@@ -171,7 +171,7 @@
View
- <% unless submission.archived_at? %> + <% if !submission.archived_at? && !template.archived_at? %> <%= button_to button_title(title: nil, disabled_with: 'Arch', icon: svg_icon('archive', class: 'w-6 h-6')), submission_path(submission), class: 'btn btn-outline btn-sm w-full md:w-fit', form: { class: 'flex' }, title: 'Archive', method: :delete, data: { turbo_confirm: 'Are you sure?' }, onclick: 'event.stopPropagation()' %> diff --git a/app/views/templates/_title.html.erb b/app/views/templates/_title.html.erb index fce98283..848dfecc 100644 --- a/app/views/templates/_title.html.erb +++ b/app/views/templates/_title.html.erb @@ -4,7 +4,7 @@

<% template.name.split(/(_)/).each do |item| %><%= item %><% end %> <% if template.archived_at? %> - Archived + Archived <% end %>

<% if @template.account_id == current_account.id %> diff --git a/app/views/templates/show.html.erb b/app/views/templates/show.html.erb index cdf719ef..509a8fc7 100644 --- a/app/views/templates/show.html.erb +++ b/app/views/templates/show.html.erb @@ -55,7 +55,7 @@ <% end %> <% if @submissions.present? %>
- <%= render partial: 'submission', collection: @submissions %> + <%= 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? %> diff --git a/app/views/templates_archived_submissions/index.html.erb b/app/views/templates_archived_submissions/index.html.erb index 24a4f9e8..6d8ce7b8 100644 --- a/app/views/templates_archived_submissions/index.html.erb +++ b/app/views/templates_archived_submissions/index.html.erb @@ -19,7 +19,7 @@
<% if @pagy.count > 0 %>
- <%= render partial: 'templates/submission', collection: @submissions %> + <%= render partial: 'templates/submission', collection: @submissions, locals: { template: @template } %>
<% elsif params[:q].present? %>