class="item-read"<% end %>>
<%= item.title || "(Untitled)" %>
|
<%= if item.date do %>
<% {:ok, date} = Timex.format(item.date, "{YYYY}-{0M}-{0D} {0h12}:{m} {AM}") %>
<%= date %>
<% end %>
|
<%= if item.read do %>
<%= form_tag Routes.item_path(@conn, :unread, item.id), method: :post do %>
<%= submit "Unread", class: "btn btn-sm btn-secondary" %>
<% end %>
<% else %>
<%= form_tag Routes.item_path(@conn, :read, item.id), method: :post do %>
<%= submit "Read", class: "btn btn-sm btn-secondary" %>
<% end %>
<% end %>
|
<% end %>