Your details: a primary identifier, marked with a star at the start of its row #922

Closed
opened 2026-10-15 17:19:43 +00:00 by tiagoagueda · 0 comments
Owner

On Your details, one identifier can be marked primary with a star at the start of its row, as the rows of telephone numbers, links, messaging and addresses already can.

What exists today

  • accounts/models.py, PersonIdentifier: scheme, value, label. No is_primary. Meta.ordering = ("scheme", "value"), and a unique constraint on (profile, scheme) keeps one identifier of each kind (#307).
  • The row is <c-identifier-row> (templates/cotton/identifier_row.html), shared with a company's form: Type, Identifier, Name (when Other), and the bin (<c-remove-button>) on Your details. No star.
  • The other blocks draw the star with <c-primary-choice name="<prefix>-primary" value="{{ row.prefix }}" :checked="row.instance.is_primary" /> (#303). It is a radio shared by the block's rows, shown as a star, with the label as a 24px target. Their models carry is_primary with a unique constraint "one primary per holder" (for example one_primary_web_link_per_holder_and_kind). Since #866 the star comes first in the row and the bin last.
  • profile.html draws the identifiers in a <fieldset class="card" data-identifiers id="section-identifiers">.

What would change

  • PersonIdentifier.is_primary (default false), with a constraint of one primary per profile, a migration, and the archive format, the API schema and the importers carrying it.
  • <c-identifier-row> draws <c-primary-choice> first in the row when remove_at_once (Your details). The formset saves the chosen row as primary the way the other blocks' formsets do. A company's form is unchanged unless company identifiers get a primary too (not requested).
  • Say what primary means. The other blocks' primary is what a document prints first. For identifiers that is the one a CV prints first, or alone where a template has room for one. Check how CV templates read identifiers today before writing the help text.
  • When the primary row is removed, the next one becomes primary, as for other blocks (the removal dialog's data-hands-on sentence).

Accessibility

  • As <c-primary-choice>: a real radio named "Primary", visually a filled or outline star, distinguishable in forced colours.

Notes

  • Help text for the identifiers' topic in core/help.py changes, and that goes through the catalogues and Weblate. "Primary" already exists.
  • ordering should put the primary first (("-is_primary", "scheme", "value")), as the other models do.

Related: #303, #307, #866.

Checked against main at 56fc9d531.

On *Your details*, one identifier can be marked primary with a star at the start of its row, as the rows of telephone numbers, links, messaging and addresses already can. ## What exists today - `accounts/models.py`, `PersonIdentifier`: `scheme`, `value`, `label`. **No `is_primary`.** `Meta.ordering = ("scheme", "value")`, and a unique constraint on `(profile, scheme)` keeps one identifier of each kind (#307). - The row is `<c-identifier-row>` (`templates/cotton/identifier_row.html`), shared with a company's form: Type, Identifier, Name (when Other), and the bin (`<c-remove-button>`) on Your details. No star. - The other blocks draw the star with `<c-primary-choice name="<prefix>-primary" value="{{ row.prefix }}" :checked="row.instance.is_primary" />` (#303). It is a radio shared by the block's rows, shown as a star, with the label as a 24px target. Their models carry `is_primary` with a unique constraint "one primary per holder" (for example `one_primary_web_link_per_holder_and_kind`). Since #866 the star comes first in the row and the bin last. - `profile.html` draws the identifiers in a `<fieldset class="card" data-identifiers id="section-identifiers">`. ## What would change - `PersonIdentifier.is_primary` (default false), with a constraint of one primary per profile, a migration, and the archive format, the API schema and the importers carrying it. - `<c-identifier-row>` draws `<c-primary-choice>` first in the row when `remove_at_once` (Your details). The formset saves the chosen row as primary the way the other blocks' formsets do. A company's form is unchanged unless company identifiers get a primary too (not requested). - Say what primary means. The other blocks' primary is what a document prints first. For identifiers that is the one a CV prints first, or alone where a template has room for one. Check how CV templates read identifiers today before writing the help text. - When the primary row is removed, the next one becomes primary, as for other blocks (the removal dialog's `data-hands-on` sentence). ## Accessibility - As `<c-primary-choice>`: a real radio named "Primary", visually a filled or outline star, distinguishable in forced colours. ## Notes - Help text for the identifiers' topic in `core/help.py` changes, and that goes through the catalogues and Weblate. "Primary" already exists. - `ordering` should put the primary first (`("-is_primary", "scheme", "value")`), as the other models do. Related: #303, #307, #866. Checked against `main` at `56fc9d531`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo#922
No description provided.