diff --git a/assets/css/app.css b/assets/css/app.css index 31406eb..ea40404 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -3,4 +3,7 @@ @import "tailwindcss/utilities"; @import "./lolight.css"; -@import "./lightbox.css"; \ No newline at end of file +@import "./lightbox.css"; + +/* Set appropriate width for identity icons */ +a[rel] svg { width: 1em; } \ No newline at end of file diff --git a/lib/chiya/identities/identity.ex b/lib/chiya/identities/identity.ex index 07a24e8..7f46b7a 100644 --- a/lib/chiya/identities/identity.ex +++ b/lib/chiya/identities/identity.ex @@ -6,7 +6,7 @@ defmodule Chiya.Identities.Identity do field :name, :string field :url, :string field :rel, :string, default: "me" - field :icon, :string, default: "cube" + field :icon, :string, default: "" field :public, :boolean, default: false field :active, :boolean, default: false diff --git a/lib/chiya_web/components/core_components.ex b/lib/chiya_web/components/core_components.ex index ac2873d..a1a940b 100644 --- a/lib/chiya_web/components/core_components.ex +++ b/lib/chiya_web/components/core_components.ex @@ -12,7 +12,7 @@ defmodule ChiyaWeb.CoreComponents do alias Phoenix.LiveView.JS import ChiyaWeb.Gettext - + @doc """ Renders a horizontal line """ diff --git a/lib/chiya_web/controllers/identity_html/identity_form.html.heex b/lib/chiya_web/controllers/identity_html/identity_form.html.heex index a584e26..b455068 100644 --- a/lib/chiya_web/controllers/identity_html/identity_form.html.heex +++ b/lib/chiya_web/controllers/identity_html/identity_form.html.heex @@ -7,7 +7,7 @@ <.input field={f[:url]} type="text" label="Url" /> <.input field={f[:public]} type="checkbox" label="Public" /> <.input field={f[:active]} type="checkbox" label="Active" /> - <.input field={f[:icon]} type="text" label="Icon" /> + <.input field={f[:icon]} type="textarea" label="Icon" /> <:actions> <.button>Save Identity diff --git a/lib/chiya_web/controllers/identity_html/index.html.heex b/lib/chiya_web/controllers/identity_html/index.html.heex index 1ec4db9..d26a833 100644 --- a/lib/chiya_web/controllers/identity_html/index.html.heex +++ b/lib/chiya_web/controllers/identity_html/index.html.heex @@ -8,7 +8,7 @@ <.table id="identities" rows={@identities} row_click={&JS.navigate(~p"/admin/identities/#{&1}")}> - <:col :let={identity} label="Icon"><%= identity.icon %> + <:col :let={identity} label="Icon"><%= raw identity.icon %> <:col :let={identity} label="Name"><%= identity.name %> <:col :let={identity} label="Rel"><%= identity.rel %> <:col :let={identity} label="Url"><%= identity.url %> diff --git a/lib/chiya_web/controllers/page_html/home.html.heex b/lib/chiya_web/controllers/page_html/home.html.heex index 77bc933..e393389 100644 --- a/lib/chiya_web/controllers/page_html/home.html.heex +++ b/lib/chiya_web/controllers/page_html/home.html.heex @@ -6,6 +6,7 @@

<%= @settings.subtitle %>

+
<%= for identity <- @identities do %> @@ -16,7 +17,7 @@ target="_blank" class="group -mx-2 -my-0.5 inline-flex items-center gap-3 rounded-lg px-2 py-0.5 hover:bg-gray-50 hover:text-gray-900" > - <.icon name="hero-cube" /> + <%= raw identity.icon %> <%= identity.name %>
diff --git a/priv/repo/migrations/20230308191004_create_note_images.exs b/priv/repo/migrations/20230308191004_create_note_images.exs index 77e0c6c..91f519d 100644 --- a/priv/repo/migrations/20230308191004_create_note_images.exs +++ b/priv/repo/migrations/20230308191004_create_note_images.exs @@ -12,4 +12,4 @@ defmodule Chiya.Repo.Migrations.CreateNoteImages do create index(:note_images, [:note_id]) end -end +end \ No newline at end of file diff --git a/priv/repo/migrations/20230314214822_change_identity_icon_to_text.exs b/priv/repo/migrations/20230314214822_change_identity_icon_to_text.exs new file mode 100644 index 0000000..648bb80 --- /dev/null +++ b/priv/repo/migrations/20230314214822_change_identity_icon_to_text.exs @@ -0,0 +1,9 @@ +defmodule Chiya.Repo.Migrations.ChangeIdentityIconToText do + use Ecto.Migration + + def change do + alter table(:identities) do + modify :icon, :text, from: :string + end + end +end