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.

4.1 KB
Raw Blame
<div>
<%= render 'organisations/shared/settings_subnav', active: :general %>
<%# Capped (layout.css, "Page widths"): a form row holds one thing and one value.
    The tools row belongs to the content block and ends with it. %>
<div class="flex justify-end mb-3.5 width-capped">
  <%= render 'common/contextual_help_menu', context: :settings_general %>
</div>

<%# Warm-Editorial (Part G + layout decision D4=B): a single-group settings tab needs
    NO card. The active tab already names the section. Structure comes from
    two-column rows (label + help text on the left, field on the right) with thin dividers —
    uses the width, no redundant frame/header, no card tone problem. %>
<div class="mt-2 width-capped">
  <%= form_with(model: @current_organisation, url: organisation_settings_path(@current_organisation), method: :patch, local: true) do |form| %>
    <% if @current_organisation.errors.any? %>
      <%# D5 callout (danger), embedded, warmly framed. %>
      <div class="border border-cream-300 bg-red-50 rounded-lg p-4 mb-6">
        <div class="flex">
          <div class="flex-shrink-0">
            <i class="bi bi-exclamation-triangle-fill text-red-600"></i>
          </div>
          <div class="ml-3">
            <h3 class="text-sm font-bold text-red-800">
              <%= t('.errors_title', count: @current_organisation.errors.count) %>
            </h3>
            <div class="mt-2 text-sm text-red-700">
              <ul class="list-disc pl-5 space-y-1">
                <% @current_organisation.errors.full_messages.each do |message| %>
                  <li><%= message %></li>
                <% end %>
              </ul>
            </div>
          </div>
        </div>
      </div>
    <% end %>

    <%# Row: Name %>
    <div class="grid grid-cols-1 md:grid-cols-3 gap-2 md:gap-8 py-6 border-t border-b border-cream-200">
      <div class="md:col-span-1">
        <%= form.label :name, t('.name_label'), class: "block text-sm font-bold text-cream-900" %>
        <p class="text-xs text-cream-600 mt-1"><%= t('.name_hint') %></p>
      </div>
      <div class="md:col-span-2">
        <%= form.text_field :name, class: "w-full h-10 px-4 rounded border border-cream-300 focus:outline-none focus:border-ink focus:ring-1 focus:ring-ink transition-all bg-surface-raised", placeholder: t('.name_placeholder') %>
      </div>
    </div>

    <%# Row: Meeting inbox %>
    <div class="grid grid-cols-1 md:grid-cols-3 gap-2 md:gap-8 py-6 border-b border-cream-200">
      <div class="md:col-span-1">
        <%= form.label :meeting_inbox_project_id, t('.meeting_inbox_label'), class: "block text-sm font-bold text-cream-900" %>
        <p class="text-xs text-cream-600 mt-1"><%= t('.meeting_inbox_hint') %></p>
      </div>
      <div class="md:col-span-2">
        <%= form.select :meeting_inbox_project_id,
                        options_for_select(meeting_inbox_options(@inbox_project_choices), @current_organisation.meeting_inbox_project_id),
                        { include_blank: t('.meeting_inbox_none') },
                        class: "w-full h-10 px-4 rounded border border-cream-300 focus:outline-none focus:border-ink focus:ring-1 focus:ring-ink transition-all bg-surface-raised" %>
        <% if @current_organisation.meeting_inbox_project_id.present? && @current_organisation.meeting_inbox.nil? %>
          <p class="text-xs text-cream-600 mt-2"><%= t('.meeting_inbox_archived_hint') %></p>
        <% end %>
      </div>
    </div>

    <%# Subdomain/Domain rows are parked: the custom-access-domain feature is deferred,
        so the fields are hidden from users for now. DB columns, existing values and the
        `.subdomain_*`/`.domain_*` locale copy are kept intact for a frictionless re-enable
        (also strip `:subdomain, :domain` from the controller permit-list when restoring). %>

    <%# Footer (D1): primary action only; tab nav/sidebar lead back. %>
    <div class="flex justify-end pt-6">
      <%= render Neo::Buttons::ButtonComponent.new(variant: :primary, size: :large, type: "submit") do %>
        <%= t('.save_button') %>
      <% end %>
    </div>
  <% end %>
</div>
</div>