]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/4144'
authorTom Hughes <tom@compton.nu>
Sun, 13 Aug 2023 09:50:33 +0000 (10:50 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 13 Aug 2023 09:50:33 +0000 (10:50 +0100)
app/assets/stylesheets/common.scss
app/views/diary_entries/_diary_comment.html.erb
app/views/diary_entries/_diary_entry.html.erb
app/views/diary_entries/_form.html.erb
app/views/diary_entries/show.html.erb
test/controllers/diary_entries_controller_test.rb

index f7192a68eaf5ac34cd9a4d31e77233de19e4a8fc..b694247a880bfb5d4ae362b7782c5dc5ae5d674e 100644 (file)
@@ -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;
-    }
   }
 }
 
index 403d30742d982a45d1b08ba237621f2a1fa30581..238f4d43c8549a02e4e7a8f2fcbbe4d08f66e733 100644 (file)
@@ -1,9 +1,9 @@
-<div class="row diary-comment<%= " text-muted deleted" unless diary_comment.visible? %>">
+<div class="row diary-comment py-3<%= " text-muted bg-danger bg-opacity-10" unless diary_comment.visible? %>">
   <div class="col-auto">
     <%= user_thumbnail diary_comment.user %>
   </div>
   <div class="col">
-    <p class="text-muted comment-heading" id="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}")) %>
+    <p class="text-muted m-0" id="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 %>
index 37420cdf1dfa41bc58abbb37fdca786057d1c1a8..276b3eae7aa7c6352904c7a0f7d84f120507f50f 100644 (file)
@@ -1,4 +1,4 @@
-<div class='diary_post<%= " text-muted px-3 deleted" unless diary_entry.visible %> user_<%= diary_entry.user.id %>'>
+<article class='diary_post border-top border-grey pt-3 pb-2<%= " text-muted px-3 bg-danger bg-opacity-10" unless diary_entry.visible %> user_<%= diary_entry.user.id %>'>
   <div class='mb-3'>
     <% if @user %>
       <h2><%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %></h2>
@@ -65,4 +65,4 @@
       <% end %>
     </ul>
   </nav>
-</div>
+</article>
index e07971089f620101ea75fc40e7d4d7f5c1d7f849..bfb1c1823dfa2c8a2cc567dfb975db7a413e2731 100644 (file)
@@ -5,13 +5,13 @@
 <fieldset>
   <legend><%= t ".location" -%></legend>
 
-  <%= 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 } %>
 
   <div class="row mb-3">
     <%= f.text_field :latitude, :wrapper_class => "col-sm-4", :id => "latitude" %>
     <%= f.text_field :longitude, :wrapper_class => "col-sm-4", :id => "longitude" %>
-    <div class="col-sm-4">
-      <label><a href="#" id="usemap"><%= t ".use_map_link" -%></a></label>
+    <div class="col-sm-4 align-self-end pt-2">
+      <button type="button" id="usemap" class="btn btn-outline-primary"><%= t ".use_map_link" -%></button>
     </div>
   </div>
 </fieldset>
index 8792074951ce6efd1d9ca64bec76ede8137162fe..ab45a24b68242ea1eb602cb9445aa0a9a0315a77 100644 (file)
@@ -13,7 +13,7 @@
 <%= render @entry %>
 
 <a id="comments"></a>
-<div class='comments'>
+<div class='comments mt-2'>
 <%= render :partial => "diary_comment", :collection => @comments %>
 </div>
 
index c9464ffeddd0bc36eec82d4480b696aac71ddef2..6365d46e5de0aba5210c181131194d15dde78ca7 100644 (file)
@@ -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}"