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
<%# After creating a ticket from the list: shows the content column and highlights the
    freshly created row. The writing surface itself is closed by the Turbo Stream that
    clears turbo-frame#modal (Paket 3); this script no longer touches a modal. %>
<script>
  // Sofort ausgeführtes Script, kein wait auf turbo:load
  (function() {
    // Layout anpassen - Content anzeigen
    const layoutView = document.querySelector('.labor-layout-view');
    if (layoutView) layoutView.classList.add('show-content');

    const layout = document.getElementById('layout');
    if (layout) {
      layout.classList.remove('hide-content');
      layout.classList.add('show-content');
    }

    // The column visibility lives on the two-column grid (NeoTwoColumnGridComponent),
    // not on the outer view wrapper; without this the new ticket stays collapsed.
    const grid = document.querySelector('.layout.two-column');
    if (grid) {
      grid.classList.remove('hide-content');
      grid.classList.add('show-content');
    }

    // Mark the open ticket with the one class (.selected-row, layout.css)
    document.querySelectorAll('.selected-row').forEach(row => {
      row.classList.remove('selected-row');
    });
    const ticketId = <%= raw ticket_id.to_json %>;
    const ticketRow = document.querySelector('tr[data-ticket-id="' + ticketId + '"]');
    if (ticketRow) {
      ticketRow.classList.add('selected-row');
    }

  })();
</script>