From: Andy Allan Date: Thu, 11 Nov 2021 15:12:18 +0000 (+0000) Subject: Convert remaining heading titles to use h1 X-Git-Tag: live~2120^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/75749cc54024ef7b4a06a5415f685331facbb467 Convert remaining heading titles to use h1 This makes them consistent with all the other pages that use h1 in the `content_for :heading` sections --- diff --git a/app/views/diary_entries/no_such_entry.html.erb b/app/views/diary_entries/no_such_entry.html.erb index db8bc6f09..da7d18524 100644 --- a/app/views/diary_entries/no_such_entry.html.erb +++ b/app/views/diary_entries/no_such_entry.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

<%= t ".heading", :id => h(params[:id]) %>

+

<%= t ".heading", :id => h(params[:id]) %>

<% end %>

<%= t ".body", :id => h(params[:id]) %>

diff --git a/app/views/diary_entries/show.html.erb b/app/views/diary_entries/show.html.erb index 23b2dc783..ccd647d3c 100644 --- a/app/views/diary_entries/show.html.erb +++ b/app/views/diary_entries/show.html.erb @@ -4,7 +4,7 @@ <%= user_image @entry.user %>
-

<%= link_to t(".user_title", :user => @entry.user.display_name), :action => :index %>

+

<%= link_to t(".user_title", :user => @entry.user.display_name), :action => :index %>

<%= rss_link_to :action => :rss, :display_name => @entry.user.display_name %>

diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 5a457cea7..ba2738b74 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

<%= t ".title", :status => @issue.status.humanize, :issue_id => @issue.id %>

+

<%= t ".title", :status => @issue.status.humanize, :issue_id => @issue.id %>

<%= @issue.reportable.model_name.human %> : <%= link_to reportable_title(@issue.reportable), reportable_url(@issue.reportable) %>

diff --git a/app/views/messages/new.html.erb b/app/views/messages/new.html.erb index 663456ec7..7c91722ff 100644 --- a/app/views/messages/new.html.erb +++ b/app/views/messages/new.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

<%= t(".send_message_to_html", :name => link_to(@message.recipient.display_name, user_path(@message.recipient))) %>

+

<%= t(".send_message_to_html", :name => link_to(@message.recipient.display_name, user_path(@message.recipient))) %>

<% end %> <%= bootstrap_form_for @message do |f| %> diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb index 74c61669f..9ade68121 100644 --- a/app/views/messages/show.html.erb +++ b/app/views/messages/show.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

<%= @message.title %>

+

<%= @message.title %>

<% end %> <% if current_user == @message.recipient %> diff --git a/app/views/notes/index.html.erb b/app/views/notes/index.html.erb index b5af25321..a627e1c54 100644 --- a/app/views/notes/index.html.erb +++ b/app/views/notes/index.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

<%= t ".heading", :user => @user.display_name %>

+

<%= t ".heading", :user => @user.display_name %>

<%= t ".subheading_html", :user => link_to(@user.display_name, user_path(@user)) %>

<% end %> diff --git a/app/views/traces/edit.html.erb b/app/views/traces/edit.html.erb index 13829727c..7365295bd 100644 --- a/app/views/traces/edit.html.erb +++ b/app/views/traces/edit.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

<%= t ".heading", :name => @trace.name %>

+

<%= t ".heading", :name => @trace.name %>

<% end %> "picture", :id => @trace.id, :display_name => @trace.user.display_name %>"> diff --git a/app/views/traces/offline.html.erb b/app/views/traces/offline.html.erb index 8a26744fd..b3958d6a3 100644 --- a/app/views/traces/offline.html.erb +++ b/app/views/traces/offline.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

<%= t ".heading" %>

+

<%= t ".heading" %>

<% end %>

<%= t ".message" %>

diff --git a/app/views/traces/show.html.erb b/app/views/traces/show.html.erb index 6df31760a..e72c423d7 100644 --- a/app/views/traces/show.html.erb +++ b/app/views/traces/show.html.erb @@ -1,5 +1,5 @@ <% content_for :heading do %> -

<%= t ".heading", :name => @trace.name %>

+

<%= t ".heading", :name => @trace.name %>

<% end %> <% if Settings.status != "gpx_offline" %> diff --git a/test/controllers/diary_entries_controller_test.rb b/test/controllers/diary_entries_controller_test.rb index 142363b60..33e483652 100644 --- a/test/controllers/diary_entries_controller_test.rb +++ b/test/controllers/diary_entries_controller_test.rb @@ -273,7 +273,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest get edit_diary_entry_path(:display_name => entry.user.display_name, :id => 9999) assert_response :not_found assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => "No entry with the id: 9999", :count => 1 + assert_select "h1", :text => "No entry with the id: 9999", :count => 1 end # Now pass the id, and check that you can edit it, when using the same @@ -316,7 +316,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest assert_template "show" assert_select "title", :text => /Users' Diaries | /, :count => 1 assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => /#{entry.user.display_name}'s Diary/, :count => 1 + assert_select "h1", :text => /#{entry.user.display_name}'s Diary/, :count => 1 end assert_select "div#content", :count => 1 do assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 @@ -336,7 +336,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest assert_template "show" assert_select "title", :text => /Users' Diaries | /, :count => 1 assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => /#{entry.user.display_name}'s Diary/, :count => 1 + assert_select "h1", :text => /#{entry.user.display_name}'s Diary/, :count => 1 end assert_select "div#content", :count => 1 do assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 @@ -374,7 +374,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest post comment_diary_entry_path(:display_name => entry.user.display_name, :id => 9999) assert_response :not_found assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => "No entry with the id: 9999", :count => 1 + assert_select "h1", :text => "No entry with the id: 9999", :count => 1 end # Now try an invalid comment with an empty body