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.

2.6 KB
Raw Blame
<% content_for :title, t('.title') %>

<div>
  <%= render 'organisations/shared/settings_subnav', active: :appearance %>
  <%# Capped (layout.css, "Page widths"); the tools row ends with the content. %>
  <div class="flex justify-end mb-3.5 width-capped">
    <%= render 'common/contextual_help_menu', context: :settings_appearance %>
  </div>

  <%# Single-group settings tab → no Card (Part H1). Content sits directly on the warm surface. %>
  <div class="mt-2 width-capped">
    <h3 class="text-sm font-bold text-cream-900 mb-1"><%= t('.org_color') %></h3>
    <p class="text-sm text-cream-600 mb-5"><%= t('.org_color_description') %></p>

    <%# 3-state picker: Automatic (system assigns) / specific color / Off. Radio name
        org_color, values: 'auto' | palette hex | OrgColor::OFF. Pre-selection from @current_setting
        (hex -> this color; OrgColor::OFF -> Off; nil -> Automatic). peer-checked applies only
        to SIBLINGS of the .peer input -> swatch must be a direct sibling. %>
    <%= form_with url: organisation_appearance_path(@current_organisation), method: :patch, local: true do %>
      <div class="grid grid-cols-3 sm:grid-cols-5 gap-4">
        <%# Automatic: the system assigns a color distinct from the other orgs. %>
        <%= render 'color_swatch',
                   value: 'auto', checked: @current_setting.blank?, label: t('.color_auto'),
                   bg_hex: nil, icon: 'bi-magic',
                   swatch_classes: 'bg-cream-100 flex items-center justify-center text-cream-500 peer-checked:text-cream-900' %>

        <%# Specific palette colors (OrgColor::PALETTE = single source). %>
        <% @presets.each do |preset| %>
          <%= render 'color_swatch',
                     value: preset[:hex], checked: @current_setting == preset[:hex],
                     label: t(".color_#{preset[:key]}"), bg_hex: preset[:hex], icon: nil, swatch_classes: nil %>
        <% end %>

        <%# Off: no color signal for this org. %>
        <%= render 'color_swatch',
                   value: OrgColor::OFF, checked: @current_setting == OrgColor::OFF, label: t('.color_off'),
                   bg_hex: nil, icon: 'bi-slash-circle',
                   swatch_classes: 'bg-cream-50 flex items-center justify-center text-cream-400 peer-checked:text-cream-900' %>
      </div>

      <%# Footer (D1): settings tab -> only primary action on the right. %>
      <div class="mt-8 flex justify-end">
        <%= render Neo::Buttons::ButtonComponent.new(variant: :primary, size: :large, type: "submit") do %>
          <%= t('.save') %>
        <% end %>
      </div>
    <% end %>
  </div>
</div>