]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/4260'
authorTom Hughes <tom@compton.nu>
Thu, 28 Sep 2023 15:35:05 +0000 (16:35 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 28 Sep 2023 15:35:05 +0000 (16:35 +0100)
17 files changed:
app/assets/stylesheets/print.scss
app/helpers/issues_helper.rb
app/views/layouts/_search.html.erb
app/views/traces/index.html.erb
config/initializers/config.rb
config/locales/ca.yml
config/locales/ce.yml
config/locales/en.yml
config/locales/eo.yml
config/locales/es.yml
config/locales/fr.yml
config/locales/ro.yml
config/locales/sr-Latn.yml
config/locales/sr.yml
config/locales/zh-TW.yml
config/settings.yml
test/helpers/issues_helper_test.rb [new file with mode: 0644]

index 71fdf3978086dab10841e66ca4cb40615ed05810..a4afdf576e7e7261956fcd00345ac491bd432db2 100644 (file)
@@ -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;
index 7bc64cb83914d71fe4aa47fdbda94515c4c5e414..55bd0952f7ef27047117953f1010a833a161bfba 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(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
index 31386b1ab291dc30408c8597a002bf7bd45b81ab..2f785079c8eb21bae3861c3a68d94cc7bac61ace 100644 (file)
@@ -2,14 +2,12 @@
   <form method="GET" action="<%= search_path %>" class="search_form px-1 py-2">
     <div class="row gx-2 mx-0">
       <div class="col">
-        <div class="input-group flex-nowrap">
-          <div class='query_wrapper position-relative flex-grow-1'>
+        <div class="d-flex">
+          <span class='position-relative flex-grow-1'>
             <%= 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" %>
-          </div>
-          <div class="input-group-append">
-            <%= submit_tag t("site.search.submit_text"), :class => "btn btn-sm btn-primary", :data => { :disable_with => false } %>
-          </div>
+            <%= 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" %>
+          </span>
+          <%= submit_tag t("site.search.submit_text"), :class => "btn btn-sm btn-primary rounded-0 rounded-end", :data => { :disable_with => false } %>
         </div>
       </div>
       <div class="col-auto">
index ddbaa9e940677cbd9e8b1d1617bf481cda03d5e9..63ade87d7dd6eb9445789d141d404c60da672dfa 100644 (file)
       </li>
     <% end %>
 
-    <li class="nav-item flex-sm-grow-1"></li>
-    <li class="nav-item">
-      <div class="px-3 py-2 py-sm-0">
-        <%= link_to({ :action => :georss, :display_name => @target_user&.display_name, :tag => params[:tag] }, { :class => "btn btn-secondary btn-sm" }) do %>
-          <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="white" viewBox="0 0 16 16">
-            <path d="M5.5 12a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0zm-3-8.5a1 1 0 0 1 1-1c5.523 0 10 4.477 10 10a1 1 0 1 1-2 0 8 8 0 0 0-8-8 1 1 0 0 1-1-1zm0 4a1 1 0 0 1 1-1 6 6 0 0 1 6 6 1 1 0 1 1-2 0 4 4 0 0 0-4-4 1 1 0 0 1-1-1z" />
-          </svg>
-        <% end -%>
-        <%= link_to t(".upload_trace"), new_trace_path, :class => "btn btn-secondary btn-sm" %>
+    <li class="nav-item ms-auto">
+      <div class="nav-link pe-0">
+        <%= link_to({ :action => :georss, :display_name => @target_user&.display_name, :tag => params[:tag] }, { :class => "btn btn-secondary btn-sm my-n2 align-baseline border-0" }) do %>
+          <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" class="align-text-bottom">
+            <circle cx="2" cy="14" r="2" fill="white" />
+            <path d="M 8 14 a 6 6 0 0 0 -6 -6 M 14 14 a 12 12 0 0 0 -12 -12" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" />
+          </svg><% end -%>
+        <%= link_to t(".upload_trace"), new_trace_path, :class => "btn btn-secondary btn-sm my-n2 align-baseline border-0" %>
       </div>
     </li>
   </ul>
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 7347dcee2c901cac97d195ee8e45cb391921847d..c3212eab2488a4d5eedfa34e919ec03b05877a8f 100644 (file)
@@ -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:
index e6b897d585a2277ae3e8eaa2b878c3c7dee458f8..2a3b9bacc7218e312f4a85a1c568506d50968f2f 100644 (file)
@@ -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: Ð£Ð»Ð»ÐµÑ\80а Ð¾Ð±Ñ\8aекÑ\82аÑ\88 ÐºÐ°Ñ\80айан, ÐºÐ°Ñ\80Ñ\82ан Ñ\82Ó\80еÑ\82аÓ\80ае
+      introduction: Ð£Ð»Ð»ÐµÑ\80а Ð¾Ð±Ñ\8aекÑ\82аÑ\88 ÐºÐ°Ñ\80айан, ÐºÐ°Ñ\80Ñ\82ин Ñ\82Ó\80еÑ\82аÓ\80айe
       nearby: Уллера объекташ
       enclosing: Йолу меттиг
   changesets:
@@ -691,13 +691,13 @@ ce:
       title_html: Хаам %{link}
       categories:
         diary_entry:
-          other_label: Кхиерг
+          other_label: Ð\9aÑ\85ийеÑ\80г
         diary_comment:
-          other_label: Кхиерг
+          other_label: Ð\9aÑ\85ийеÑ\80г
         user:
-          other_label: Кхиерг
+          other_label: Ð\9aÑ\85ийеÑ\80г
         note:
-          other_label: Кхиерг
+          other_label: Ð\9aÑ\85ийеÑ\80г
   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: Жопдала
index 530dad2079f530f8134ee38cd37a020e68baafeb..da346e8e89abb15497867e4e8fd30db39824d1a1 100644 (file)
@@ -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
index ed291ca35ab114fdc1e7c1fd822752f3dbf6475d..7c0cb4abdc4be635b96406941741b4392a932e71 100644 (file)
@@ -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:
index 3fe57337bcaf4fe1d63a3c7974be86c037660dcb..0a0ccc633f3986f4dc7a6c1c8bf1756fd9844b3f 100644 (file)
@@ -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:
index 553f83479e77a62148b339d2708335fa9f9a19ab..2a9a4566d6e173ba1b001c6c397c5a359d90baa2 100644 (file)
@@ -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:
index f9007390f026dd35fc23b7e5318124acfe86c364..8d330bf6b12cfae4d19246f489d19748252cd7f5 100644 (file)
@@ -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:
index 470019435c0f6b3fdea99edacb7f07f351c5b65c..a520582543154ffdaaf039b16a40f596ffc8746a 100644 (file)
@@ -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
index d015c9baf3108f0d23de4a9a873ce907416bb9a7..ea60020c7de8b583f7d993278bb0619f1ec272b4 100644 (file)
@@ -1,4 +1,4 @@
-# Messages for Serbian (Cyrillic script) (српски (ћирилица))
+# Messages for српски (ћирилица) (српски (ћирилица))
 # Exported from translatewiki.net
 # Export driver: phpyaml
 # Author: Acamicamacaraca
index b61dd8fa6867fc3f4155fdba09d2ec86844e6a89..d6346f981a6d49e183562bb161408015158ba56e 100644 (file)
@@ -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: 沒有這個訊息
index e228247e03d617b5a4d1cd957b21b6498dca01e3..214f8a284e000168234913326293f7760c96c08d 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 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 (file)
index 0000000..f0b7c88
--- /dev/null
@@ -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")
+      <span class="badge count-number">#{n}</span>
+    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")
+      <span class="badge count-number">#{n}+</span>
+    HTML
+    assert_dom_equal expected, open_issues_count
+  end
+end