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.

1016 B
Raw Blame
<%# Renders a stored @-mention as a reference chip (pill + type icon), so references %>
<%# stand out from running text. mentionable = Note | Document. %>
<%# Shared by organisations/notes/_mention and organisations/documents/_mention. %>
<%# A navigable link only when the viewer may open the target (note→document crosses %>
<%# areas); otherwise an inert label, so a chip never backlinks to forbidden content. %>
<% mention_label = mentionable.title.presence || t("views.wiki.mentions.untitled") %>
<% mention_icon = mentionable.is_a?(Document) ? "file-earmark-text" : "journal-text" %>
<% if wiki_mention_readable?(mentionable) %>
  <%= link_to wiki_mention_path(mentionable), class: "wiki-mention", title: mention_label do %><i class="bi bi-<%= mention_icon %>" aria-hidden="true"></i><%= mention_label %><% end %>
<% else %>
  <span class="wiki-mention wiki-mention--inaccessible" title="<%= mention_label %>"><i class="bi bi-<%= mention_icon %>" aria-hidden="true"></i><%= mention_label %></span>
<% end %>