]> git.openstreetmap.org Git - rails.git/blob - app/views/diary_entries/_profile_diaries.html.erb
Remove nested .changesets from lists on history pages
[rails.git] / app / views / diary_entries / _profile_diaries.html.erb
1 <% if diary_entries.present? %>
2   <h2 class="text-body-secondary fs-5 mt-4"><%= t(".latest_diaries") %></h2>
3   <div class="row row-cols-1 row-cols-md-2 g-4">
4     <% diary_entries.each do |entry| %>
5       <div class="col profile-diary-card">
6         <div class="card h-100">
7           <div class="card-body d-flex flex-column">
8             <p class="card-title">
9               <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="Diary Entry"><path d="M2 6h4" /><path d="M2 10h4" /><path d="M2 14h4" /><path d="M2 18h4" /><rect width="16" height="20" x="4" y="2" rx="2" /><path d="M9.5 8h5" /><path d="M9.5 12H16" /><path d="M9.5 16H14" /></svg>
10               <%= link_to entry.title, diary_entry_path(@user, entry) %>
11             </p>
12             <p class="card-text flex-grow-1"><%= truncate(strip_tags(entry.body.to_html), :length => 150) %></p>
13
14             <div class="card-text d-flex justify-content-between align-items-center mt-auto">
15               <small class="text-body-secondary d-flex align-items-center">
16                 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-1" aria-label="Comments"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z" /></svg>
17                 <%= link_to diary_entry_path(@user, entry, :anchor => "comments"), :class => "text-body-secondary" do %>
18                   <span><%= t(".comments", :count => entry.comments.size) %></span>
19                 <% end %>
20               </small>
21               <small class="text-body-secondary d-flex align-items-center">
22                 <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="me-1" aria-label="Date"><path d="M8 2v4" /><path d="M16 2v4" /><rect width="18" height="18" x="3" y="4" rx="2" /><path d="M3 10h18" /></svg>
23                 <span><%= l(entry.created_at.to_date, :format => :long) %></span>
24               </small>
25             </div>
26           </div>
27         </div>
28       </div>
29     <% end %>
30   </div>
31 <% end %>