You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
1.1 KiB

<header class="hero">
<h1>Listing Notes</h1>
<%= if @current_user do %>
<span><%= live_patch "New Note", to: Routes.note_index_path(@socket, :new), class: "button" %></span>
<% end %>
</header>
<%= if @live_action in [:new, :edit] do %>
<%= live_modal @socket, MirageWeb.NoteLive.FormComponent,
id: @note.id || :new,
title: @page_title,
action: @live_action,
note: @note,
return_to: Routes.note_index_path(@socket, :index) %>
<% end %>
<section class="bg-content width-full">
<h3>✒️ Last Edited</h3>
<div class="cards">
<%= for note <- @notes.last_edited do %>
<%= link to: Routes.note_show_path(@socket, :show, note), class: "col card" do %>
<strong><%= note.title %></strong>
<p><%= note.content |> String.slice(0..50) %></p>
<% end %>
<% end %>
</div>
</section>
<section class="bg-content width-full">
<h3>🕶️ Most Viewed</h3>
<div class="cards">
<%= for note <- @notes.most_viewed do %>
<%= link to: Routes.note_show_path(@socket, :show, note), class: "col card" do %>
<strong><%= note.title %></strong>
<p><%= note.content |> String.slice(0..50) %></p>
<% end %>
<% end %>
</div>
</section>