frenzy/lib/frenzy_web/templates/feed/show.html.eex

64 lines
2.2 KiB
Elixir
Raw Normal View History

2019-11-10 19:37:06 +00:00
<h1 class="feed-title">
<%= if @feed.favicon do %>
<img src="<%= @feed.favicon %>" alt="<%= @feed.title %> favicon" class="favicon">
<% end %>
2020-07-18 14:13:54 +00:00
<a href="<%= feed_site_url(@feed) %>" target="_blank" rel="noreferrer noopener">
2020-06-06 19:23:03 +00:00
<%= @feed.title %>
</a>
2019-11-10 19:37:06 +00:00
</h1>
2019-02-11 22:22:35 +00:00
2019-04-01 16:24:22 +00:00
<%= form_tag Routes.feed_path(@conn, :refresh, @feed.id), method: :post, class: "d-inline" do %>
<%= submit "Refresh Feed", class: "btn btn-primary" %>
<% end %>
2019-03-10 23:47:01 +00:00
<a class="btn btn-primary" href="<%= Routes.feed_path(@conn, :edit, @feed.id) %>">Edit Feed</a>
2019-03-10 23:47:01 +00:00
2019-04-01 16:24:22 +00:00
<%= form_tag Routes.feed_path(@conn, :delete, @feed.id), method: :delete, class: "d-inline" do %>
<%= submit "Delete Feed", class: "btn btn-danger" %>
2019-02-11 22:22:35 +00:00
<% end %>
2019-04-01 16:24:22 +00:00
<h3 class="mt-4">Items</h3>
<%= unless is_nil(@prev_page_path) do %>
2020-06-02 02:24:18 +00:00
<p class="text-center">
<a href="<%= @prev_page_path %>" class="pagination-link">Newer</a>
2020-06-02 02:24:18 +00:00
</p>
<% end %>
2021-04-01 00:01:00 +00:00
<table class="table table-striped item-table">
2019-04-01 16:24:22 +00:00
<tbody>
<%= for item <- @items do %>
<tr <%= if item.read do %>class="item-read"<% end %>>
<td>
2019-10-31 18:31:52 +00:00
<a href="<%= Routes.item_path(@conn, :show, item.id) %>"><%= item.title || "(Untitled)" %></a>
2019-04-01 16:24:22 +00:00
</td>
2021-04-01 00:01:00 +00:00
<td class="date">
2020-06-01 23:37:06 +00:00
<%= if item.date do %>
<% {:ok, date} = Timex.format(item.date, "{YYYY}-{0M}-{0D} {0h12}:{m} {AM}") %>
2020-01-13 02:51:58 +00:00
<%= date %>
<% end %>
2019-04-01 16:24:22 +00:00
</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>
2019-04-01 16:24:22 +00:00
</tr>
<% end %>
</tbody>
</table>
2020-06-02 02:24:18 +00:00
<%= unless is_nil(@next_page_path) do %>
2020-06-02 02:24:18 +00:00
<p class="text-center">
<a href="<%= @next_page_path %>" class="pagination-link">Older</a>
2020-06-02 02:24:18 +00:00
</p>
<% end %>