Show favicons in the web UI

This commit is contained in:
Shadowfacts 2019-11-10 14:37:06 -05:00
parent e684737fcd
commit 7c13ea8ee4
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
4 changed files with 30 additions and 4 deletions

View File

@ -1,4 +1,9 @@
<h1><%= @feed.title %></h1> <h1 class="feed-title">
<%= if @feed.favicon do %>
<img src="<%= @feed.favicon %>" alt="<%= @feed.title %> favicon" class="favicon">
<% end %>
<%= @feed.title %>
</h1>
<%= form_tag Routes.feed_path(@conn, :refresh, @feed.id), method: :post, class: "d-inline" do %> <%= form_tag Routes.feed_path(@conn, :refresh, @feed.id), method: :post, class: "d-inline" do %>
<%= submit "Refresh Feed", class: "btn btn-primary" %> <%= submit "Refresh Feed", class: "btn btn-primary" %>

View File

@ -29,7 +29,12 @@
<a href="<%= Routes.feed_path(@conn, :show, feed.id) %>"><%= feed.feed_url %></a> <a href="<%= Routes.feed_path(@conn, :show, feed.id) %>"><%= feed.feed_url %></a>
</td> </td>
<td> <td>
<a href="<%= feed.site_url %>"><%= feed.title %></a> <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> </td>
</tr> </tr>
<% end %> <% end %>

View File

@ -58,8 +58,13 @@
</summary> </summary>
<ul class="nav flex-column"> <ul class="nav flex-column">
<%= for feed <- group.feeds do %> <%= for feed <- group.feeds do %>
<li class="nav-item"> <li class="nav-item feed-nav-item">
<a href="<%= Routes.feed_path(@conn, :show, feed.id) %>" class="nav-link"><%= feed.title %></a> <a href="<%= Routes.feed_path(@conn, :show, feed.id) %>" class="nav-link">
<%= if feed.favicon do %>
<img src="<%= feed.favicon %>" alt="<%= feed.title %> favicon" class="favicon">
<% end %>
<%= feed.title %>
</a>
</li> </li>
<% end %> <% end %>
</ul> </ul>

View File

@ -132,3 +132,14 @@ label.sidebar-toggle > .oi {
display: inline-block; display: inline-block;
} }
.favicon {
height: 1em;
vertical-align: baseline;
}
.feed-nav-item .favicon,
.feed-nav-item .nav-link {
display: inline-block;
}