archived nav

This commit is contained in:
Pete Matsyburka committed 2026-09-23 10:59:54 +03:00
1 parent a4ca0abba1
commit 8259ebdb6c
9 files changed
+42 -20

No files matched your search

+5 -1
View File
@@ -83,7 +83,11 @@ class TemplatesController < ApplicationController
I18n.t('template_has_been_archived')
end
redirect_back(fallback_location: root_path, notice:)
if @template.destroyed? && turbo_native_app?
redirect_to templates_archived_index_path, notice:
else
redirect_back(fallback_location: root_path, notice:)
end
end
private
@@ -285,6 +285,7 @@
>
<a
:href="`/templates/${template.id}/form`"
:data-native-actions="template.submitters.length > 1 ? 'users' : null"
data-turbo="false"
class="flex items-center justify-center space-x-2"
@click.exact="isPreviewLoading = true"
+1 -1
View File
@@ -1,5 +1,5 @@
<div class="h-36 relative group min-w-0">
<a href="<%= template_path(template) %>" class="flex h-full flex-col justify-between rounded-2xl pt-6 px-7 w-full bg-base-200 before:border-2 before:border-base-300 before:border-dashed before:absolute before:left-0 before:right-0 before:top-0 before:bottom-0 before:hidden before:rounded-2xl" data-targets="dashboard-dropzone.templateCards">
<a href="<%= template_path(template) %>" class="flex h-full flex-col justify-between rounded-2xl pt-6 px-7 w-full bg-base-200 before:border-2 before:border-base-300 before:border-dashed before:absolute before:left-0 before:right-0 before:top-0 before:bottom-0 before:hidden before:rounded-2xl" data-targets="dashboard-dropzone.templateCards" data-native-actions="<%= 'pencil,menu' if turbo_native_app? && !template.archived_at? && can?(:update, template) %>">
<div class="text-xl font-semibold" style="line-height: 1.6rem; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
<% if template.template_accesses.present? %>
<%= svg_icon('lock', class: 'w-6 h-6 inline -translate-y-[4px]') %>
+6 -3
View File
@@ -107,7 +107,7 @@
<% end %>
<% if template.archived_at? || (!can?(:update, template) && can?(:read, template)) %>
<native-action data-section="edit" data-icon="file_text" data-label="<%= t('preview') %>">
<a href="<%= template_preview_path(template) %>"></a>
<a href="<%= template_preview_path(template) %>" data-native-title="<%= template.name %>"></a>
</native-action>
<% end %>
<% if local_assigns[:with_export] %>
@@ -117,11 +117,14 @@
<% end %>
<% if can?(:destroy, template) %>
<% if template.archived_at? %>
<native-action data-section="archive" data-icon="rotate" data-label="<%= t('restore') %>">
<native-action data-section="edit" data-icon="rotate" data-label="<%= t('restore') %>">
<%= button_to '', template_restore_index_path(template) %>
</native-action>
<native-action data-icon="trash" data-label="<%= t('delete') %>" data-destructive="true">
<%= button_to '', template_path(template), method: :delete, params: { permanently: true }, data: { turbo_confirm: t('template_deletion_is_irreversible_and_will_permanently_remove_all_associated_signed_documents_with_it_are_you_sure_') } %>
</native-action>
<% else %>
<native-action data-section="archive" data-icon="archive" data-label="<%= t('archive') %>">
<native-action data-section="edit" data-icon="archive" data-label="<%= t('archive') %>">
<%= button_to '', template_path(template), method: :delete %>
</native-action>
<% end %>
+3 -1
View File
@@ -133,7 +133,9 @@
<% view_archived_html = capture do %>
<% if (can?(:manage, :countless) || @template.submissions.where.not(archived_at: nil).exists?) && !@template.archived_at? %>
<div>
<a href="<%= template_archived_index_path(@template) %>" class="link text-sm"><%= t('view_archived') %></a>
<native-action data-placement="menu" data-label="<%= t('archived_submissions') %>">
<a href="<%= template_archived_index_path(@template) %>" class="link text-sm" data-native-title="<%= t('archived') %>"><%= t('view_archived') %></a>
</native-action>
</div>
<% end %>
<% end %>
@@ -1,8 +1,8 @@
<% content_for(:native_title, @template.name) if turbo_native_app? %>
<% content_for(:native_title, t('archived')) if turbo_native_app? %>
<% 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 %>
<% unless turbo_native_app? %>
<%= 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') %>
@@ -10,11 +10,13 @@
<% end %>
</div>
<% end %>
<div class="flex flex-col md:flex-row md:items-center mb-4 gap-3">
<div class="flex flex-col md:flex-row md:items-center mb-4 <%= 'gap-3' unless turbo_native_app? %>">
<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>
<% unless turbo_native_app? %>
<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>
<% end %>
<div class="max-md:has-[search-input:focus-within]:grow <%= 'max-md:grow' if params[:q].present? %>">
<% if with_filters %>
<%= render 'shared/search_input' %>
@@ -23,12 +25,14 @@
</div>
<div class="flex flex-nowrap md:flex-wrap md:justify-end items-center gap-2">
<%= render 'submissions_filters/applied_filters', filter_params:, with_status: true, with_default_status: true %>
<div class="hidden md:block 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>
<% unless turbo_native_app? %>
<div class="hidden md:block 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>
<% end %>
<%= render 'submissions_filters/filter_button', filter_params: %>
</div>
</div>
@@ -2,7 +2,7 @@
<% content_for(:native_title, @template.name) %>
<% if @template.submitters.size > 1 %>
<% @template.submitters.each do |submitter| %>
<native-action data-section="submitter" data-label="<%= submitter['name'] %>" data-selected="<%= submitter['uuid'] == @submitter.uuid %>">
<native-action data-section="submitter" data-menu-icon="users" data-label="<%= submitter['name'] %>" data-selected="<%= submitter['uuid'] == @submitter.uuid %>">
<a href="<%= template_form_path(@template, uuid: submitter['uuid']) %>"></a>
</native-action>
<% end %>
+2 -1
View File
@@ -1 +1,2 @@
<template-builder class="grid" data-editable="false" data-with-sign-yourself-button="<%= !@template.archived_at? %>" data-with-send-button="<%= !@template.archived_at? && can?(:create, @template.submissions.new(account: current_account)) %>" data-template="<%= @template_data.to_json %>"></template-builder>
<% content_for(:native_title, @template.name) if turbo_native_app? %>
<template-builder data-native-app="<%= turbo_native_app? %>" class="grid" data-editable="false" data-with-sign-yourself-button="<%= !@template.archived_at? %>" data-with-send-button="<%= !@template.archived_at? && can?(:create, @template.submissions.new(account: current_account)) %>" data-template="<%= @template_data.to_json %>"></template-builder>
+7
View File
@@ -774,6 +774,7 @@ en: &en
submitter_cannot_be_updated: Submitter cannot be updated.
at_least_one_field_must_be_filled: At least one field must be filled.
archived_users: Archived Users
archived_submissions: Archived Submissions
embedding_users: Embedding Users
view_embedding_users: View Embedding Users
key: Key
@@ -1911,6 +1912,7 @@ es: &es
submitter_cannot_be_updated: No se puede editar el destinatario.
at_least_one_field_must_be_filled: Al menos un campo debe estar completo.
archived_users: Usuarios Archivados
archived_submissions: Envíos Archivados
embedding_users: Usuarios integrados
view_embedding_users: Ver usuarios integrados
key: Clave
@@ -3055,6 +3057,7 @@ it: &it
submitter_cannot_be_updated: Non è possibile modificare il destinatario.
at_least_one_field_must_be_filled: Almeno un campo deve essere compilato.
archived_users: Utenti Archiviati
archived_submissions: Invii Archiviati
embedding_users: Utenti integrati
view_embedding_users: Vedi utenti integrati
key: Chiave
@@ -4185,6 +4188,7 @@ fr: &fr
submitter_cannot_be_updated: Impossible de modifier le destinataire.
at_least_one_field_must_be_filled: Au moins un champ doit être rempli.
archived_users: Utilisateurs archivés
archived_submissions: Soumissions archivées
embedding_users: Utilisateurs intégrés
view_embedding_users: Voir les utilisateurs intégrés
key: Clé
@@ -5325,6 +5329,7 @@ pt: &pt
submitter_cannot_be_updated: Não é possível editar o destinatário.
at_least_one_field_must_be_filled: Pelo menos um campo deve ser preenchido.
archived_users: Usuários Arquivados
archived_submissions: Submissões Arquivadas
embedding_users: Usuários integrados
view_embedding_users: Ver usuários integrados
key: Chave
@@ -6468,6 +6473,7 @@ de: &de
submitter_cannot_be_updated: Der Empfänger kann nicht bearbeitet werden.
at_least_one_field_must_be_filled: Mindestens ein Feld muss ausgefüllt werden.
archived_users: Archivierte Benutzer
archived_submissions: Archivierte Einreichungen
embedding_users: Integrationsbenutzer
view_embedding_users: Integrationsbenutzer anzeigen
key: Schlüssel
@@ -8139,6 +8145,7 @@ nl: &nl
submitter_cannot_be_updated: Ontvanger kan niet worden bewerkt.
at_least_one_field_must_be_filled: Er moet minstens één veld worden ingevuld.
archived_users: Gearchiveerde gebruikers
archived_submissions: Gearchiveerde inzendingen
embedding_users: Integratiegebruikers
view_embedding_users: Integratiegebruikers bekijken
key: Sleutel