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.6 KB
Raw Blame
<div>
  <%# Mobile: list OR full-screen detail with a back button (tickets pattern, PE-F).
      Frame IDs identical to desktop (only one variant is rendered), so that
      FilterBar frame reloads also work on mobile. The head stands here above
      the list because since S1 it lives in the list column and no longer
      page-wide above both variants. %>
  <%# The way back keeps the live query (search, view, conditions, page) and
      drops only the selection and the new-state (S2 of
      doc/wissen_als_bahn_plan.md); it used to carry the type alone. %>
  <% back_query = request.query_parameters.except(*knowledge_lane_state_params) %>
  <%= render NeoMobileTicketViewComponent.new(
    selected_item: @selected_item || @new_type,
    show_detail: @selected_item.present? || @new_type.present?,
    back_url: organisation_project_knowledge_index_path(@current_organisation, @project, back_query),
    back_label: t('views.organisations.knowledge.index.mobile_list_view')
  ) do |mobile| %>
    <% mobile.with_list do %>
      <%= render 'organisations/knowledge/list_head' %>
      <%# The frame comes from the partial itself (see _index_desktop) %>
      <%= render 'knowledge_results',
                 knowledge_items: @knowledge_items || [],
                 pagy: @pagy,
                 selected_item: @selected_item,
                 type: @type,
                 smart_folder_id: params[:smart_folder_id] %>
    <% end %>

    <% mobile.with_detail do %>
      <%= render 'organisations/knowledge/knowledge_lane', selected_item: @selected_item, new_type: @new_type, preview_version: @preview_version %>
    <% end %>
  <% end %>
</div>