pablobm left a comment (openstreetmap/openstreetmap-website#6606)

I was just playing with the location of the "Edit Heatmap" button, to put it 
next to the heading as suggested by @1ec5. I found it to be trickier than it 
seems, let me explain:
- If  the heatmap is enabled, this is retrieved via an Ajax request (with a 
Turbo Frame). This will include the heading.
- There are three use cases:
        - Disabled: no Ajax request.
        - Enabled, but no contributions: the Ajax request takes place, renders 
a mostly empty result, with no heading.
        - Enabled, there are contributions: the Ajax request takes place, 
renders the heatmap with the heading.
- The check of whether there are contributions takes place when rendering the 
HTML retrieved via Ajax.
- To place the button, visually:
        - When the heatmap is rendered, we can put the button next to the 
heading, a-ok.
        - If not rendered (whatever the reason), we'll have to put a button 
roughly like the one I showed above. Not necessarily as wide, but a button in 
that general area nonetheless.
- To place the button, in terms of code:
        - No issue if the heatmap is rendering.
        - If enabled but no contributions available, we'll only know when 
responding to the Ajax request. The standalone button will have to be rendered 
as part of the "heatmap" template.
        - If disabled, we know at users/show time and the Ajax request doesn't 
take place. The button will have to be rendered as part of users/show.

Technically all this could be worked around, but I don't think it's worth the 
effort.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6606#issuecomment-3665981953
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/6606/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to