frenzy/lib/frenzy_web/templates/group/read.html.eex

55 lines
1.9 KiB
Elixir
Raw Permalink Normal View History

2020-06-02 02:38:27 +00:00
<h1><%= @group.title %></h1>
<%= unless is_nil(@prev_page_path) do %>
2020-06-02 02:38:27 +00:00
<p class="text-center">
<a href="<%= @prev_page_path %>" class="pagination-link">Newer</a>
2020-06-02 02:38:27 +00:00
</p>
<% end %>
2021-04-01 00:01:00 +00:00
<table class="table table-striped item-table">
2020-06-02 02:38:27 +00:00
<tbody>
<%= for item <- @items do %>
<tr <%= if item.read do %>class="item-read"<% end %>>
<td>
<a href="<%= Routes.item_path(@conn, :show, item.id) %>">
<%= item.title || "(Untitled)" %>
</a>
</td>
2021-04-01 00:01:00 +00:00
<td class="align-middle">
<a href="<%= Routes.feed_path(@conn, :show, item.feed.id) %>" style="white-space: nowrap;">
2020-06-02 02:38:27 +00:00
<%= if item.feed.favicon do %>
<img src="<%= item.feed.favicon %>" alt="<%= item.feed.title %> favicon" class="favicon">
<% end %>
<%= item.feed.title || "(Untitled)" %>
</a>
</td>
2021-04-01 00:01:00 +00:00
<td class="date align-middle">
2020-06-02 02:38:27 +00:00
<%= if item.date do %>
<% {:ok, date} = Timex.format(item.date, "{YYYY}-{0M}-{0D} {0h12}:{m} {AM}") %>
<%= date %>
<% end %>
</td>
2021-04-01 00:00:44 +00:00
<td class="py-0 align-middle">
<%= if item.read do %>
<%= form_tag Routes.item_path(@conn, :unread, item.id), method: :post do %>
<input type="hidden" name="redirect" value="<%= current_path(@conn) %>">
2021-04-01 00:00:44 +00:00
<%= submit "Unread", class: "btn btn-sm btn-secondary" %>
<% end %>
<% else %>
<%= form_tag Routes.item_path(@conn, :read, item.id), method: :post do %>
<input type="hidden" name="redirect" value="<%= current_path(@conn) %>">
2021-04-01 00:00:44 +00:00
<%= submit "Read", class: "btn btn-sm btn-secondary" %>
<% end %>
<% end %>
</td>
2020-06-02 02:38:27 +00:00
</tr>
<% end %>
</tbody>
</table>
<%= unless is_nil(@next_page_path) do %>
2020-06-02 02:38:27 +00:00
<p class="text-center">
<a href="<%= @next_page_path %>" class="pagination-link">Older</a>
2020-06-02 02:38:27 +00:00
</p>
<% end %>