Map pins drawn as the company's logo or the person's picture, where there is one #914
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#914
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On the map, a pin whose holder has a picture shows that picture instead of the plain dot: a company's logo, or the person's own picture for their own addresses. It uses Basecoat's avatar.
What exists today
static/js/app.js, inreadyMaps(after themarkerClusterGroupset-up): every marker isL.marker(point, { icon: L.divIcon({ className: entry.company ? "map-pin" : "map-pin map-pin-person", iconSize: [24, 24] }), title, alt, company })..map-canvas .map-pin::after(a 16px brand-coloured disc inside a 24px box, for SC 2.5.8) and.map-pin-person::after(ringed) inassets/css/app.css. The CSS is unlayered because Leaflet's CSS loads afterapp.css.CompanyMapView.get_context_data(jobs/views.py) buildsdrawn:lat,lon,name,url,what,place,company. It carries no picture.pinned_addressesgives companies' addresses, plus contacts' and the person's own whereon_mapis ticked.{% company_logo %}(jobs:company_logo, served by the instance) and{% avatar %}(accounts:avatar), both incore/templatetags/postulo.py. Contacts have no picture field.avatarcomponent is imported (#290–#292)._tile()in the same module draws the initials tile.tiles.policy_for, which adds the tile origin to the site'simg-src. Both pictures are same-origin, so no CSP change is needed.What would change
drawngains apictureURL (with the same?v=cache stamp the tags use) where the holder has one: the company's logo, or the profile picture for the person's own addresses. Contacts and companies without a logo keep the dot. An initials tile is not used as a pin, because a field of coloured letters reads worse than dots. Confirm this.divIconholds a Basecoatavatar(<span class="avatar">with an<img alt="">) in place of the::afterdot. It stays round for people and rounded-square for companies, as the tags draw them, with a ring in the brand colour so it reads as a pin over any tile.titleandalt(the holder's name), so the picture is decorative (alt=""on the inner image) and the accessible name does not change..map-cluster) stay as they are.errorlistener swaps the class).To check
accounts:avatarandjobs:company_logoviews must keep the same access checks when many are asked for at once (one request per visible pin).CanvasText).No new strings.
Related: #702, #703, #898.
Checked against
mainat56fc9d531.