]> git.openstreetmap.org Git - rails.git/commitdiff
Simplify margins when showing diary entries
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 17 Nov 2021 18:07:24 +0000 (18:07 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 24 Nov 2021 12:24:16 +0000 (12:24 +0000)
app/assets/stylesheets/common.scss
app/views/diary_entries/_diary_entry.html.erb
test/controllers/diary_entries_controller_test.rb

index 01062bd617a2cd02223f8ad735d7ecbd0251580d..1562b3fcabc068518b0ce31114934f5a43802e35 100644 (file)
@@ -1079,23 +1079,10 @@ tr.turn:hover {
   padding-bottom: $lineheight/2;
   border-top: 1px solid $grey;
 
-  &:first-of-type {
-    margin-top: $lineheight/2;
-  }
-
   &.deleted {
     background-color: #fee;
   }
 
-  .post_heading {
-    margin-bottom: $lineheight;
-
-    h2 {
-      margin-top: 0;
-      margin-bottom: $lineheight/2;
-    }
-  }
-
   img.user_thumbnail {
     float: left;
   }
index 2b3dad055e572d6b4648909450cafdcfd3831b52..68b0a265a2d970cca5d9fafb6003b05858bcc0e0 100644 (file)
@@ -1,5 +1,5 @@
 <div class='diary_post<%= " text-muted px-3 deleted" unless diary_entry.visible %> user_<%= diary_entry.user.id %>'>
-  <div class='post_heading'>
+  <div class='mb-3'>
     <% if @user %>
       <h2><%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %></h2>
     <% else %>
index 33e48365218e5ad70db6f722762d556277cb6fc6..b1e9b72f2ba5dc48cef62358286a12421acc9485 100644 (file)
@@ -319,7 +319,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest
       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
+      assert_select "h2", :text => /#{new_title}/, :count => 1
       # This next line won't work if the text has been run through the htmlize function
       # due to formatting that could be introduced
       assert_select "p", :text => /#{new_body}/, :count => 1
@@ -339,7 +339,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest
       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
+      assert_select "h2", :text => /#{new_title}/, :count => 1
       # This next line won't work if the text has been run through the htmlize function
       # due to formatting that could be introduced
       assert_select "p", :text => /#{new_body}/, :count => 1