]> git.openstreetmap.org Git - rails.git/commitdiff
Add labels to nav elements and enable html-navigation-has-label (#7336) master
authorTom Hughes <tom@compton.nu>
Thu, 20 Aug 2026 21:17:36 +0000 (22:17 +0100)
committerGitHub <noreply@github.com>
Thu, 20 Aug 2026 21:17:36 +0000 (23:17 +0200)
17 files changed:
.herb.yml
app/views/application/_pagination.html.erb
app/views/dashboards/_contact.html.erb
app/views/dashboards/show.html.erb
app/views/diary_entries/_diary_entry.html.erb
app/views/diary_entries/_navigation.html.erb
app/views/elements/show.html.erb
app/views/issues/show.html.erb
app/views/layouts/_header.html.erb
app/views/moderation_zones/_navigation.html.erb
app/views/notes/_notes_paging_nav.html.erb
app/views/old_elements/_actions.html.erb
app/views/old_elements/index.html.erb
app/views/traces/_trace.html.erb
app/views/traces/index.html.erb
app/views/users/show.html.erb
config/locales/en.yml

index 43d0f7e928a2d64d4a6280e2315d9479b7d88f46..4ed90c97800ac2cdd542860b539e9f96877f9517 100644 (file)
--- a/.herb.yml
+++ b/.herb.yml
@@ -28,6 +28,8 @@ linter:
       enabled: false
     erb-strict-locals-required:
       enabled: true
       enabled: false
     erb-strict-locals-required:
       enabled: true
+    html-navigation-has-label:
+      enabled: true
     html-no-space-in-tag:
       enabled: true
     html-no-title-attribute:
     html-no-space-in-tag:
       enabled: true
     html-no-title-attribute:
index 6b827708b4fca5ca559941d2590e85ae1a10516a..5c0a3d6a72b31d0be0fe7e17476aed6e31e95ebe 100644 (file)
@@ -3,7 +3,7 @@
 <% if paginator.older_items_cursor || paginator.newer_items_cursor %>
 
 <% translation_scope ||= "application.pagination.#{controller.controller_name}" %>
 <% if paginator.older_items_cursor || paginator.newer_items_cursor %>
 
 <% translation_scope ||= "application.pagination.#{controller.controller_name}" %>
-<nav class="d-flex justify-content-between gap-2">
+<nav class="d-flex justify-content-between gap-2" aria-label="<%= t ".label" %>">
   <ul class="pagination">
     <%= pagination_item(paginator.newer_items_cursor && params.merge(:before => nil, :after => nil),
                         t(:newest, :scope => translation_scope)) do %>
   <ul class="pagination">
     <%= pagination_item(paginator.newer_items_cursor && params.merge(:before => nil, :after => nil),
                         t(:newest, :scope => translation_scope)) do %>
index c804ab55eb2b324ea358b0da124622eeed316668..d3f2f3ec7ef45bb9407da338b3aefc5df502fb67 100644 (file)
@@ -33,7 +33,7 @@
       <% end %>
     </p>
 
       <% end %>
     </p>
 
-    <nav class="secondary-actions">
+    <nav class="secondary-actions" aria-label="<%= t ".actions" %>">
       <ul class="text-body-secondary">
         <li><%= link_to t("users.show.send message"), new_message_path(contact) %></li>
         <li>
       <ul class="text-body-secondary">
         <li><%= link_to t("users.show.send message"), new_message_path(contact) %></li>
         <li>
index ba45237b0242088fe1b4f6d71c07f29e9cb9a1ed..9ecfc7cd6141fdb65c61e44b91b59a0193ddc4df 100644 (file)
@@ -29,7 +29,7 @@
     <% if @followings.empty? %>
       <%= t ".no followings" %>
     <% else %>
     <% if @followings.empty? %>
       <%= t ".no followings" %>
     <% else %>
-      <nav class="secondary-actions mb-3">
+      <nav class="secondary-actions mb-3" aria-label="<%= t ".followed_actions" %>">
         <ul>
           <li><%= link_to t(".followed_changesets"), friend_changesets_path %></li>
           <li><%= link_to t(".followed_diaries"), friends_diary_entries_path %></li>
         <ul>
           <li><%= link_to t(".followed_changesets"), friend_changesets_path %></li>
           <li><%= link_to t(".followed_diaries"), friends_diary_entries_path %></li>
@@ -47,7 +47,7 @@
     <% if @nearby_users.empty? %>
       <%= t ".no nearby users" %>
     <% else %>
     <% if @nearby_users.empty? %>
       <%= t ".no nearby users" %>
     <% else %>
-      <nav class="secondary-actions mb-3">
+      <nav class="secondary-actions mb-3" aria-label="<%= t ".nearby_actions" %>">
         <ul>
           <li><%= link_to t(".nearby_changesets"), nearby_changesets_path %></li>
           <li><%= link_to t(".nearby_diaries"), nearby_diary_entries_path %></li>
         <ul>
           <li><%= link_to t(".nearby_changesets"), nearby_changesets_path %></li>
           <li><%= link_to t(".nearby_diaries"), nearby_diary_entries_path %></li>
index b7c046dddd572761d26d6a58c14b8b1ef810e6e2..bac11e553a098fdf19ccb956ad0fca0fc04b73f5 100644 (file)
@@ -19,7 +19,7 @@
     <%= render :partial => "location", :object => diary_entry %>
   <% end %>
 
     <%= render :partial => "location", :object => diary_entry %>
   <% end %>
 
-  <nav class="secondary-actions">
+  <nav class="secondary-actions" aria-label="<%= t ".actions" %>">
     <ul>
       <% if params[:action] == 'index' %>
         <li><%= link_to t(".comment_link"), diary_entry_path(diary_entry.user, diary_entry, :anchor => "newcomment") %></li>
     <ul>
       <% if params[:action] == 'index' %>
         <li><%= link_to t(".comment_link"), diary_entry_path(diary_entry.user, diary_entry, :anchor => "newcomment") %></li>
index 1e1162438ab6bdf2712f80651fe20563d0735f28..3e92cb875d83278e8f4491471f1c9582c9028087 100644 (file)
@@ -1,6 +1,6 @@
 <%# locals: (user:, languages: []) %>
 
 <%# locals: (user:, languages: []) %>
 
-<nav class="secondary-actions">
+<nav class="secondary-actions" aria-label="<%= t ".actions" %>">
   <ul>
     <% unless params[:friends] or params[:nearby] -%>
       <li><%= rss_link_to :action => "rss", :language => params[:language] %></li>
   <ul>
     <% unless params[:friends] or params[:nearby] -%>
       <li><%= rss_link_to :action => "rss", :language => params[:language] %></li>
index cfbf0f71d4aaf6d31e1d3aa6bd682ef9ef3710da..57fe3089b4f4234d6f6baa7cfbf4ccfc6440ea52 100644 (file)
@@ -14,7 +14,7 @@
   </div>
 <% end %>
 
   </div>
 <% end %>
 
-<nav>
+<nav aria-label="<%= t "browse.versions_navigation.#{@type}_versions" %>">
   <ol class="breadcrumb mb-1">
     <li class="breadcrumb-item active" aria-current="page">
       <%= tag.span t(@type, :scope => "browse.versions_navigation"), :class => "py-1 px-2 rounded bg-body-secondary" %>
   <ol class="breadcrumb mb-1">
     <li class="breadcrumb-item active" aria-current="page">
       <%= tag.span t(@type, :scope => "browse.versions_navigation"), :class => "py-1 px-2 rounded bg-body-secondary" %>
index 0c92e140f07ad24ea011697243e1795e6660e551..adae73d608154ddfa269e40bd7476a9441d90b0e 100644 (file)
@@ -25,7 +25,7 @@
     <% end %>
   </small>
 </p>
     <% end %>
   </small>
 </p>
-<nav class="secondary-actions">
+<nav class="secondary-actions" aria-label="<%= t ".actions" %>">
   <ul>
     <% if @issue.may_resolve? %>
       <li><%= link_to t(".resolve"), resolve_issue_url(@issue), :method => :post %></li>
   <ul>
     <% if @issue.may_resolve? %>
       <li><%= link_to t(".resolve"), resolve_issue_url(@issue), :method => :post %></li>
index a4dc94c85d7fe56339f5b0178697f088d9e69e5e..3be1a06bb8904372fca2b1321e84e50fde0465ed 100644 (file)
@@ -13,7 +13,7 @@
   </h1>
   <section id="header-nav" class="flex-grow-1 collapse d-md-block">
     <%= content_for :header %>
   </h1>
   <section id="header-nav" class="flex-grow-1 collapse d-md-block">
     <%= content_for :header %>
-    <nav class="navbar-nav gap-2 flex-grow-1">
+    <nav class="navbar-nav gap-2 flex-grow-1" aria-label="<%= t ".navigation" %>">
       <div id="edit_tab" class="btn-group">
         <%= link_to t(".edit"),
                     edit_path,
       <div id="edit_tab" class="btn-group">
         <%= link_to t(".edit"),
                     edit_path,
index f79c6cb334923dbe13b9de020d852050513994a5..d7cabda5231bf3f7ef3d8ea0ddd7c838b8537ef8 100644 (file)
@@ -1,6 +1,6 @@
 <%# locals: () %>
 
 <%# locals: () %>
 
-<nav class="secondary-actions">
+<nav class="secondary-actions" aria-label="<%= t ".actions" %>">
   <ul>
     <li>
       <%= link_to new_moderation_zone_path, :class => "icon-link", :title => t(".new_title") do %>
   <ul>
     <li>
       <%= link_to new_moderation_zone_path, :class => "icon-link", :title => t(".new_title") do %>
index a590ca138be2b20c44ccf57c731bb849cb0f1a88..723978f42ae9e4e9950ffa9a5dc4920d0444009d 100644 (file)
@@ -1,6 +1,6 @@
 <%# locals: (page:, next_page:, params:) %>
 
 <%# locals: (page:, next_page:, params:) %>
 
-<nav>
+<nav aria-label="<%= t ".label" %>">
   <% link_class = "page-link icon-link text-center text-nowrap" %>
   <ul class="pagination">
     <% previous_link_content = capture do %>
   <% link_class = "page-link icon-link text-center text-nowrap" %>
   <ul class="pagination">
     <% previous_link_content = capture do %>
index 18ef1cbb200ba3e1989226de4358f58dd98f30c8..7a64b0af01c1c945abafec54723dd32252b80b09 100644 (file)
@@ -12,7 +12,7 @@
   <% end %>
 </div>
 
   <% end %>
 </div>
 
-<nav>
+<nav aria-label="<%= t "browse.versions_navigation.#{type}_versions" %>">
   <ol class="breadcrumb mb-1">
     <li class="breadcrumb-item">
       <%= link_to t(type, :scope => "browse.versions_navigation"), current_feature %>
   <ol class="breadcrumb mb-1">
     <li class="breadcrumb-item">
       <%= link_to t(type, :scope => "browse.versions_navigation"), current_feature %>
index 8f436b568541d82aa17ec198257acc843c0c146e..d654903e51a00875527f7f14d86b68e55919540a 100644 (file)
@@ -40,7 +40,7 @@
   <% end %>
 </div>
 
   <% end %>
 </div>
 
-<nav>
+<nav aria-label="<%= t ".#{@type}.actions" %>">
   <ol class="breadcrumb mb-1">
     <li class="breadcrumb-item">
       <%= link_to t(@type, :scope => "browse.versions_navigation"), @current_feature %>
   <ol class="breadcrumb mb-1">
     <li class="breadcrumb-item">
       <%= link_to t(@type, :scope => "browse.versions_navigation"), @current_feature %>
index 82efde148f16878713b6593e3854ff2144a833d4..1fb7b6efcf9c208eac343efb6a93d03893c2f02d 100644 (file)
@@ -45,7 +45,7 @@
   </td>
   <td>
     <% if trace.inserted? %>
   </td>
   <td>
     <% if trace.inserted? %>
-      <nav class="secondary-actions">
+      <nav class="secondary-actions" aria-label="<%= t ".trace_actions" %>">
         <ul>
           <li>
             <%= link_to t(".view_map"), root_path(:mlat => trace.latitude, :mlon => trace.longitude, :anchor => "map=14/#{trace.latitude}/#{trace.longitude}") %>
         <ul>
           <li>
             <%= link_to t(".view_map"), root_path(:mlat => trace.latitude, :mlon => trace.longitude, :anchor => "map=14/#{trace.latitude}/#{trace.longitude}") %>
index 91c38d8af5c668032381629f430bc7831293f029..cec2750e572754dbc1fc0b4f29007f067819e65c 100644 (file)
@@ -1,7 +1,7 @@
 <% content_for :heading_class, "pb-0" %>
 <% content_for :heading do %>
   <h1><%= @title %></h1>
 <% content_for :heading_class, "pb-0" %>
 <% content_for :heading do %>
   <h1><%= @title %></h1>
-  <nav class="secondary-actions mb-3">
+  <nav class="secondary-actions mb-3" aria-label="<%= t ".actions" %>">
     <ul>
       <li>
         <%= t(".description") %>
     <ul>
       <li>
         <%= t(".description") %>
index 051db01f4376518d61ec4ea0c4bc1603fa8b342c..67110cb7a22f498b3b4e24912066dd8da9e97d9d 100644 (file)
@@ -33,7 +33,7 @@
           <% end %>
         <% end %>
       </h1>
           <% end %>
         <% end %>
       </h1>
-      <nav class="secondary-actions">
+      <nav class="secondary-actions" aria-label="<%= t ".actions" %>">
         <ul>
           <% if current_user and @user.id == current_user.id %>
             <!-- Displaying user's own profile page -->
         <ul>
           <% if current_user and @user.id == current_user.id %>
             <!-- Displaying user's own profile page -->
       </div>
 
       <% if can?(:update, :user_status) %>
       </div>
 
       <% if can?(:update, :user_status) %>
-        <nav class="secondary-actions">
+        <nav class="secondary-actions" aria-label="<%= t ".admin_actions" %>">
           <ul>
             <% if @user.may_activate? %>
               <li>
           <ul>
             <% if @user.may_activate? %>
               <li>
index df999d8112ff39b984789a620cae50ed3dfd505f..09f41a1733c0863cb775341f2d31a4786e5e8111 100644 (file)
@@ -471,6 +471,9 @@ en:
       colour_preview: "Colour %{colour_value} preview"
       email_link: "Email %{email}"
     versions_navigation:
       colour_preview: "Colour %{colour_value} preview"
       email_link: "Email %{email}"
     versions_navigation:
+      node_versions: "Node versions"
+      way_versions: "Way versions"
+      relation_versions: "Relation versions"
       node: "Node"
       way: "Way"
       relation: "Relation"
       node: "Node"
       way: "Way"
       relation: "Relation"
@@ -487,10 +490,13 @@ en:
     index:
       node:
         title_html: "Node History: %{name}"
     index:
       node:
         title_html: "Node History: %{name}"
+        actions: "Node actions"
       way:
         title_html: "Way History: %{name}"
       way:
         title_html: "Way History: %{name}"
+        actions: "Way actions"
       relation:
         title_html: "Relation History: %{name}"
       relation:
         title_html: "Relation History: %{name}"
+        actions: "Relation actions"
       older_versions: Older Versions
       newer_versions: Newer Versions
     actions:
       older_versions: Older Versions
       newer_versions: Newer Versions
     actions:
@@ -636,6 +642,7 @@ en:
       latest_edit_html: "Latest edit (%{ago}):"
       no_edits: "(no edits)"
       view_changeset_details: "View changeset details"
       latest_edit_html: "Latest edit (%{ago}):"
       no_edits: "(no edits)"
       view_changeset_details: "View changeset details"
+      actions: "User actions"
     popup:
       your location: "Your location"
       nearby mapper: "Nearby mapper"
     popup:
       your location: "Your location"
       nearby mapper: "Nearby mapper"
@@ -648,8 +655,10 @@ en:
       no followings: You have not followed any user yet.
       nearby users: "Other nearby users"
       no nearby users: "There are no other users who admit to mapping nearby yet."
       no followings: You have not followed any user yet.
       nearby users: "Other nearby users"
       no nearby users: "There are no other users who admit to mapping nearby yet."
+      followed_actions: "Actions for users you follow"
       followed_changesets: "changesets"
       followed_diaries: "diary entries"
       followed_changesets: "changesets"
       followed_diaries: "diary entries"
+      nearby_actions: "Actions for nearby users"
       nearby_changesets: "nearby user changesets"
       nearby_diaries: "nearby user diary entries"
   notifications:
       nearby_changesets: "nearby user changesets"
       nearby_diaries: "nearby user diary entries"
   notifications:
@@ -724,6 +733,7 @@ en:
       posted_by_html: "Posted by %{link_user} on %{created} in %{language_link}."
       updated_at_html: "Last updated on %{updated}."
       full_entry: See full entry
       posted_by_html: "Posted by %{link_user} on %{created} in %{language_link}."
       updated_at_html: "Last updated on %{updated}."
       full_entry: See full entry
+      actions: Diary entry actions
       comment_link: Comment on this entry
       reply_link: Send a message to the author
       comment_count:
       comment_link: Comment on this entry
       reply_link: Send a message to the author
       comment_count:
@@ -761,6 +771,7 @@ en:
       heading: Unsubscribe from the following diary entry discussion?
       button: Unsubscribe from discussion
     navigation:
       heading: Unsubscribe from the following diary entry discussion?
       button: Unsubscribe from discussion
     navigation:
+      actions: Diary actions
       in_language: "Diary Entries in %{language}"
       my_diary: My Diary
       new: New Diary Entry
       in_language: "Diary Entries in %{language}"
       my_diary: My Diary
       new: New Diary Entry
@@ -1735,6 +1746,7 @@ en:
       report_created_at_html: "First reported at %{datetime}"
       last_resolved_at_html: "Last resolved at %{datetime}"
       last_updated_at_html: "Last updated at %{datetime} by %{displayname}"
       report_created_at_html: "First reported at %{datetime}"
       last_resolved_at_html: "Last resolved at %{datetime}"
       last_updated_at_html: "Last updated at %{datetime} by %{displayname}"
+      actions: Issue actions
       resolve: Resolve
       ignore: Ignore
       reopen: Reopen
       resolve: Resolve
       ignore: Ignore
       reopen: Reopen
@@ -1960,6 +1972,7 @@ en:
       select_language: Select Language
       sign_up: Sign Up
       user_diaries: User Diaries
       select_language: Select Language
       sign_up: Sign Up
       user_diaries: User Diaries
+      navigation: Main navigation
     meta:
       openstreetmap_search: OpenStreetMap Search
     select_language_button:
     meta:
       openstreetmap_search: OpenStreetMap Search
     select_language_button:
@@ -3049,6 +3062,7 @@ en:
         other: "%{count} points"
       more: "more"
       trace_details: "View Trace Details"
         other: "%{count} points"
       more: "more"
       trace_details: "View Trace Details"
+      trace_actions: "Trace actions"
       view_map: "View location on map"
       edit_map: "Open in editor"
       public: "PUBLIC"
       view_map: "View location on map"
       edit_map: "Open in editor"
       public: "PUBLIC"
@@ -3062,6 +3076,7 @@ en:
       my_gps_traces: "My GPS Traces"
       public_traces_from: "Public GPS Traces from %{user}"
       description: "Browse recent GPS trace uploads"
       my_gps_traces: "My GPS Traces"
       public_traces_from: "Public GPS Traces from %{user}"
       description: "Browse recent GPS trace uploads"
+      actions: "Trace list actions"
       tagged_with: " tagged with %{tags}"
       empty_title: Nothing here yet
       empty_upload_html: "%{upload_link} or learn more about GPS tracing on the %{wiki_link}."
       tagged_with: " tagged with %{tags}"
       empty_title: Nothing here yet
       empty_upload_html: "%{upload_link} or learn more about GPS tracing on the %{wiki_link}."
@@ -3167,6 +3182,7 @@ en:
       preview: Preview
       help: Help
     pagination:
       preview: Preview
       help: Help
     pagination:
+      label: Page navigation
       changeset_comments:
         older: Older Comments
         newer: Newer Comments
       changeset_comments:
         older: Older Comments
         newer: Newer Comments
@@ -3316,6 +3332,8 @@ en:
       body: "Sorry, there is no user with the name %{user}. Please check your spelling, or maybe the link you clicked is wrong."
       deleted: "deleted"
     show:
       body: "Sorry, there is no user with the name %{user}. Please check your spelling, or maybe the link you clicked is wrong."
       deleted: "deleted"
     show:
+      actions: Actions
+      admin_actions: Administrative actions
       my diary: My Diary
       my edits: My Edits
       my traces: My Traces
       my diary: My Diary
       my edits: My Edits
       my traces: My Traces
@@ -3672,6 +3690,7 @@ en:
       title: "New Note"
       warning: "New notes cannot be created because the OpenStreetMap API is currently in read-only mode."
     notes_paging_nav:
       title: "New Note"
       warning: "New notes cannot be created because the OpenStreetMap API is currently in read-only mode."
     notes_paging_nav:
+      label: "Page navigation"
       showing_page: "Page %{page}"
       next: "Next"
       previous: "Previous"
       showing_page: "Page %{page}"
       next: "Next"
       previous: "Previous"
@@ -3903,6 +3922,7 @@ en:
     navigation:
       new_title: Define a new moderation zone
       new: New Moderation Zone
     navigation:
       new_title: Define a new moderation zone
       new: New Moderation Zone
+      actions: Moderation zone actions
     index:
       title: Moderation Zones
       heading: Moderation Zones
     index:
       title: Moderation Zones
       heading: Moderation Zones