Add feed link to show page
This commit is contained in:
parent
3cd6495d3a
commit
f5fb8cbdb4
|
@ -2,7 +2,9 @@
|
|||
<%= if @feed.favicon do %>
|
||||
<img src="<%= @feed.favicon %>" alt="<%= @feed.title %> favicon" class="favicon">
|
||||
<% end %>
|
||||
<%= @feed.title %>
|
||||
<a href="<%= feed_site_url(@feed) %>">
|
||||
<%= @feed.title %>
|
||||
</a>
|
||||
</h1>
|
||||
|
||||
<%= form_tag Routes.feed_path(@conn, :refresh, @feed.id), method: :post, class: "d-inline" do %>
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
defmodule FrenzyWeb.FeedView do
|
||||
use FrenzyWeb, :view
|
||||
alias Frenzy.Feed
|
||||
|
||||
@spec feed_site_url(feed :: Feed.t()) :: String.t()
|
||||
def feed_site_url(%Feed{site_url: site_url}) when is_binary(site_url) do
|
||||
site_url
|
||||
end
|
||||
|
||||
def feed_site_url(%Feed{feed_url: feed_url}) do
|
||||
URI.merge(feed_url, "/") |> to_string()
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue