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

44 lines
1.4 KiB
Elixir

<h1><%= @group.title %></h1>
<a href="<%= Routes.group_path(@conn, :edit, @group.id) %>" class="btn btn-primary">Edit Group</a>
<%= form_tag Routes.group_path(@conn, :delete, @group.id), method: :delete, class: "d-inline" do %>
<%= submit "Delete Group", class: "btn btn-danger" %>
<% end %>
<%= form_for @create_feed_changeset, Routes.feed_path(@conn, :create), [class: "mt-2 mb-2"], fn form -> %>
<%= hidden_input form, :group_id %>
<div class="row">
<%= label form, :feed_url, "Feed URL", class: "col-sm-2 col-form-label" %>
<div class="col-sm-8">
<%= text_input form, :feed_url, placeholder: "https://example.com/feed.xml", class: "form-control" %>
</div>
<div class="col-sm-2">
<%= submit "Add Feed", class: "btn btn-primary" %>
</div>
</div>
<% end %>
<a href="#" class="btn btn-secondary">Read Articles</a>
<h3 class="mt-4">Feeds</h3>
<table class="table table-striped">
<tbody>
<%= for feed <- @group.feeds do %>
<tr>
<td>
<a href="<%= Routes.feed_path(@conn, :show, feed.id) %>"><%= feed.feed_url %></a>
</td>
<td>
<a href="<%= feed.site_url %>" class="feed-title">
<%= if feed.favicon do %>
<img src="<%= feed.favicon %>" alt="<%= feed.title %> favicon" class="favicon">
<% end %>
<%= feed.title %>
</a>
</td>
</tr>
<% end %>
</tbody>
</table>