]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/diary_entries/_diary_entry.html.erb
Merge branch 'pull/4985'
[rails.git] / app / views / diary_entries / _diary_entry.html.erb
index 9c7d7b2dc297bc211c6772d3902048eb60f9e0f0..2d8243d1b23bf68af5ca3935c175bc398ffc0c1a 100644 (file)
@@ -1,4 +1,4 @@
-<article class='diary_post border-top border-secondary-subtle py-3<%= " text-muted px-3 bg-danger bg-opacity-10" unless diary_entry.visible %> user_<%= diary_entry.user.id %>'>
+<article class='diary_post border-top border-secondary-subtle py-3<%= " text-body-secondary px-3 bg-danger bg-opacity-10" unless diary_entry.visible %> user_<%= diary_entry.user.id %>'>
   <%= render :partial => "diary_entry_heading", :object => diary_entry, :as => "diary_entry" %>
 
   <div class="richtext text-break" xml:lang="<%= diary_entry.language_code %>" lang="<%= diary_entry.language_code %>">
   <%= render :partial => "diary_entry_heading", :object => diary_entry, :as => "diary_entry" %>
 
   <div class="richtext text-break" xml:lang="<%= diary_entry.language_code %>" lang="<%= diary_entry.language_code %>">
@@ -23,7 +23,7 @@
         </li>
       <% end %>
 
         </li>
       <% end %>
 
-      <% if current_user && current_user == diary_entry.user %>
+      <% if can?(:edit, diary_entry) %>
         <li><%= link_to t(".edit_link"), edit_diary_entry_path(diary_entry.user, diary_entry) %></li>
       <% end %>
 
         <li><%= link_to t(".edit_link"), edit_diary_entry_path(diary_entry.user, diary_entry) %></li>
       <% end %>
 
@@ -44,4 +44,5 @@
       <% end %>
     </ul>
   </nav>
       <% end %>
     </ul>
   </nav>
+
 </article>
 </article>