@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/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to