🔍 Implement basic event visibility
See https://framagit.org/framasoft/mobilizon/wikis/spec/Event#visibility Also brings support for event status (tentative/confirmed/cancelled) Closes #56 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
import EctoEnum
|
||||
|
||||
defenum(Mobilizon.Events.CommentVisibilityEnum, :comment_visibility_type, [
|
||||
:public,
|
||||
:local,
|
||||
:group,
|
||||
:unlisted,
|
||||
:moderated,
|
||||
:private
|
||||
])
|
||||
|
||||
defmodule Mobilizon.Events.Comment do
|
||||
@moduledoc """
|
||||
An actor comment (for instance on an event or on a group)
|
||||
@@ -14,6 +25,7 @@ defmodule Mobilizon.Events.Comment do
|
||||
field(:text, :string)
|
||||
field(:url, :string)
|
||||
field(:local, :boolean, default: true)
|
||||
field(:visibility, :integer)
|
||||
field(:uuid, Ecto.UUID)
|
||||
belongs_to(:actor, Actor, foreign_key: :actor_id)
|
||||
belongs_to(:attributed_to, Actor, foreign_key: :attributed_to_id)
|
||||
@@ -38,7 +50,7 @@ defmodule Mobilizon.Events.Comment do
|
||||
else: "#{MobilizonWeb.Endpoint.url()}/comments/#{uuid}"
|
||||
|
||||
comment
|
||||
|> cast(attrs, [
|
||||
|> Ecto.Changeset.cast(attrs, [
|
||||
:url,
|
||||
:text,
|
||||
:actor_id,
|
||||
|
||||
Reference in New Issue
Block a user