Properly handle event status

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-11 15:58:46 +02:00
parent e8a9ee92b7
commit 534ff09674
20 changed files with 334 additions and 101 deletions

View File

@@ -42,6 +42,20 @@
<tr>
<td bgcolor="#ffffff" align="left" style="padding: 20px 30px 40px 30px; color: #777777; font-family: 'Lato', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 400; line-height: 25px;" >
<table width="100%">
<%= if MapSet.member?(@changes, :status) do %>
<tr>
<td bgcolor="#ffffff" align="center">
<%= case @event.status do %>
<% :confirmed -> %>
<%= gettext "Event has been confirmed" %>
<% :tentative -> %>
<%= gettext "Event status has been set as tentative" %>
<% :cancelled -> %>
<%= gettext "Event has been cancelled" %>
<% end %>
</td>
</tr>
<% end %>
<%= if MapSet.member?(@changes, :title) do %>
<tr>
<td bgcolor="#ffffff" align="left">

View File

@@ -9,7 +9,7 @@ defmodule Mobilizon.Service.Events.Tool do
alias MobilizonWeb.Email
alias Mobilizon.Storage.Repo
@important_changes [:title, :begins_on, :ends_on]
@important_changes [:title, :begins_on, :ends_on, :status]
def calculate_event_diff_and_send_notifications(
%Event{} = old_event,