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.7 KB
Raw Blame
<%# Read-only version history of a note, rendered into the Knowledge display frame. %>
<%# Locals: note, detail_frame_id. @versions = newest first. %>
<div id="note-version-history" class="relative">
  <div class="flex items-center justify-between mb-6">
    <div>
      <h2 class="text-lg font-bold text-ink"><%= t("views.organisations.note_versions.index.title") %></h2>
      <p class="text-sm text-cream-700"><%= note.title %></p>
    </div>
    <%= link_to t("views.organisations.note_versions.shared.back_to_note"),
                organisation_project_note_path(@current_organisation, @project, note, frame: "content", frame_id: detail_frame_id),
                data: { turbo_frame: detail_frame_id },
                class: "text-sm underline text-cream-700 hover:text-ink" %>
  </div>

  <% if @versions.empty? %>
    <p class="text-sm text-cream-700"><%= t("views.organisations.note_versions.index.empty") %></p>
  <% else %>
    <ul class="wiki-version-list">
      <% @versions.each do |version| %>
        <li class="wiki-version-list__item">
          <%= link_to organisation_project_note_version_path(@current_organisation, @project, note, version, frame_id: detail_frame_id),
                      data: { turbo_frame: detail_frame_id },
                      class: "wiki-version-list__link" do %>
            <span class="wiki-version-list__time"><%= l(version.created_at, format: :short) %></span>
            <span class="wiki-version-list__author">
              <%= version.author ? viewer_display_name(version.author) : t("views.organisations.note_versions.shared.system_author") %>
            </span>
          <% end %>
        </li>
      <% end %>
    </ul>
  <% end %>
</div>