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.3 KB
Raw Blame
<%# The attachment DATA of a ticket as one quiet line: first file as
    link + size, and the unfold to the full attachment grid. Actions live on
    their own line below (user correction 05.09.2026: data and actions do not
    mix in one flat row). The <details> uses display:contents so its summary
    sits IN the flex line while the open grid wraps onto a full-width row of
    its own.
    Locals: attachments, sh %>
<% first_file = attachments.first&.ticket_document_file %>
<% if first_file %>
  <a href="<%= attachment_download_path(attachments.first) %>" target="_blank" rel="noopener"
     class="underline decoration-cream-400 underline-offset-2 hover:text-cream-900">
    <%= first_file.filename %>
  </a>
  <span class="text-cream-500"><%= number_to_human_size(first_file.byte_size) %></span>
<% end %>
<details class="contents">
  <summary class="cursor-pointer list-none text-cream-600 hover:text-cream-900 [&::-webkit-details-marker]:hidden">
    <%= t("#{sh}.all_files", count: attachments.size) %>
  </summary>
  <div class="basis-full pt-1">
    <div class="grid grid-cols-2 md:grid-cols-3 gap-4">
      <% attachments.each do |doc| %>
        <%= render 'shared/attachment', document: doc, file_accessor: :ticket_document_file %>
      <% end %>
    </div>
  </div>
</details>