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.5 KB
Raw Blame
<table class="min-w-full divide-y divide-black">
    <thead class="bg-gray-200">
        <tr>
            <% @headers.each do |header| %>
                <th scope="col" class="px-6 py-4 text-start text-xs font-medium text-cream-900 uppercase tracking-wider">
                    <%= header %>
                </th>
            <% end %>
        </tr>
    </thead>
    <tbody class="bg-surface-raised divide-y divide-black">
    <% @object_list&.each do |object| %>
        <% active_class = object.id == @selected_object&.id ? 'bg-gray-100' : '' %>
        <tr data-controller="clickable-row" 
            data-action="click->clickable-row#click"
            data-clickable-row-url-value="<%= line_action_for(object) %>"
            class="<%= active_class %> hover:bg-gray-50">
            <% @object_values.each do |ovalue| %>
                <td class="p-4 whitespace-nowrap">
                    <div class="text-sm font-medium">
                        <% if ovalue == :created_at && object.respond_to?(:created_at) %>
                            <%= object.created_at.strftime("%d.%m.%Y %H:%M") %>
                        <% elsif ovalue == :title && object.respond_to?(:current_version) && object.current_version.present? %>
                            <%= object.current_version.title %>
                        <% else %>
                            <%= object.send(ovalue) if object.respond_to?(ovalue) %>
                        <% end %>
                    </div>
                </td>
            <% end %>
        </tr>
    <% end %>
    </tbody>
</table>