From: Tom Hughes Date: Thu, 28 Sep 2023 15:35:05 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/4260' X-Git-Tag: live~1066 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/32ffd66eb5cb888b47446ae5053ab57f8a1e83cf?hp=c975bae5074e4211a86458856030f0d17eaef917 Merge remote-tracking branch 'upstream/pull/4260' --- diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index 71fdf3978..a4afdf576 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -1,30 +1,58 @@ +html { + height: 100%; +} + +body { + height: 100%; + margin: 0; +} + +#content { + height: 100%; +} + header, -#sidebar, -#permalink, .leaflet-control { display: none; } -html { - height: 100%; +.map-layout .overlay-sidebar #sidebar { + display: none; +} + +.map-layout #sidebar { + page-break-after: always; + + & > * { + display: none; + } + #sidebar_content { + display: unset; + } + + button, + input, + textarea, + .secondary-actions { + display: none; + } +} + +#map-ui { + display: none !important; } #map { - position: absolute !important; - top: 0; - bottom: 40px; - left: 0; - right: 0; + position: relative; + height: calc(100% - 40px); + box-sizing: border-box; border: 1px solid black; } /* Rules for attribution text under the main map shown on printouts */ #attribution { - position: absolute !important; - bottom: 0; - left: 0; - right: 0; + page-break-inside: avoid; height: 40px; font-size: 12px; text-align: center; diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 7bc64cb83..55bd0952f 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -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(I18n.t("count.at_least_pattern", :count => Settings.max_issues_count), :class => "badge count-number") elsif count.positive? tag.span(count, :class => "badge count-number") end diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index 31386b1ab..2f785079c 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -2,14 +2,12 @@
-
-
+
+ <%= link_to t("site.search.where_am_i"), "#", :class => "describe_location position-absolute", :title => t("site.search.where_am_i_title") %> - <%= text_field_tag "query", params[:query], :placeholder => t("site.search.search"), :autofocus => autofocus, :autocomplete => "on", :class => "form-control form-control-sm", :dir => "auto" %> -
-
- <%= submit_tag t("site.search.submit_text"), :class => "btn btn-sm btn-primary", :data => { :disable_with => false } %> -
+ <%= text_field_tag "query", params[:query], :placeholder => t("site.search.search"), :autofocus => autofocus, :autocomplete => "on", :class => "form-control form-control-sm rounded-0 rounded-start border-end-0", :dir => "auto" %> + + <%= submit_tag t("site.search.submit_text"), :class => "btn btn-sm btn-primary rounded-0 rounded-end", :data => { :disable_with => false } %>
diff --git a/app/views/traces/index.html.erb b/app/views/traces/index.html.erb index ddbaa9e94..63ade87d7 100644 --- a/app/views/traces/index.html.erb +++ b/app/views/traces/index.html.erb @@ -47,15 +47,14 @@ <% end %> - - diff --git a/config/initializers/config.rb b/config/initializers/config.rb index 983f02266..c1cc522a5 100644 --- a/config/initializers/config.rb +++ b/config/initializers/config.rb @@ -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) diff --git a/config/locales/ca.yml b/config/locales/ca.yml index 7347dcee2..c3212eab2 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -2059,6 +2059,7 @@ ca: contributors_at_stadt_wien: Ciutat de Viena contributors_at_cc_by: CC BY contributors_at_land_vorarlberg: Estat de Vorarlberg + contributors_at_cc_by_at_with_amendments: CC BY AT amb esmenes contributors_au_australia: Austràlia contributors_ca_canada: Canadà contributors_fi_finland: Finlàndia @@ -3037,6 +3038,7 @@ ca: cyclosm: CyclOSM cycle_map: Mapa ciclista transport_map: Mapa de transports + tracestracktop_topo: Tracestrack Topo hot: Humanitari opnvkarte: ÖPNVKarte (mapa de transport públic) layers: @@ -3055,6 +3057,8 @@ ca: andy_allan: Andy Allan opnvkarte_credit: Tessel·les cortesia de %{memomaps_link} memomaps: MeMoMaps + tracestrack_credit: Tessel·les cortesia de %{tracestrack_link} + tracestrack: Tracestrack hotosm_credit: Estil de tessel·les per %{hotosm_link}, hostatjades per %{osm_france_link} hotosm_name: Equip humanitari de l'OpenStreetMap site: diff --git a/config/locales/ce.yml b/config/locales/ce.yml index e6b897d58..2a3b9bacc 100644 --- a/config/locales/ce.yml +++ b/config/locales/ce.yml @@ -187,7 +187,7 @@ ce: closed: ДӀачӀагӀа version: Верси in_changeset: Нисдарш - anonymous: цӀе хьулйина + anonymous: аноним no_comment: (коммент йац) part_of: Дакъалоцу цу download_xml: Схьаэца XML @@ -273,7 +273,7 @@ ce: telephone_link: Телпо тоха %{phone_number} query: title: ХӀун йу кхузахь? - introduction: Уллера объекташ карайан, картан тӀетаӀае + introduction: Уллера объекташ карайан, картин тӀетаӀайe nearby: Уллера объекташ enclosing: Йолу меттиг changesets: @@ -691,13 +691,13 @@ ce: title_html: Хаам %{link} categories: diary_entry: - other_label: Кхиерг + other_label: Кхийерг diary_comment: - other_label: Кхиерг + other_label: Кхийерг user: - other_label: Кхиерг + other_label: Кхийерг note: - other_label: Кхиерг + other_label: Кхийерг layouts: logout: Болх дӀаберзор log_in: ЧугӀо @@ -706,7 +706,7 @@ ce: export: Экспорт issues: Проблемаш data: Хаамаш - export_data: Хаамаш экспортъян + export_data: Хаамаш экспортбан gps_traces: GPS-трекаш gps_traces_tooltip: Болхбе GPS-трекашца user_diaries: Декъашхочун дневник @@ -968,7 +968,7 @@ ce: hidden_title: 'Къайлайаьккхина билгало #%{note_name}' report: Хаамбе хӀокху билгалонах hide: Къайлайаккха - resolve: Кечъян + resolve: Кечйан reactivate: Йуха йела comment_and_resolve: Жопделла кечъе comment: Жопдала diff --git a/config/locales/en.yml b/config/locales/en.yml index 530dad207..da346e8e8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -5,6 +5,8 @@ en: formats: friendly: "%e %B %Y at %H:%M" blog: "%e %B %Y" + count: + at_least_pattern: "%{count}+" helpers: file: prompt: Choose file diff --git a/config/locales/eo.yml b/config/locales/eo.yml index ed291ca35..7c0cb4abd 100644 --- a/config/locales/eo.yml +++ b/config/locales/eo.yml @@ -3014,6 +3014,7 @@ eo: cyclosm: CyclOSM cycle_map: Biciklada mapo transport_map: Transporta mapo + tracestracktop_topo: Topografia mapo hot: Hom-helpa mapo opnvkarte: ÖPNVKarte layers: @@ -3032,6 +3033,8 @@ eo: andy_allan: Andy ALLAN opnvkarte_credit: Kaheloj danke al %{memomaps_link} memomaps: MeMoMaps + tracestrack_credit: Kaheloj danke al %{tracestrack_link} + tracestrack: Tracestrack hotosm_credit: 'Stilo de kaheloj: %{hotosm_link}, retgastigo: %{osm_france_link}' hotosm_name: HOTOSM site: diff --git a/config/locales/es.yml b/config/locales/es.yml index 3fe57337b..0a0ccc633 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -3164,6 +3164,7 @@ es: cyclosm: CyclOSM cycle_map: Mapa ciclista transport_map: Mapa de transporte + tracestracktop_topo: Tracestrack Topo hot: Humanitario opnvkarte: ÖPNVKarte layers: @@ -3183,6 +3184,7 @@ es: andy_allan: Andy Allan opnvkarte_credit: Teselas cortesía de %{memomaps_link} memomaps: MeMoMaps + tracestrack: Tracestrack hotosm_credit: Estilo de teselas por %{hotosm_link} alojados por %{osm_france_link} hotosm_name: Equipo humanitario de OpenStreetMap site: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 553f83479..2a9a4566d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -100,6 +100,8 @@ fr: formats: friendly: '%e %B %Y à %-Hh%M' blog: '%e %B %Y' + count: + at_least_pattern: '%{count}+' helpers: file: prompt: Choisir un fichier @@ -3215,6 +3217,7 @@ fr: cyclosm: CyclOSM cycle_map: Carte cyclable transport_map: Carte de transport + tracestracktop_topo: Topo de Tracestack hot: Humanitaire opnvkarte: ÖPNVKarte layers: @@ -3233,6 +3236,8 @@ fr: andy_allan: Andy Allan opnvkarte_credit: Carreaux fournis aimablement par %{memomaps_link} memomaps: MeMoMaps + tracestrack_credit: Carreaux fournis aimablement par %{tracestrack_link} + tracestrack: Tracestrack hotosm_credit: Style de carreaux par %{hotosm_link} hébergé par %{osm_france_link} hotosm_name: L’Équipe OpenStreetMap Humanitaire site: diff --git a/config/locales/ro.yml b/config/locales/ro.yml index f9007390f..8d330bf6b 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -24,6 +24,8 @@ ro: time: formats: friendly: '%e %B %Y la %H:%M' + count: + at_least_pattern: '%{count}+' helpers: file: prompt: Selectează fișier @@ -259,6 +261,7 @@ ro: reopened_at_by_html: Reactivat %{when} de %{user} rss: title: Note OpenStreetMap + description_all: O listă de note raportate, comentate sau închise description_area: O listă de note, raportate, comentate sau închise în zona dvs. [(%{min_lat}|%{min_lon}) -- (%{max_lat}|%{max_lon})] description_item: Un feed RSS pentru nota %{id} @@ -2806,6 +2809,7 @@ ro: remove as friend: Scoate din lista de prieteni add as friend: Adaugă Prieten mapper since: 'Cartograf din:' + uid: 'ID-ul de utilizator:' ct status: 'Termenii colaboratorului:' ct undecided: Nedefinit ct declined: Declinat @@ -3100,6 +3104,7 @@ ro: cyclosm: CyclOSM cycle_map: Hartă de ciclism transport_map: Hartă de transport + tracestracktop_topo: Tracestrack Topo hot: Umanitară opnvkarte: ÖPNVKarte layers: @@ -3118,6 +3123,8 @@ ro: andy_allan: Andy Allan opnvkarte_credit: Tile-uri prin amabilitatea lui %{memomaps_link} memomaps: MeMoMaps + tracestrack_credit: Tile-uri prin amabilitatea lui %{tracestrack_link} + tracestrack: Tracetrack hotosm_credit: Stilul tile-urilor creat de %{hotosm_link} găzduit de %{osm_france_link} hotosm_name: Echipa Umanitară OpenStreetMap site: diff --git a/config/locales/sr-Latn.yml b/config/locales/sr-Latn.yml index 470019435..a52058254 100644 --- a/config/locales/sr-Latn.yml +++ b/config/locales/sr-Latn.yml @@ -1,4 +1,4 @@ -# Messages for Serbian (Latin script) (srpski (latinica)) +# Messages for srpski (latinica) (srpski (latinica)) # Exported from translatewiki.net # Export driver: phpyaml # Author: Macofe diff --git a/config/locales/sr.yml b/config/locales/sr.yml index d015c9baf..ea60020c7 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1,4 +1,4 @@ -# Messages for Serbian (Cyrillic script) (српски (ћирилица)) +# Messages for српски (ћирилица) (српски (ћирилица)) # Exported from translatewiki.net # Export driver: phpyaml # Author: Acamicamacaraca diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index b61dd8fa6..d6346f981 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1699,7 +1699,7 @@ zh-TW: send_message_to_html: 寄出新訊息給 %{name} back_to_inbox: 回到收件匣 create: - message_sent: 訊息已寄出 + message_sent: 已傳送訊息 limit_exceeded: 您最近寄出了大量的訊息。在嘗試寄出其他訊息之前請稍候。 no_such_message: title: 沒有這個訊息 diff --git a/config/settings.yml b/config/settings.yml index e228247e0..214f8a284 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -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 greater to this value "n" is shown as "n+" +max_issues_count: 99 # Zoom level to use for postcode results from the geocoder postcode_zoom: 15 # Timeout for API calls in seconds diff --git a/test/helpers/issues_helper_test.rb b/test/helpers/issues_helper_test.rb new file mode 100644 index 000000000..f0b7c884a --- /dev/null +++ b/test/helpers/issues_helper_test.rb @@ -0,0 +1,30 @@ +require "test_helper" + +class IssuesHelperTest < ActionView::TestCase + attr_accessor :current_user + + def test_issues_count + target_user = create(:user) + self.current_user = create(:moderator_user) + + n = (Settings.max_issues_count - 1) + n.times do + create(:note_with_comments) do |note| + create(:issue, :reportable => note, :reported_user => target_user, :assigned_role => "moderator") + end + end + expected = <<~HTML.delete("\n") + #{n} + HTML + assert_dom_equal expected, open_issues_count + + n += 1 + create(:note_with_comments) do |note| + create(:issue, :reportable => note, :reported_user => target_user, :assigned_role => "moderator") + end + expected = <<~HTML.delete("\n") + #{n}+ + HTML + assert_dom_equal expected, open_issues_count + end +end