Added docs; fixed up stragglers
This commit is contained in:
parent
e31e522a33
commit
87f78e7250
4 changed files with 10 additions and 7 deletions
|
|
@ -31,13 +31,16 @@ defmodule PinchflatWeb.CustomComponents.TextComponents do
|
||||||
"""
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@doc """
|
||||||
|
Renders an icon as a link with the given href.
|
||||||
|
"""
|
||||||
attr :href, :string, required: true
|
attr :href, :string, required: true
|
||||||
attr :icon, :string, required: true
|
attr :icon, :string, required: true
|
||||||
attr :class, :string, default: ""
|
attr :class, :string, default: ""
|
||||||
# TODO: docs
|
|
||||||
def icon_link(assigns) do
|
def icon_link(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<.link navigate={@href} class={["hover:text-secondary duration-200 ease-in-out", @class]}>
|
<.link href={@href} class={["hover:text-secondary duration-200 ease-in-out", @class]}>
|
||||||
<CoreComponents.icon name={@icon} />
|
<CoreComponents.icon name={@icon} />
|
||||||
</.link>
|
</.link>
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="mb-6 flex gap-3 flex-row items-center justify-between">
|
<div class="mb-6 flex gap-3 flex-row items-center justify-between">
|
||||||
<h2 class="text-title-md2 font-bold text-black dark:text-white">All Sources</h2>
|
<h2 class="text-title-md2 font-bold text-black dark:text-white">Sources</h2>
|
||||||
<nav>
|
<nav>
|
||||||
<.link navigate={~p"/sources/new"}>
|
<.link navigate={~p"/sources/new"}>
|
||||||
<.button color="bg-primary" rounding="rounded-full">
|
<.button color="bg-primary" rounding="rounded-full">
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ defmodule PinchflatWeb.MediaProfileControllerTest do
|
||||||
describe "index" do
|
describe "index" do
|
||||||
test "lists all media_profiles", %{conn: conn} do
|
test "lists all media_profiles", %{conn: conn} do
|
||||||
conn = get(conn, ~p"/media_profiles")
|
conn = get(conn, ~p"/media_profiles")
|
||||||
assert html_response(conn, 200) =~ "All Media Profiles"
|
assert html_response(conn, 200) =~ "Media Profiles"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -45,7 +45,7 @@ defmodule PinchflatWeb.MediaProfileControllerTest do
|
||||||
assert redirected_to(conn) == ~p"/media_profiles/#{id}"
|
assert redirected_to(conn) == ~p"/media_profiles/#{id}"
|
||||||
|
|
||||||
conn = get(conn, ~p"/media_profiles/#{id}")
|
conn = get(conn, ~p"/media_profiles/#{id}")
|
||||||
assert html_response(conn, 200) =~ "Media Profile ##{id}"
|
assert html_response(conn, 200) =~ "Media Profile"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "renders errors when data is invalid", %{conn: conn} do
|
test "renders errors when data is invalid", %{conn: conn} do
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ defmodule PinchflatWeb.SourceControllerTest do
|
||||||
describe "index" do
|
describe "index" do
|
||||||
test "lists all sources", %{conn: conn} do
|
test "lists all sources", %{conn: conn} do
|
||||||
conn = get(conn, ~p"/sources")
|
conn = get(conn, ~p"/sources")
|
||||||
assert html_response(conn, 200) =~ "All Sources"
|
assert html_response(conn, 200) =~ "Sources"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -61,7 +61,7 @@ defmodule PinchflatWeb.SourceControllerTest do
|
||||||
assert redirected_to(conn) == ~p"/sources/#{id}"
|
assert redirected_to(conn) == ~p"/sources/#{id}"
|
||||||
|
|
||||||
conn = get(conn, ~p"/sources/#{id}")
|
conn = get(conn, ~p"/sources/#{id}")
|
||||||
assert html_response(conn, 200) =~ "Source ##{id}"
|
assert html_response(conn, 200) =~ "Source"
|
||||||
end
|
end
|
||||||
|
|
||||||
test "renders errors when data is invalid", %{conn: conn, invalid_attrs: invalid_attrs} do
|
test "renders errors when data is invalid", %{conn: conn, invalid_attrs: invalid_attrs} do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue