Company logo: changed in the edit view by clicking the logo, in a dialog of its own #853

Closed
opened 2026-10-10 16:01:24 +00:00 by tiagoagueda · 2 comments
Owner

Move logo editing to the company's edit view: clicking the logo opens a dedicated dialog.

What exists today

  • The company page draws the logo (templates/jobs/company_detail.html:10) and a Find/Refresh logo dialog in its header (:55-61, :70-86, posting to jobs:company_logo_action).
  • A bug found on the way: CompanyForm defines logo_url, logo_upload and remove_logo (jobs/forms.py:130-152, handled at :270-314), but templates/jobs/company_form.html never draws them, and its form has no enctype="multipart/form-data" (:10). Upload, an address and Remove are unreachable from the interface; only tests use them (tests/test_logos.py:396-421). parent is in Meta.fields and not drawn either.

What would change

  • The edit view draws the logo as a button opening a dialog with: Find from the website, an address, an upload, Remove.
  • The form posts multipart/form-data, or the dialog posts on its own to company_logo_action (which already has a remove path, jobs/views.py:510-531).
  • The detail header loses Find/Refresh logo.

Decisions

  • One form or its own dialog form. Recommended: its own, so changing a logo does not save the rest of the form, as Your details' picture does.
  • parent: drawn, or removed from Meta.fields; recommended removed here and drawn where company structure is shown.

Checked against main at 8c3d03570. From the maintainer's improvements list of 2026-10-07.

Move logo editing to the company's edit view: clicking the logo opens a dedicated dialog. ## What exists today - The company page draws the logo (`templates/jobs/company_detail.html:10`) and a *Find/Refresh logo* dialog in its header (`:55-61`, `:70-86`, posting to `jobs:company_logo_action`). - **A bug found on the way**: `CompanyForm` defines `logo_url`, `logo_upload` and `remove_logo` (`jobs/forms.py:130-152`, handled at `:270-314`), but `templates/jobs/company_form.html` never draws them, and its form has no `enctype="multipart/form-data"` (`:10`). Upload, an address and Remove are unreachable from the interface; only tests use them (`tests/test_logos.py:396-421`). `parent` is in `Meta.fields` and not drawn either. ## What would change - The edit view draws the logo as a button opening a dialog with: Find from the website, an address, an upload, Remove. - The form posts `multipart/form-data`, or the dialog posts on its own to `company_logo_action` (which already has a remove path, `jobs/views.py:510-531`). - The detail header loses *Find/Refresh logo*. ## Decisions - **One form or its own dialog form.** Recommended: its own, so changing a logo does not save the rest of the form, as Your details' picture does. - **`parent`**: drawn, or removed from `Meta.fields`; recommended removed here and drawn where company structure is shown. Checked against `main` at `8c3d03570`. From the maintainer's improvements list of 2026-10-07.
tiagoagueda added this to the 0.6.0 milestone 2026-10-10 16:01:24 +00:00
Author
Owner

Fixed in 89e265040 on main.

Fixed in 89e265040 on main.
Author
Owner

Decision note: the company form now draws parent instead of dropping it from Meta.fields. It was never drawn, so every save with the structure feature on cleared the company's parent; and nothing else sets it, so removing it would have left the feature with no way in. The logo fields stay on CompanyForm for the importers and tests; the dialog posts a form of its own.

Decision note: the company form now **draws** `parent` instead of dropping it from `Meta.fields`. It was never drawn, so every save with the structure feature on cleared the company's parent; and nothing else sets it, so removing it would have left the feature with no way in. The logo fields stay on `CompanyForm` for the importers and tests; the dialog posts a form of its own.
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#853
No description provided.