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.

3.5 KB
Raw Blame
<%# Save target for the PROJECT dashboard: one radio group, each option a complete „who + where"
    destination (no implicit dependency). The radios live OUTSIDE the standalone form, so they
    associate via form="dashboard_edit_form". The two `default_*` options write the shared project
    default and are admin-only (server re-checks, see SAVE_SCOPES). Values must match SAVE_SCOPES.
    Surface-specific partial — the overview has its own 2-scope version. %>
<div class="mb-6 p-4 bg-surface-raised border-2 border-stroke rounded-lg space-y-2">
  <p class="text-sm font-bold text-ink mb-1"><%= t('dashboard.configuration.save_scope_label') %></p>

  <label class="flex items-start gap-2 cursor-pointer">
    <input type="radio" name="save_scope" value="personal_this" form="dashboard_edit_form" checked
           class="mt-0.5 w-4 h-4 accent-ink"
           data-action="change->dashboard-inline-edit#changeScope">
    <span>
      <span class="text-sm font-bold text-ink"><%= t('dashboard.configuration.scope_personal_this') %></span>
      <span class="block text-xs text-cream-900/60"><%= t('dashboard.configuration.scope_personal_this_hint') %></span>
    </span>
  </label>

  <label class="flex items-start gap-2 cursor-pointer">
    <input type="radio" name="save_scope" value="personal_all" form="dashboard_edit_form"
           class="mt-0.5 w-4 h-4 accent-ink"
           data-action="change->dashboard-inline-edit#changeScope">
    <span>
      <span class="text-sm font-bold text-ink"><%= t('dashboard.configuration.scope_personal_all') %></span>
      <span class="block text-xs text-cream-900/60"><%= t('dashboard.configuration.scope_personal_all_hint') %></span>
    </span>
  </label>

  <% if @is_admin %>
    <%# Admin-only: writes the shared project default (affects all members) → amber zone. %>
    <div class="border-t border-stroke/10 pt-2 mt-2 space-y-2 bg-amber-50 -mx-4 px-4 pb-2">
      <label class="flex items-start gap-2 cursor-pointer">
        <input type="radio" name="save_scope" value="default_this" form="dashboard_edit_form"
               class="mt-0.5 w-4 h-4 accent-ink"
               data-action="change->dashboard-inline-edit#changeScope">
        <span>
          <span class="text-sm font-bold text-ink"><%= t('dashboard.configuration.scope_default_this') %></span>
          <span class="block text-xs text-cream-900/60"><%= t('dashboard.configuration.scope_default_this_hint') %></span>
        </span>
      </label>

      <label class="flex items-start gap-2 cursor-pointer">
        <input type="radio" name="save_scope" value="default_all" form="dashboard_edit_form"
               class="mt-0.5 w-4 h-4 accent-ink"
               data-action="change->dashboard-inline-edit#changeScope">
        <span>
          <span class="text-sm font-bold text-ink"><%= t('dashboard.configuration.scope_default_all') %></span>
          <span class="block text-xs text-cream-900/60"><%= t('dashboard.configuration.scope_default_all_hint') %></span>
        </span>
      </label>
    </div>
  <% end %>

  <%# Smart folder warning: folder_id is project-specific, so any „all projects" scope
      (personal_all or default_all) leaves the widget empty in the other projects. %>
  <div class="hidden border-t border-stroke/10 pt-2 mt-2"
       data-dashboard-inline-edit-target="smartFolderWarning">
    <p class="text-xs text-amber-700 flex items-center gap-1">
      <i class="bi bi-exclamation-triangle-fill" aria-hidden="true"></i>
      <%= t('dashboard.configuration.smart_folder_warning') %>
    </p>
  </div>
</div>