Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

1.1 KB
Raw Blame
<turbo-frame id="documents-list">
  <%= render(
    ObjektNavigationComponent.new(
      object_class: Document,
      object_list: documents,
      headers: [
        sortable("document_versions.title", t('views.organisations.documents.document_list.title_header')),
        sortable("documents.created_at", t('views.organisations.documents.document_list.created_header'))
      ],
      object_values: [:title, :created_at],
      selected_object: selected_document,
      line_action: ->(document) { 
        # Sammle alle relevanten Parameter
        params_to_keep = params.permit(:page, :items, :limit, :sort => [:column, :direction]).to_h
        organisation_project_document_path(@current_organisation, @project, document, params_to_keep)
      },
      list_action: organisation_project_documents_path(@current_organisation, @project)
    )
  ) %>
  
  <!-- Paginierung -->
  <% if defined?(pagy) && pagy && pagy.pages > 1 %>
    <div class="pagination-container my-4">
      <%= render partial: 'shared/pagination_nav_compact', locals: { pagy: pagy, frame_id: 'documents-list' } %>
    </div>
  <% end %>
</turbo-frame>