Places: show the city alone while everything is in one country, keep City, Country otherwise #1249

Open
opened 2026-11-13 10:42:05 +00:00 by tiagoagueda · 0 comments
Owner

The need

Where every place a person deals with is in one country, writing the country on each of them is noise: a list of French companies reads Paris, France, Lyon, France, Lille, France, ... and the eye has to skip the same word on every row. When only French companies are listed or available to the person, show Paris. As soon as companies from other countries exist for that person, City, Country is kept everywhere, so a row is never ambiguous.

Rule

  • Nothing is removed from the data. Addresses keep their country; this is only what is displayed.
  • A person has a set of countries: the countries of the addresses on the companies they can see (their own, shared with them, and the ones they import or look up), plus their own address. If the set holds one country, places are shown as the city alone; if it holds two or more, as City, Country (as one_line and location_line do today).
  • The set is worked out in one place (one helper, cached for the request) and every display goes through it: the Companies list and cards, the company page, listings and applications that print a place, the map's popups, the calendar's event places, the command bar, the API's display fields.
  • An empty or unknown country counts as no country, so a company with none never forces the country onto the others.
  • A person can override it in Settings: "Show the country: automatically / always / never", the automatic one being the rule above.

What stays as it is

  • Documents (CV, letter, their previews and the PDF): the CV guidance is a city and a country, and a document goes to someone else who does not share this person's set. They keep the country (printed_location and location_line). Say in the decision if the person's own country may be dropped there by their choice.
  • Exports, the API's data fields, the CSV, the archive and shares: always carry the country.
  • The Edit form still asks for it, as a field with the person's country already chosen (see #1250 on asking less).

Where to look

core/postal.py (location_line, printed_location), core/models.py (PostalAddress.one_line), core/personal.py (place_text), the company templates, core/phones.country_name.

Tests

One country: only the city shows, in every place listed above; adding one company from another country makes every place show City, Country at once; removing it brings the short form back; an address with no country does not change the answer; the setting's three values; documents and exports unchanged. The country name follows the reader's language.

Strings go through Weblate only.

## The need Where every place a person deals with is in one country, writing the country on each of them is noise: a list of French companies reads `Paris, France`, `Lyon, France`, `Lille, France`, ... and the eye has to skip the same word on every row. When only French companies are listed or available to the person, show **`Paris`**. As soon as companies from other countries exist for that person, **`City, Country` is kept** everywhere, so a row is never ambiguous. ## Rule - **Nothing is removed from the data.** Addresses keep their country; this is only what is displayed. - A person has a **set of countries**: the countries of the addresses on the companies they can see (their own, shared with them, and the ones they import or look up), plus their own address. If the set holds **one** country, places are shown as the city alone; if it holds **two or more**, as `City, Country` (as `one_line` and `location_line` do today). - The set is worked out in one place (one helper, cached for the request) and every display goes through it: the Companies list and cards, the company page, listings and applications that print a place, the map's popups, the calendar's event places, the command bar, the API's display fields. - **An empty or unknown country** counts as no country, so a company with none never forces the country onto the others. - **A person can override it** in Settings: "Show the country: automatically / always / never", the automatic one being the rule above. ## What stays as it is - **Documents** (CV, letter, their previews and the PDF): the CV guidance is a city and a country, and a document goes to someone else who does not share this person's set. They keep the country (`printed_location` and `location_line`). Say in the decision if the person's own country may be dropped there by their choice. - **Exports, the API's data fields, the CSV, the archive and shares:** always carry the country. - **The Edit form** still asks for it, as a field with the person's country already chosen (see #1250 on asking less). ## Where to look `core/postal.py` (`location_line`, `printed_location`), `core/models.py` (`PostalAddress.one_line`), `core/personal.py` (`place_text`), the company templates, `core/phones.country_name`. ## Tests One country: only the city shows, in every place listed above; adding one company from another country makes every place show `City, Country` at once; removing it brings the short form back; an address with no country does not change the answer; the setting's three values; documents and exports unchanged. The country name follows the reader's language. Strings go through Weblate only.
tiagoagueda added this to the 0.6.0 milestone 2026-11-13 10:42:05 +00:00
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#1249
No description provided.