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.4 KB
Raw Blame
<%# The trail of a sub-task: every ticket above it, root first, each a link to
    the list with that ticket open (the target of the old "part of" pill), then
    the ticket's own number, not a link. Sub-tasks nest to any depth, so the
    whole chain shows and wraps on a narrow screen; nothing is collapsed.
    The header reads the chain (Tickets::Ancestry, one query) and renders this
    only when it found ancestors. Needs ticket, ancestors, project and
    current_organisation, which the header has on the page and in its turbo
    streams alike. %>
<nav aria-label="<%= t('views.organisations.tickets.shared.subtasks.breadcrumbs_label') %>">
  <ol class="flex flex-wrap items-center gap-1 text-xs text-cream-700">
    <% ancestors.each do |ancestor| %>
      <li class="inline-flex items-center gap-1">
        <%= link_to "##{ancestor.number}",
                    organisation_project_tickets_path(current_organisation, project, ticket_id: ancestor.id),
                    class: "inline-flex h-6 items-center rounded-full border border-cream-300 px-2 font-mono tabular-nums hover:bg-cream-100",
                    data: { ticket_link: true } %>
        <span class="text-cream-500" aria-hidden="true">›</span>
      </li>
    <% end %>
    <li class="inline-flex items-center">
      <span class="inline-flex h-6 items-center px-1 font-mono tabular-nums text-cream-900" aria-current="page">#<%= ticket.number %></span>
    </li>
  </ol>
</nav>