From: Tom Hughes Date: Sun, 13 Aug 2023 09:50:33 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/pull/4144' X-Git-Tag: live~1574 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/e2cb2327f9e5a3a107dbe249e4fe503cbde45d24?hp=a1798fe6fb238fd2e4b878cd1736ca2b3101daa7 Merge remote-tracking branch 'upstream/pull/4144' --- diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index f7192a68e..b694247a8 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -1047,49 +1047,24 @@ tr.turn:hover { width: 100%; } -/* Rules for the diary list page */ - -.diary_post { - position: relative; - padding-top: $lineheight; - padding-bottom: $lineheight/2; - border-top: 1px solid $grey; - - &.deleted { - background-color: #fee; - } -} - /* Rules for the diary entry page */ .diary_entries { #map { height: 400px; display: none; - margin-bottom: $lineheight; } .comments { max-width: 740px; } .diary-comment { border-top: 1px dashed $grey; - padding-top: $lineheight/2; - padding-bottom: $lineheight/2; &:first-child { - margin-top: $lineheight/2; - padding-top: $lineheight; border-top: 1px solid $grey; } - &.deleted { - background-color: #fee; - } p { margin-bottom: $lineheight/2; } - .comment-heading { - margin-bottom: 0; - margin-top: 0; - } } } diff --git a/app/views/diary_entries/_diary_comment.html.erb b/app/views/diary_entries/_diary_comment.html.erb index 403d30742..238f4d43c 100644 --- a/app/views/diary_entries/_diary_comment.html.erb +++ b/app/views/diary_entries/_diary_comment.html.erb @@ -1,9 +1,9 @@ -
"> +
">
<%= user_thumbnail diary_comment.user %>
-

<%= t(".comment_from_html", :link_user => (link_to diary_comment.user.display_name, user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %> +

<%= t(".comment_from_html", :link_user => (link_to diary_comment.user.display_name, user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %> <% if current_user and diary_comment.user.id != current_user.id %> | <%= report_link(t(".report"), diary_comment) %> <% end %> diff --git a/app/views/diary_entries/_diary_entry.html.erb b/app/views/diary_entries/_diary_entry.html.erb index 37420cdf1..276b3eae7 100644 --- a/app/views/diary_entries/_diary_entry.html.erb +++ b/app/views/diary_entries/_diary_entry.html.erb @@ -1,4 +1,4 @@ -

+
<% if @user %>

<%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %>

@@ -65,4 +65,4 @@ <% end %> -
+
diff --git a/app/views/diary_entries/_form.html.erb b/app/views/diary_entries/_form.html.erb index e07971089..bfb1c1823 100644 --- a/app/views/diary_entries/_form.html.erb +++ b/app/views/diary_entries/_form.html.erb @@ -5,13 +5,13 @@
<%= t ".location" -%> - <%= tag.div "", :id => "map", :class => "border border-grey rounded", :data => { :lat => @lat, :lon => @lon, :zoom => @zoom } %> + <%= tag.div "", :id => "map", :class => "border border-grey rounded mb-3", :data => { :lat => @lat, :lon => @lon, :zoom => @zoom } %>
<%= f.text_field :latitude, :wrapper_class => "col-sm-4", :id => "latitude" %> <%= f.text_field :longitude, :wrapper_class => "col-sm-4", :id => "longitude" %> -
- +
+
diff --git a/app/views/diary_entries/show.html.erb b/app/views/diary_entries/show.html.erb index 879207495..ab45a24b6 100644 --- a/app/views/diary_entries/show.html.erb +++ b/app/views/diary_entries/show.html.erb @@ -13,7 +13,7 @@ <%= render @entry %> -
+
<%= render :partial => "diary_comment", :collection => @comments %>
diff --git a/test/controllers/diary_entries_controller_test.rb b/test/controllers/diary_entries_controller_test.rb index c9464ffed..6365d46e5 100644 --- a/test/controllers/diary_entries_controller_test.rb +++ b/test/controllers/diary_entries_controller_test.rb @@ -563,35 +563,35 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest # Try and get the index get diary_entries_path assert_response :success - assert_select "div.diary_post", :count => 20 + assert_select "article.diary_post", :count => 20 assert_select "li.page-item a.page-link", :text => "Older Entries", :count => 1 assert_select "li.page-item.disabled span.page-link", :text => "Newer Entries", :count => 1 # Try and get the second page get css_select("li.page-item a.page-link").first["href"] assert_response :success - assert_select "div.diary_post", :count => 20 + assert_select "article.diary_post", :count => 20 assert_select "li.page-item a.page-link", :text => "Older Entries", :count => 1 assert_select "li.page-item a.page-link", :text => "Newer Entries", :count => 1 # Try and get the third page get css_select("li.page-item a.page-link").first["href"] assert_response :success - assert_select "div.diary_post", :count => 10 + assert_select "article.diary_post", :count => 10 assert_select "li.page-item.disabled span.page-link", :text => "Older Entries", :count => 1 assert_select "li.page-item a.page-link", :text => "Newer Entries", :count => 1 # Go back to the second page get css_select("li.page-item a.page-link").last["href"] assert_response :success - assert_select "div.diary_post", :count => 20 + assert_select "article.diary_post", :count => 20 assert_select "li.page-item a.page-link", :text => "Older Entries", :count => 1 assert_select "li.page-item a.page-link", :text => "Newer Entries", :count => 1 # Go back to the first page get css_select("li.page-item a.page-link").last["href"] assert_response :success - assert_select "div.diary_post", :count => 20 + assert_select "article.diary_post", :count => 20 assert_select "li.page-item a.page-link", :text => "Older Entries", :count => 1 assert_select "li.page-item.disabled span.page-link", :text => "Newer Entries", :count => 1 end @@ -997,7 +997,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_template "index" assert_no_missing_translations - assert_select "div.diary_post", entries.count + assert_select "article.diary_post", entries.count entries.each do |entry| assert_select "a[href=?]", "/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}"