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
<%# locals: (group:, time_sessions:) %>
<%# What a billing already holds, for the assignment panel to show on demand.
    Read-only: this is context for a decision, not a second place to edit a
    billing, and the billing's own page is one click away for that.

    The rows read like the panel's list of what is ABOUT to be taken over,
    deliberately: the reader is comparing the two, and two different shapes for
    "a booking in one line" would make them do that comparison twice.

    Sorted in Ruby, not re-queried: the rows are already loaded with their
    subjects by load_time_sessions, and .order here would throw that away. %>
<turbo-frame id="billing_entries_<%= group.id %>">
  <% if time_sessions.any? %>
    <ul class="space-y-0.5 py-1">
      <% time_sessions.sort_by(&:occurred_on).each do |time_session| %>
        <li class="flex items-baseline gap-2 text-xs leading-6 text-cream-600">
          <span class="w-[46px] shrink-0 font-mono"><%= time_session.duration_string %></span>
          <span class="min-w-0 flex-1 truncate" title="<%= time_session_short_label(time_session) %>">
            <%= time_session_short_label(time_session) %>
          </span>
        </li>
      <% end %>
    </ul>
  <% else %>
    <p class="py-1 text-xs italic leading-6 text-cream-500">
      <%= t('views.organisations.time_sessions.index_table.billing_entries_none') %>
    </p>
  <% end %>
</turbo-frame>