]> git.openstreetmap.org Git - rails.git/commitdiff
Move max value of issues counter to settings
authorAnton Khorev <tony29@yandex.ru>
Thu, 24 Aug 2023 15:38:03 +0000 (18:38 +0300)
committerAnton Khorev <tony29@yandex.ru>
Fri, 1 Sep 2023 04:14:45 +0000 (07:14 +0300)
app/helpers/issues_helper.rb
config/initializers/config.rb
config/settings.yml

index 7bc64cb83914d71fe4aa47fdbda94515c4c5e414..aab742bf5bbb68fe93129ebb831d6d53f35ae485 100644 (file)
@@ -26,9 +26,9 @@ module IssuesHelper
   end
 
   def open_issues_count
-    count = Issue.visible_to(current_user).open.limit(100).size
-    if count > 99
-      tag.span("99+", :class => "badge count-number")
+    count = Issue.visible_to(current_user).open.limit(Settings.max_issues_count).size
+    if count >= Settings.max_issues_count
+      tag.span("#{Settings.max_issues_count - 1}+", :class => "badge count-number")
     elsif count.positive?
       tag.span(count, :class => "badge count-number")
     end
index 983f0226669327e394b8577e34ac9ab845fde488..c1cc522a5e13b24eef5b2bae373c512d403b82f6 100644 (file)
@@ -77,6 +77,7 @@ Config.setup do |config|
     required(:tracepoints_per_page).filled(:int?)
     required(:max_number_of_way_nodes).filled(:int?)
     required(:max_number_of_relation_members).filled(:int?)
+    required(:max_issues_count).filled(:int?)
     required(:api_timeout).filled(:int?)
     required(:imagery_blacklist).maybe(:array?)
     required(:status).filled(:str?, :included_in? => ALLOWED_STATUS)
index 3ea298efcb4378f4073397d02d301d785c772ff2..2274d727c12606cd6294e40b21f38168c97ccf01 100644 (file)
@@ -43,6 +43,8 @@ max_note_request_area: 25
 default_note_query_limit: 100
 # Maximum limit on the number of notes returned by the note search api method
 max_note_query_limit: 10000
+# Maximum value of open issues counter for moderators, anything equal or over this value "n" is shown as "(n-1)+"
+max_issues_count: 100
 # Zoom level to use for postcode results from the geocoder
 postcode_zoom: 15
 # Timeout for API calls in seconds