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
<div class="flex flex-col gap-4">
  <h1 class="text-2xl font-bold text-heading"><%= t('views.organisations.documentation.new.title') %></h1>

  <% if @repositories.empty? %>
    <%# The dead end the whole relocation started from: a doc set REQUIRES a repo,
        but this page used to only state "no repository" with no way out. Give a
        real CTA (round-trip back here after connecting) to those who may connect;
        a neutral hint to those who may not. %>
    <div class="flex flex-col items-start gap-3">
      <p class="max-w-lg rounded-md border border-yellow-800 bg-yellow-100 px-3 py-2 text-sm text-yellow-900">
        <%= t('views.organisations.documentation.new.no_repository') %>
      </p>
      <% if can_manage_repositories?(@project) %>
        <%= render(Neo::Buttons::ButtonComponent.new(
              variant: :primary, icon: 'plug',
              url: organisation_project_project_repositories_path(@current_organisation, @project, origin: documentation_origin)
            )) { t('views.organisations.documentation.new.connect_repository') } %>
      <% else %>
        <%# Neutral wording (not "administrator only"). Reaching this page already
            needs documentation:write, so this branch is defensive/unreachable today. %>
        <p class="text-xs text-muted"><%= t('views.organisations.documentation.empty.setup_no_permission') %></p>
      <% end %>
    </div>
  <% else %>
    <%= render 'form', documentation_set: @documentation_set, repositories: @repositories %>
  <% end %>
</div>