Skip to content

Commit 435a25a

Browse files
committed
Added media profile link to source view
1 parent e430039 commit 435a25a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/pinchflat_web/controllers/media_sources/source_controller.ex

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
defmodule PinchflatWeb.MediaSources.SourceController do
22
use PinchflatWeb, :controller
33

4+
alias Pinchflat.Repo
45
alias Pinchflat.Profiles
56
alias Pinchflat.MediaSource
67
alias Pinchflat.MediaSource.Source
@@ -30,7 +31,10 @@ defmodule PinchflatWeb.MediaSources.SourceController do
3031
end
3132

3233
def show(conn, %{"id" => id}) do
33-
source = MediaSource.get_source!(id)
34+
source =
35+
id
36+
|> MediaSource.get_source!()
37+
|> Repo.preload(:media_profile)
3438

3539
render(conn, :show, source: source)
3640
end

lib/pinchflat_web/controllers/media_sources/source_html/show.html.heex

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
</.header>
1010

1111
<.list>
12+
<:item title="media_profile">
13+
<.link href={~p"/media_profiles/#{@source.media_profile}"}>
14+
<%= @source.media_profile.name %>
15+
</.link>
16+
</:item>
17+
1218
<:item
1319
:for={attr <- ~w(collection_type collection_name collection_id original_url friendly_name)a}
1420
title={attr}

0 commit comments

Comments
 (0)