From 5fd38ace2ef6d17887f8509850da731d1d1cefb2 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 30 Sep 2019 18:18:04 +0200 Subject: [PATCH] Notifications on event update Signed-off-by: Thomas Citharel --- .credo.exs | 3 +- config/config.exs | 4 + lib/mobilizon/cldr.ex | 9 ++ lib/mobilizon/events/events.ex | 27 ++++- lib/mobilizon_web/email/email.ex | 3 +- lib/mobilizon_web/email/event.ex | 43 +++++++ .../event_participation_rejected.html.eex | 2 +- .../templates/email/event_updated.html.eex | 110 ++++++++++++++++++ .../templates/email/event_updated.text.eex | 21 ++++ lib/mobilizon_web/views/email_view.ex | 7 ++ lib/service/events/tools.ex | 50 ++++++++ mix.exs | 1 + mix.lock | 6 + priv/gettext/cs/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/de/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/default.pot | 61 +++++++++- priv/gettext/en/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/es/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/fr_FR/LC_MESSAGES/default.po | 100 ++++++++++++---- priv/gettext/it/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/ja/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/nl/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/oc/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/pl/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/pt/LC_MESSAGES/default.po | 61 +++++++++- priv/gettext/ru/LC_MESSAGES/default.po | 61 +++++++++- .../resolvers/event_resolver_test.exs | 32 ++++- 27 files changed, 1106 insertions(+), 44 deletions(-) create mode 100644 lib/mobilizon/cldr.ex create mode 100644 lib/mobilizon_web/email/event.ex create mode 100644 lib/mobilizon_web/templates/email/event_updated.html.eex create mode 100644 lib/mobilizon_web/templates/email/event_updated.text.eex create mode 100644 lib/service/events/tools.ex diff --git a/.credo.exs b/.credo.exs index 83f7dd28f..1d3bf7620 100644 --- a/.credo.exs +++ b/.credo.exs @@ -111,8 +111,7 @@ {Credo.Check.Refactor.PipeChainStart, [ excluded_argument_types: [:atom, :binary, :fn, :keyword, :number], - excluded_functions: [], - exit_status: 0 + excluded_functions: [] ]}, {Credo.Check.Refactor.UnlessWithElse, []}, diff --git a/config/config.exs b/config/config.exs index 85c698b0e..96e3c20be 100644 --- a/config/config.exs +++ b/config/config.exs @@ -112,6 +112,10 @@ config :auto_linker, config :phoenix, :format_encoders, json: Jason, "activity-json": Jason config :phoenix, :json_library, Jason +config :ex_cldr, + default_locale: "en", + default_backend: Mobilizon.Cldr + config :http_signatures, adapter: Mobilizon.Service.HTTPSignatures.Signature diff --git a/lib/mobilizon/cldr.ex b/lib/mobilizon/cldr.ex new file mode 100644 index 000000000..f8da0f17e --- /dev/null +++ b/lib/mobilizon/cldr.ex @@ -0,0 +1,9 @@ +defmodule Mobilizon.Cldr do + @moduledoc """ + Module to define supported locales + """ + + use Cldr, + locales: ["cs", "de", "en", "es", "fr", "it", "ja", "nl", "pl", "pt", "ru"], + providers: [Cldr.Number, Cldr.Calendar, Cldr.DateTime] +end diff --git a/lib/mobilizon/events/events.ex b/lib/mobilizon/events/events.ex index 9f097aead..f8920a0ee 100644 --- a/lib/mobilizon/events/events.ex +++ b/lib/mobilizon/events/events.ex @@ -262,11 +262,19 @@ defmodule Mobilizon.Events do Updates an event. """ @spec update_event(Event.t(), map) :: {:ok, Event.t()} | {:error, Ecto.Changeset.t()} - def update_event(%Event{} = event, attrs) do - event - |> Repo.preload(:tags) - |> Event.update_changeset(attrs) - |> Repo.update() + def update_event(%Event{} = old_event, attrs) do + with %Ecto.Changeset{changes: changes} = changeset <- + old_event |> Repo.preload(:tags) |> Event.update_changeset(attrs) do + with {:ok, %Event{} = new_event} <- Repo.update(changeset) do + Mobilizon.Service.Events.Tool.calculate_event_diff_and_send_notifications( + old_event, + new_event, + changes + ) + + {:ok, new_event} + end + end end @doc """ @@ -1301,6 +1309,15 @@ defmodule Mobilizon.Events do ) end + @spec list_participants_for_event_query(String.t()) :: Ecto.Query.t() + def list_local_emails_user_participants_for_event_query(event_id) do + Participant + |> join(:inner, [p], a in Actor, on: p.actor_id == a.id and is_nil(a.domain)) + |> join(:left, [_p, a], u in User, on: a.user_id == u.id) + |> where([p], p.event_id == ^event_id) + |> select([_p, a, u], {a, u}) + end + @spec list_participations_for_user_query(integer()) :: Ecto.Query.t() defp list_participations_for_user_query(user_id) do from( diff --git a/lib/mobilizon_web/email/email.ex b/lib/mobilizon_web/email/email.ex index 32f5c36f2..ec12bc792 100644 --- a/lib/mobilizon_web/email/email.ex +++ b/lib/mobilizon_web/email/email.ex @@ -11,7 +11,8 @@ defmodule MobilizonWeb.Email do def base_email(args) do instance = Config.instance_config() - new_email(args) + args + |> new_email() |> from(Config.instance_email_from()) |> put_header("Reply-To", Config.instance_email_reply_to()) |> assign(:instance, instance) diff --git a/lib/mobilizon_web/email/event.ex b/lib/mobilizon_web/email/event.ex new file mode 100644 index 000000000..c1e55077e --- /dev/null +++ b/lib/mobilizon_web/email/event.ex @@ -0,0 +1,43 @@ +defmodule MobilizonWeb.Email.Event do + @moduledoc """ + Handles emails sent about events. + """ + + use Bamboo.Phoenix, view: MobilizonWeb.EmailView + + import Bamboo.Phoenix + + import MobilizonWeb.Gettext + + alias Mobilizon.Events.Event + alias Mobilizon.Actors.Actor + alias Mobilizon.Users.User + alias MobilizonWeb.Email + + @spec event_updated(User.t(), Actor.t(), Event.t(), Event.t(), list(), String.t()) :: + Bamboo.Email.t() + def event_updated( + %User{} = user, + %Actor{} = actor, + %Event{} = old_event, + %Event{} = event, + changes, + locale \\ "en" + ) do + Gettext.put_locale(locale) + + subject = + gettext( + "Event %{title} has been updated", + title: old_event.title + ) + + Email.base_email(to: {Actor.display_name(actor), user.email}, subject: subject) + |> assign(:locale, locale) + |> assign(:event, event) + |> assign(:old_event, old_event) + |> assign(:changes, changes) + |> assign(:subject, subject) + |> render(:event_updated) + end +end diff --git a/lib/mobilizon_web/templates/email/event_participation_rejected.html.eex b/lib/mobilizon_web/templates/email/event_participation_rejected.html.eex index 4439f32a2..6f305e6a4 100644 --- a/lib/mobilizon_web/templates/email/event_participation_rejected.html.eex +++ b/lib/mobilizon_web/templates/email/event_participation_rejected.html.eex @@ -35,7 +35,7 @@

- <%= gettext "You requested to participate in event %{title}", title: @event.title %> + <%= gettext "You requested to participate in event %{title}.", title: @event.title %>

diff --git a/lib/mobilizon_web/templates/email/event_updated.html.eex b/lib/mobilizon_web/templates/email/event_updated.html.eex new file mode 100644 index 000000000..553dfe526 --- /dev/null +++ b/lib/mobilizon_web/templates/email/event_updated.html.eex @@ -0,0 +1,110 @@ + + + + + + + + +
+

+ <%= gettext "Event updated!" %> +

+
+ + + + + + + + + + + + + + + + + + + + + + +
+

+ <%= gettext "The event %{title} was updated", title: @old_event.title %> +

+
+ + <%= if MapSet.member?(@changes, :title) do %> + + + + + <% end %> + <%= if MapSet.member?(@changes, :begins_on) do %> + + + + + <% end %> + <%= if MapSet.member?(@changes, :ends_on) do %> + + + + + <% end %> +
+ <%= gettext "Title" %> + + <%= @event.title %> +
+ <%= gettext "Start of event" %> + + <%= datetime_to_string(@event.begins_on) %> +
+ <%= gettext "Ending of event" %> + + <%= datetime_to_string(@event.ends_on) %> +
+
+ + + + +
+ + + + +
+ <%= gettext "Go to event page" %> +
+
+
+

+ <%= gettext "If you need to cancel your participation, just access the event page through link above and click on the participation button." %> +

+
+ + + \ No newline at end of file diff --git a/lib/mobilizon_web/templates/email/event_updated.text.eex b/lib/mobilizon_web/templates/email/event_updated.text.eex new file mode 100644 index 000000000..f7b393395 --- /dev/null +++ b/lib/mobilizon_web/templates/email/event_updated.text.eex @@ -0,0 +1,21 @@ +<%= gettext "Event updated!" %> + +== + +<%= gettext "The event %{title} was just updated", title: @old_event.title %> + +<%= if MapSet.member?(@changes, :title) do %> + <%= gettext "New title: %{title}", title: @event.title %> +<% end %> + +<%= if MapSet.member?(@changes, :begins_on) do %> + <%= gettext "New date and time for start of event: %{begins_on}", begins_on: datetime_to_string(@event.begins_on) %> +<% end %> + +<%= if MapSet.member?(@changes, :ends_on) do %> + <%= gettext "New date and time for ending of event: %{ends_on}", ends_on: datetime_to_string(@event.ends_on) %> +<% end %> + +<%= gettext "View the updated event on: %{link}", link: page_url(MobilizonWeb.Endpoint, :event, @event.id) %> + +<%= gettext "If you need to cancel your participation, just access the event page through link above and click on the participation button." %> diff --git a/lib/mobilizon_web/views/email_view.ex b/lib/mobilizon_web/views/email_view.ex index d34589acd..2c911cb45 100644 --- a/lib/mobilizon_web/views/email_view.ex +++ b/lib/mobilizon_web/views/email_view.ex @@ -1,3 +1,10 @@ defmodule MobilizonWeb.EmailView do use MobilizonWeb, :view + + def datetime_to_string(%DateTime{} = datetime, locale \\ "en") do + with {:ok, string} <- + Cldr.DateTime.to_string(datetime, Mobilizon.Cldr, format: :medium, locale: locale) do + string + end + end end diff --git a/lib/service/events/tools.ex b/lib/service/events/tools.ex new file mode 100644 index 000000000..dc8efef8e --- /dev/null +++ b/lib/service/events/tools.ex @@ -0,0 +1,50 @@ +defmodule Mobilizon.Service.Events.Tool do + @moduledoc """ + Event-related tools + """ + alias Mobilizon.Events + alias Mobilizon.Events.Event + alias Mobilizon.Actors.Actor + alias Mobilizon.Users.User + alias MobilizonWeb.Email + alias Mobilizon.Storage.Repo + + @important_changes [:title, :begins_on, :ends_on] + + def calculate_event_diff_and_send_notifications( + %Event{} = old_event, + %Event{id: event_id} = event, + changes + ) do + important = MapSet.new(@important_changes) + + diff = + changes + |> Map.keys() + |> MapSet.new() + |> MapSet.intersection(important) + + if MapSet.size(diff) > 0 do + Repo.transaction(fn -> + event_id + |> Events.list_local_emails_user_participants_for_event_query() + |> Repo.stream() + |> Enum.to_list() + |> Enum.each( + &send_notification_for_event_update_to_participant(&1, old_event, event, diff) + ) + end) + end + end + + defp send_notification_for_event_update_to_participant( + {%Actor{} = actor, %User{} = user}, + %Event{} = old_event, + %Event{} = event, + diff + ) do + user + |> Email.Event.event_updated(actor, old_event, event, diff) + |> Email.Mailer.deliver_later() + end +end diff --git a/mix.exs b/mix.exs index 99f2b8179..f79671d7a 100644 --- a/mix.exs +++ b/mix.exs @@ -97,6 +97,7 @@ defmodule Mobilizon.Mixfile do git: "https://git.pleroma.social/pleroma/http_signatures.git", ref: "293d77bb6f4a67ac8bde1428735c3b42f22cbb30"}, {:html_sanitize_ex, "~> 1.3.0"}, + {:ex_cldr_dates_times, "~> 2.0"}, # Dev and test dependencies {:phoenix_live_reload, "~> 1.2", only: :dev}, {:ex_machina, "~> 2.3", only: [:dev, :test]}, diff --git a/mix.lock b/mix.lock index 25f4fe549..d90894828 100644 --- a/mix.lock +++ b/mix.lock @@ -12,6 +12,7 @@ "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, "cachex": {:hex, :cachex, "3.2.0", "a596476c781b0646e6cb5cd9751af2e2974c3e0d5498a8cab71807618b74fe2f", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm"}, "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, + "cldr_utils": {:hex, :cldr_utils, "2.4.0", "53609273da803395e12f288cc25587ddb2238b533633b432471193c5f8b0d96a", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm"}, "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm"}, "comeonin": {:hex, :comeonin, "5.1.2", "fbbbbbfcf0f0e9900c0336d16c8d462edf838ba1759577e29cc5fbd7c28a4540", [:mix], [], "hexpm"}, "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"}, @@ -32,6 +33,11 @@ "elixir_make": {:hex, :elixir_make, "0.6.0", "38349f3e29aff4864352084fc736fa7fa0f2995a819a737554f7ebd28b85aaab", [:mix], [], "hexpm"}, "erlex": {:hex, :erlex, "0.2.5", "e51132f2f472e13d606d808f0574508eeea2030d487fc002b46ad97e738b0510", [:mix], [], "hexpm"}, "eternal": {:hex, :eternal, "1.2.1", "d5b6b2499ba876c57be2581b5b999ee9bdf861c647401066d3eeed111d096bc4", [:mix], [], "hexpm"}, + "ex_cldr": {:hex, :ex_cldr, "2.10.2", "5b9062c2a72b3a834ded2eeb49c8da77dde32f417fe523e884931af2a82cac7e", [:mix], [{:cldr_utils, "~> 2.3", [hex: :cldr_utils, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6", [hex: :decimal, repo: "hexpm", optional: false]}, {:gettext, "~> 0.13", [hex: :gettext, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_parsec, "~> 0.5", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_cldr_calendars": {:hex, :ex_cldr_calendars, "1.4.0", "c7adf1e752b0cbad6f565246a583f1d056ad05fdc0c7fb8b66d498d1b381225f", [:mix], [{:ex_cldr, "~> 2.8", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_lists, "~> 2.4", [hex: :ex_cldr_lists, repo: "hexpm", optional: true]}, {:ex_cldr_units, "~> 2.0", [hex: :ex_cldr_units, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, + "ex_cldr_currencies": {:hex, :ex_cldr_currencies, "2.3.0", "bffae489416b8b05d4683403263f5d62aae17de70c24ff915a533541fea514de", [:mix], [{:ex_cldr, "~> 2.6", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_cldr_dates_times": {:hex, :ex_cldr_dates_times, "2.2.3", "4a82f6af48f55c92c0d28be066e5b2451e807e3f49246d08845af664fd7cb712", [:mix], [{:ex_cldr, "~> 2.8", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_calendars, "~> 1.2", [hex: :ex_cldr_calendars, repo: "hexpm", optional: false]}, {:ex_cldr_numbers, "~> 2.6", [hex: :ex_cldr_numbers, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "ex_cldr_numbers": {:hex, :ex_cldr_numbers, "2.7.2", "0967d9f38e80819938b95b544f2689b45e1ecfe6487b96666d3833dde377ede4", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:ex_cldr, "~> 2.6", [hex: :ex_cldr, repo: "hexpm", optional: false]}, {:ex_cldr_currencies, "~> 2.3", [hex: :ex_cldr_currencies, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, "ex_crypto": {:hex, :ex_crypto, "0.10.0", "af600a89b784b36613a989da6e998c1b200ff1214c3cfbaf8deca4aa2f0a1739", [:mix], [{:poison, ">= 2.0.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, "ex_doc": {:hex, :ex_doc, "0.21.2", "caca5bc28ed7b3bdc0b662f8afe2bee1eedb5c3cf7b322feeeb7c6ebbde089d6", [:mix], [{:earmark, "~> 1.3.3 or ~> 1.4", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"}, "ex_ical": {:hex, :ex_ical, "0.2.0", "4b928b554614704016cc0c9ee226eb854da9327a1cc460457621ceacb1ac29a6", [:mix], [{:timex, "~> 3.1", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm"}, diff --git a/priv/gettext/cs/LC_MESSAGES/default.po b/priv/gettext/cs/LC_MESSAGES/default.po index a92c0d33d..724b613f2 100644 --- a/priv/gettext/cs/LC_MESSAGES/default.po +++ b/priv/gettext/cs/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index 3238ac825..e8fe88b49 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index 2ffba5752..a0299d377 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -141,11 +141,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -207,12 +210,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -226,3 +229,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index e00504e8f..f3d4e35d2 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -167,11 +167,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -237,12 +240,12 @@ msgstr "You requested a new password for your account on %{server}." #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -256,3 +259,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po index f3f0ee57b..98e118721 100644 --- a/priv/gettext/es/LC_MESSAGES/default.po +++ b/priv/gettext/es/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/fr_FR/LC_MESSAGES/default.po b/priv/gettext/fr_FR/LC_MESSAGES/default.po index fc938e7f6..025a88552 100644 --- a/priv/gettext/fr_FR/LC_MESSAGES/default.po +++ b/priv/gettext/fr_FR/LC_MESSAGES/default.po @@ -10,16 +10,15 @@ msgid "" msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-09-23 17:59+0000\n" +"PO-Revision-Date: 2019-09-30 17:58+0200\n" "Last-Translator: Thomas Citharel \n" -"Language-Team: French \n" +"Language-Team: French \n" "Language: fr_FR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 3.8\n" +"X-Generator: Poedit 2.2.3\n" #, elixir-format #: lib/mobilizon_web/templates/email/password_reset.html.eex:48 @@ -134,8 +133,7 @@ msgstr "Vous avez créé un compte sur %{host} avec cette adresse email. Vous ê #, elixir-format #: lib/mobilizon_web/templates/email/password_reset.html.eex:38 msgid "You requested a new password for your account on %{server}." -msgstr "" -"Vous avez demandé un nouveau mot de passe pour votre compte sur %{server}." +msgstr "Vous avez demandé un nouveau mot de passe pour votre compte sur %{server}." #, elixir-format #: lib/mobilizon_web/email/user.ex:25 @@ -155,23 +153,26 @@ msgstr "Activer mon compte" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:13 msgid "All good!" -msgstr "" +msgstr "Tout est bon !" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:45 #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:7 msgid "An organizer just approved your participation. You're now going to this event!" -msgstr "" +msgstr "Un⋅e organisateur⋅ice vient d'approuver votre participation. Vous vous rendez maintenant à cet événement !" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" -msgstr "" +msgstr "Aller à la page de l'événement" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." -msgstr "" +msgstr "Si vous voulez annuler votre participation, il suffit d'accéder à la page de l'événement via le lien ci-dessus et de cliquer sur le bouton de participation." #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:11 @@ -191,17 +192,17 @@ msgstr "Nouveau signalement sur %{instance}" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:1 msgid "Participation approved" -msgstr "" +msgstr "Participation approuvée" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:1 msgid "Participation rejected" -msgstr "" +msgstr "Participation refusée" #, elixir-format #: lib/mobilizon_web/templates/email/password_reset.text.eex:1 msgid "Password reset" -msgstr "" +msgstr "Réinitialisation du mot de passe" #, elixir-format #: lib/mobilizon_web/templates/email/password_reset.text.eex:7 @@ -211,13 +212,13 @@ msgstr "Réinitialiser votre mot de passe est facile. Cliquez simplement sur le #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:13 msgid "Sorry!" -msgstr "" +msgstr "Désolé !" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:45 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:7 msgid "Unfortunately, the organizers rejected your participation." -msgstr "" +msgstr "Malheureusement, les organisateur⋅ices ont refusé votre participation." #, elixir-format #: lib/mobilizon_web/templates/email/registration_confirmation.text.eex:5 @@ -227,27 +228,82 @@ msgstr "Vous avez créé un compte sur %{host} avec cette adresse email. Vous ê #, elixir-format #: lib/mobilizon_web/templates/email/password_reset.text.eex:5 msgid "You requested a new password for your account on %{host}." -msgstr "" -"Vous avez demandé un nouveau mot de passe pour votre compte sur %{server}." +msgstr "Vous avez demandé un nouveau mot de passe pour votre compte sur %{server}." #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" -msgstr "" +msgstr "Vous avez demandé à participer à l'événement %{title}" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." -msgstr "" +msgstr "Vous avez demandé à participer à l'événement %{title}." #, elixir-format #: lib/mobilizon_web/email/participation.ex:73 msgid "Your participation to event %{title} has been approved" -msgstr "" +msgstr "Votre participation à l'événement %{title} a été approuvée" #, elixir-format #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" -msgstr "" +msgstr "Votre participation à l'événement %{title} a été rejetée" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "Fin de l'événement" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "L'événement %{title} a été mis à jour" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "Événement mis à jour" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "Nouvelle date et heure de fin de l'événement : %{ends_on}" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "Nouvelle date et heure de début de l'événement : %{begins_on}" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "Nouveau titre : %{title}" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "Début de l'événement" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "L'événement %{title} vient d'être mis à jour" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "L'événement %{title} a été mis à jour" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "Titre" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "Voir l'événement mis à jour sur : %{link}" diff --git a/priv/gettext/it/LC_MESSAGES/default.po b/priv/gettext/it/LC_MESSAGES/default.po index d96df4740..2559d5f13 100644 --- a/priv/gettext/it/LC_MESSAGES/default.po +++ b/priv/gettext/it/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/ja/LC_MESSAGES/default.po b/priv/gettext/ja/LC_MESSAGES/default.po index dfe522921..3a224fa57 100644 --- a/priv/gettext/ja/LC_MESSAGES/default.po +++ b/priv/gettext/ja/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/nl/LC_MESSAGES/default.po b/priv/gettext/nl/LC_MESSAGES/default.po index 1e965739c..5895f73d9 100644 --- a/priv/gettext/nl/LC_MESSAGES/default.po +++ b/priv/gettext/nl/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/oc/LC_MESSAGES/default.po b/priv/gettext/oc/LC_MESSAGES/default.po index 0c6be00bb..b9a0a78fe 100644 --- a/priv/gettext/oc/LC_MESSAGES/default.po +++ b/priv/gettext/oc/LC_MESSAGES/default.po @@ -165,11 +165,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -235,12 +238,12 @@ msgstr "Avètz demandat un nòu senhal per vòstre compte sus %{server}." #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -254,3 +257,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/pl/LC_MESSAGES/default.po b/priv/gettext/pl/LC_MESSAGES/default.po index b199be43a..f880713ae 100644 --- a/priv/gettext/pl/LC_MESSAGES/default.po +++ b/priv/gettext/pl/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/pt/LC_MESSAGES/default.po b/priv/gettext/pt/LC_MESSAGES/default.po index 22c0fbdbe..71a19df59 100644 --- a/priv/gettext/pt/LC_MESSAGES/default.po +++ b/priv/gettext/pt/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/priv/gettext/ru/LC_MESSAGES/default.po b/priv/gettext/ru/LC_MESSAGES/default.po index ac823f0ca..55b24c17e 100644 --- a/priv/gettext/ru/LC_MESSAGES/default.po +++ b/priv/gettext/ru/LC_MESSAGES/default.po @@ -155,11 +155,14 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:58 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:87 msgid "Go to event page" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:70 +#: lib/mobilizon_web/templates/email/event_updated.html.eex:99 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:21 msgid "If you need to cancel your participation, just access the event page through link above and click on the participation button." msgstr "" @@ -221,12 +224,12 @@ msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.html.eex:38 -#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 msgid "You requested to participate in event %{title}" msgstr "" #, elixir-format #: lib/mobilizon_web/templates/email/event_participation_approved.text.eex:5 +#: lib/mobilizon_web/templates/email/event_participation_rejected.html.eex:38 #: lib/mobilizon_web/templates/email/event_participation_rejected.text.eex:5 msgid "You requested to participate in event %{title}." msgstr "" @@ -240,3 +243,59 @@ msgstr "" #: lib/mobilizon_web/email/participation.ex:52 msgid "Your participation to event %{title} has been rejected" msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:68 +msgid "Ending of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/email/event.ex:29 +msgid "Event %{title} has been updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:13 +#: lib/mobilizon_web/templates/email/event_updated.text.eex:1 +msgid "Event updated!" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:16 +msgid "New date and time for ending of event: %{ends_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:12 +msgid "New date and time for start of event: %{begins_on}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:8 +msgid "New title: %{title}" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:58 +msgid "Start of event" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:5 +msgid "The event %{title} was just updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:38 +msgid "The event %{title} was updated" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.html.eex:48 +msgid "Title" +msgstr "" + +#, elixir-format +#: lib/mobilizon_web/templates/email/event_updated.text.eex:19 +msgid "View the updated event on: %{link}" +msgstr "" diff --git a/test/mobilizon_web/resolvers/event_resolver_test.exs b/test/mobilizon_web/resolvers/event_resolver_test.exs index 0d842de1a..d6ec3b59b 100644 --- a/test/mobilizon_web/resolvers/event_resolver_test.exs +++ b/test/mobilizon_web/resolvers/event_resolver_test.exs @@ -1,7 +1,8 @@ defmodule MobilizonWeb.Resolvers.EventResolverTest do use MobilizonWeb.ConnCase + use Bamboo.Test alias Mobilizon.Events - alias MobilizonWeb.AbsintheHelpers + alias MobilizonWeb.{AbsintheHelpers, Email} import Mobilizon.Factory @event %{ @@ -499,6 +500,13 @@ defmodule MobilizonWeb.Resolvers.EventResolverTest do test "update_event/3 updates an event", %{conn: conn, actor: actor, user: user} do event = insert(:event, organizer_actor: actor) + _creator = insert(:participant, event: event, actor: actor, role: :creator) + participant_user = insert(:user) + participant_actor = insert(:actor, user: participant_user) + + _participant = + insert(:participant, event: event, actor: participant_actor, role: :participant) + address = insert(:address) begins_on = DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601() @@ -584,6 +592,28 @@ defmodule MobilizonWeb.Resolvers.EventResolverTest do %{"slug" => "tag1-updated", "title" => "tag1_updated"}, %{"slug" => "tag2-updated", "title" => "tag2_updated"} ] + + {:ok, new_event} = Mobilizon.Events.get_event(event.id) + + assert_delivered_email( + Email.Event.event_updated( + user, + actor, + event, + new_event, + MapSet.new([:title, :begins_on, :ends_on]) + ) + ) + + assert_delivered_email( + Email.Event.event_updated( + participant_user, + participant_actor, + event, + new_event, + MapSet.new([:title, :begins_on, :ends_on]) + ) + ) end test "update_event/3 updates an event with a new picture", %{