diff --git a/lib/chiya/channels/channel.ex b/lib/chiya/channels/channel.ex index b7147a4..3605616 100644 --- a/lib/chiya/channels/channel.ex +++ b/lib/chiya/channels/channel.ex @@ -8,8 +8,17 @@ defmodule Chiya.Channels.Channel do field :content, :string field :name, :string field :slug, ChannelSlug.Type - field :visibility, Ecto.Enum, values: [:public, :private, :unlisted] - field :layout, Ecto.Enum, values: [:default, :gallery] + field :visibility, Ecto.Enum, values: [ + :public, + :private, + :unlisted + ] + field :layout, Ecto.Enum, values: [ + :default, + :microblog, + :photoblog, + :gallery + ] many_to_many :notes, Chiya.Notes.Note, join_through: "channels_notes", @@ -28,10 +37,10 @@ defmodule Chiya.Channels.Channel do |> validate_exclusion(:slug, ~w(admin user dev)) end - def icon(%Chiya.Channels.Channel{visibility: vis}) do - case(vis) do - :public -> "๐" + def icon(%Chiya.Channels.Channel{visibility: visibility}) do + case(visibility) do :private -> "๐" + :public -> "๐" :unlisted -> "๐๏ธ" end end diff --git a/lib/chiya_web/components/core_components.ex b/lib/chiya_web/components/core_components.ex index 0a0400f..a90874e 100644 --- a/lib/chiya_web/components/core_components.ex +++ b/lib/chiya_web/components/core_components.ex @@ -238,6 +238,7 @@ defmodule ChiyaWeb.CoreComponents do """ attr :for, :any, required: true, doc: "the datastructure for the form" attr :as, :any, default: nil, doc: "the server side parameter to collect all input under" + attr :class, :string, default: "shadow rounded mt-10 bg-white dark:bg-gray-900" attr :rest, :global, include: ~w(autocomplete name rel action enctype method novalidate target multipart), @@ -248,8 +249,8 @@ defmodule ChiyaWeb.CoreComponents do def simple_form(assigns) do ~H""" - <.form :let={f} for={@for} as={@as} {@rest}> -