My space on the web https://inhji.de
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.
 
 
 
 
 

50 lines
1.3 KiB

<%= if @current_user do %>
<%= live_render @socket, MirageWeb.GotoAnythingLive, id: "goto-anything-wrapper" %>
<% end %>
<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="notes">
<%= for note <- @notes do %>
<article class="note" id="note-<%= note.id %>">
<%= live_patch to: Routes.note_show_path(@socket, :show, note) do %>
<header class="width-full">
<h2 class="title">
<%= note.title %>
</h2>
</header>
<% end %>
<section>
<div class="content html width-full bg-content">
<%= raw note.content_html %>
</div>
</section>
<footer class="width-full bg-content">
<time datetime="<%= note.inserted_at %>"><%= Timex.from_now(note.inserted_at) %></time>
<span class="tags">
<%= for topic <- note.topics do %>
<span class="tag"><%= topic.text %></span>
<% end %>
</span>
</footer>
</article>
<% end %>
</section>