save and show identity icons as raw svg
This commit is contained in:
parent
0780a4c048
commit
ca2400c8f0
8 changed files with 20 additions and 7 deletions
|
@ -4,3 +4,6 @@
|
|||
|
||||
@import "./lolight.css";
|
||||
@import "./lightbox.css";
|
||||
|
||||
/* Set appropriate width for identity icons */
|
||||
a[rel] svg { width: 1em; }
|
|
@ -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
|
||||
|
|
|
@ -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</.button>
|
||||
</:actions>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</.header>
|
||||
|
||||
<.table id="identities" rows={@identities} row_click={&JS.navigate(~p"/admin/identities/#{&1}")}>
|
||||
<:col :let={identity} label="Icon"><%= identity.icon %></:col>
|
||||
<:col :let={identity} label="Icon"><%= raw identity.icon %></:col>
|
||||
<:col :let={identity} label="Name"><%= identity.name %></:col>
|
||||
<:col :let={identity} label="Rel"><%= identity.rel %></:col>
|
||||
<:col :let={identity} label="Url"><%= identity.url %></:col>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<p class="mt-4 text-base leading-7 text-gray-600">
|
||||
<%= @settings.subtitle %>
|
||||
</p>
|
||||
|
||||
<div class="w-full mt-6 sm:w-auto">
|
||||
<div class="flex gap-4 text-sm leading-6 text-gray-700">
|
||||
<%= 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 %>
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue