Makes the notification to an error

pull/6827/head
Jonas Heinrich 10 years ago
parent 8dcd24a472
commit 57b4319397
  1. 2
      app/controllers/meeting_contents_controller.rb
  2. 3
      config/locales/de.yml
  3. 3
      config/locales/en.yml
  4. 2
      spec/controllers/meeting_contents_controller_spec.rb

@ -97,7 +97,7 @@ class MeetingContentsController < ApplicationController
if recipients_with_errors == [] if recipients_with_errors == []
flash[:notice] = l(:notice_successful_notification) flash[:notice] = l(:notice_successful_notification)
else else
flash[:notice] = l(:notice_notification_with_errors) + recipients_with_errors.join(", ") flash[:error] = l(:error_notification_with_errors) + recipients_with_errors.join(", ")
end end
end end
redirect_back_or_default :controller => '/meetings', :action => 'show', :id => @meeting redirect_back_or_default :controller => '/meetings', :action => 'show', :id => @meeting

@ -36,6 +36,8 @@ de:
description_attended: "teilgenommen" description_attended: "teilgenommen"
description_invite: "eingeladen" description_invite: "eingeladen"
error_notification_with_errors: "Benachrichtigungversenden fehlgeschlagen. Folgende Empfänger konnten nicht benachrichtigt werden: "
events: events:
meeting: Besprechung bearbeitet meeting: Besprechung bearbeitet
meeting_agenda: Agenda bearbeitet meeting_agenda: Agenda bearbeitet
@ -62,7 +64,6 @@ de:
label_version: "Version" label_version: "Version"
notice_successful_notification: "Benachrichtigung erfolgreich gesendet" notice_successful_notification: "Benachrichtigung erfolgreich gesendet"
notice_notification_with_errors: "Benachrichtigung gesendet. Folgende Empfänger konnten nicht benachrichtigt werden: "
notice_timezone_missing: Keine Zeitzone eingestellt und daher %{zone} angenommen. Um Ihre Zeitzone einzustellen, klicken Sie bitte hier. notice_timezone_missing: Keine Zeitzone eingestellt und daher %{zone} angenommen. Um Ihre Zeitzone einzustellen, klicken Sie bitte hier.
permission_create_meetings: "Besprechungen erstellen" permission_create_meetings: "Besprechungen erstellen"

@ -44,6 +44,8 @@ en:
meeting_minutes: Meeting minutes edited meeting_minutes: Meeting minutes edited
meeting_minutes_created: Meeting minutes created meeting_minutes_created: Meeting minutes created
error_notification_with_errors: "Failed to send notification. The following recipients could not be notified: "
label_meeting_hour: "Time (hour)" label_meeting_hour: "Time (hour)"
label_meeting_minute: "Time (minute)" label_meeting_minute: "Time (minute)"
@ -62,7 +64,6 @@ en:
label_version: "Version" label_version: "Version"
notice_successful_notification: "Notification sent successfully" notice_successful_notification: "Notification sent successfully"
notice_notification_with_errors: "Notification sent. The following recipients could not be notified: "
notice_timezone_missing: No time zone is set and %{zone} is assumed. To choose your time zone, please click here. notice_timezone_missing: No time zone is set and %{zone} is assumed. To choose your time zone, please click here.
permission_create_meetings: "Create meetings" permission_create_meetings: "Create meetings"

@ -86,7 +86,7 @@ describe MeetingContentsController do
it 'produces a flash message containing the mail addresses raising the error' do it 'produces a flash message containing the mail addresses raising the error' do
put 'notify', meeting_id: meeting.id put 'notify', meeting_id: meeting.id
meeting.participants.each do |participant| meeting.participants.each do |participant|
expect(flash[:notice]).to include(participant.mail) expect(flash[:error]).to include(participant.mail)
end end
end end
end end

Loading…
Cancel
Save