[openstreetmap/openstreetmap-website] Hide the anonymous note creation form when the limit is exceeded (PR #6593)

Pablo Brasero notifications at github.com
Mon Dec 8 14:59:07 UTC 2025


@pablobm commented on this pull request.

I'm pessimistic about this solution... but I don't have the experience of dealing with anonymous notes every day, so I cannot tell for sure. I think it's worth trying, if only because it's very low hanging fruit. The DWG can then report back to let us know what they observed.

I don't know that the expiry needs to be reduced to 14 days, but also open on that one.

> +<% soft_anonymous_notes_limit_reached = !current_user && @anonymous_notes_count >= 5
+   anonymous_notes_limit_reached = !current_user && @anonymous_notes_count >= 10
+   warn_class = anonymous_notes_limit_reached ? "alert-danger" : "alert-warning" %>

I think this section is a bit too much code for a template. How about moving these to helpers? Also I would rename the "normal" limit as `hard_` for a better contrast with the soft limit, and `warn_class` to something that explains what it warns about:

```
    def soft_anonymous_notes_limit_reached
      !current_user && @anonymous_notes_count >= 5
    end

    def hard_anonymous_notes_limit_reached
      !current_user && @anonymous_notes_count >= 10
    end

    def anonymous_notes_limit_warn_class
      anonymous_notes_limit_reached ? "alert-danger" : "alert-warning"
    end
```

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

Message ID: <openstreetmap/openstreetmap-website/pull/6593/review/3552445947 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251208/bfc61fbf/attachment-0001.htm>


More information about the rails-dev mailing list