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.
 
 
 
 
 

43 lines
1.5 KiB

<header class="hero">
<h1>Blog</h1>
</header>
<%= if @live_action in [:edit] do %>
<%= live_modal @socket, MirageWeb.ListLive.FormComponent,
id: @list.id,
title: @page_title,
action: @live_action,
list: @list,
return_to: Routes.list_show_path(@socket, :show, @list) %>
<% end %>
<%= if is_nil(@list) or Enum.count(@list.notes) == 0 do %>
<section>
Looks like you did not create a blog list yet. Just name it <code>@blog</code> and its notes will show up here.
</section>
<% else %>
<section class="h-feed">
<%= for note <- @list.notes do %>
<article id="note-<%= note.id %>" class="h-entry">
<header>
<%= live_patch to: Routes.note_show_path(MirageWeb.Endpoint, :show, note), class: "u-url u-uid" do %>
<h2 class="title p-name"><%= note.title %></h2>
<% end %>
</header>
<footer>
<div>
<time datetime="<%= note.inserted_at %>" class="dt-published">Created <%= note.inserted_at |> Timex.from_now() %></time><span class="muted"> * </span><time datetime="<%= note.updated_at %>" class="dt-updated">Last Edited <%= note.updated_at |> Timex.from_now() %></time>
</div>
<div class="tags">
<%= for topic <- note.topics do %>
<span class="tag">
<%= link topic.text, to: Routes.topic_path(MirageWeb.Endpoint, :show, topic), class: "p-category" %>
</span>
<% end %>
</div>
</footer>
</article>
<% end %>
</section>
<% end %>