mirror of
https://github.com/ClaperCo/Claper.git
synced 2026-02-24 20:19:48 +01:00
## ⚠️ Breaking changes - S3 variables are now named: S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_REGION and S3_BUCKET - Users now have roles. Refer to the `roles` table and assign a role to a user with the `role_id` column in the `users` table. ## Features - Add Admin Panel to manage users and presentations - Add user roles: user, admin - Add `LANGUAGES` setting to configure available languages in the app - Add hideable presenter attendee count (#183 #155) - Add Hungarian translation (#161) - Add Latvian translation (#163) - Add custom S3 endpoint with `S3_SCHEME`, `S3_HOST`, `S3_PORT` and `S3_PUBLIC_URL` ## Fixes and improvements - Upgrade JS dependencies - Upgrade Elixir dependencies, including Phoenix Live View to 1.0.17 - Upgrade to Tailwind 4+ - Refactor view templates to use {} instead of <%= %> - Fix event name validation to be required - Docker image is now using Ubuntu instead of Alpine for better dependencies support - Fix scrollbar not showing in event manager when no presentation file (#164) (@aryel780) - Fix settings scroll for small screen (#168) - Fix duplicate key quiz when duplicate (#182) - Fix email change confirmation (#172) - Fix italian translation (#179) - Fix random poll choices (#184)
58 lines
1.7 KiB
Elixir
58 lines
1.7 KiB
Elixir
defmodule Claper.Presentations.PresentationState do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
@type t :: %__MODULE__{
|
|
id: integer(),
|
|
position: integer() | nil,
|
|
chat_visible: boolean() | nil,
|
|
poll_visible: boolean() | nil,
|
|
join_screen_visible: boolean() | nil,
|
|
chat_enabled: boolean() | nil,
|
|
anonymous_chat_enabled: boolean() | nil,
|
|
message_reaction_enabled: boolean() | nil,
|
|
banned: [String.t()] | nil,
|
|
show_only_pinned: boolean() | nil,
|
|
show_attendee_count: boolean() | nil,
|
|
presentation_file_id: integer() | nil,
|
|
inserted_at: NaiveDateTime.t(),
|
|
updated_at: NaiveDateTime.t()
|
|
}
|
|
|
|
schema "presentation_states" do
|
|
field :position, :integer
|
|
field :chat_visible, :boolean
|
|
field :poll_visible, :boolean
|
|
field :join_screen_visible, :boolean
|
|
field :chat_enabled, :boolean
|
|
field :anonymous_chat_enabled, :boolean
|
|
field :message_reaction_enabled, :boolean, default: true
|
|
field :banned, {:array, :string}, default: []
|
|
field :show_only_pinned, :boolean, default: false
|
|
field :show_attendee_count, :boolean, default: true
|
|
|
|
belongs_to :presentation_file, Claper.Presentations.PresentationFile
|
|
|
|
timestamps()
|
|
end
|
|
|
|
@doc false
|
|
def changeset(presentation_state, attrs) do
|
|
presentation_state
|
|
|> cast(attrs, [
|
|
:position,
|
|
:chat_visible,
|
|
:poll_visible,
|
|
:join_screen_visible,
|
|
:banned,
|
|
:presentation_file_id,
|
|
:chat_enabled,
|
|
:anonymous_chat_enabled,
|
|
:show_only_pinned,
|
|
:show_attendee_count,
|
|
:message_reaction_enabled
|
|
])
|
|
|> validate_required([])
|
|
end
|
|
end
|