aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2016-01-26 19:58:27 +0100
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2016-01-27 01:50:47 +0100
commitb127a972d43c6069bd054c6b0ad7fbf316c7e788 (patch)
tree7895222239d37662bf090fa9448af93b63555ea0
parent5b039b7abb43a90d3615137f570900bfeb487527 (diff)
downloadecs2-b127a972d43c6069bd054c6b0ad7fbf316c7e788.tar.gz
ecs2-b127a972d43c6069bd054c6b0ad7fbf316c7e788.zip
Change flash messages of create and destroy participants.
-rw-r--r--app/controllers/admin/participants_controller.rb29
1 files changed, 15 insertions, 14 deletions
diff --git a/app/controllers/admin/participants_controller.rb b/app/controllers/admin/participants_controller.rb
index 1f2c49f..f8c195e 100644
--- a/app/controllers/admin/participants_controller.rb
+++ b/app/controllers/admin/participants_controller.rb
@@ -1,17 +1,17 @@
-# Copyright (C) 2007, 2008, 2009, 2010 Heiko Bernloehr (FreeIT.de).
-#
+# Copyright (C) 2007, 2008, 2009, 2010, 2016 Heiko Bernloehr (FreeIT.de).
+#
# This file is part of ECS.
-#
+#
# ECS is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
-#
+#
# ECS is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
-#
+#
# You should have received a copy of the GNU Affero General Public
# License along with ECS. If not, see <http://www.gnu.org/licenses/>.
@@ -63,19 +63,19 @@ class Admin::ParticipantsController < ApplicationController
@organizations = Organization.find(:all, :order => :id)
@participant.identities.build
end
-
+
def create
@participant = Participant.new(params[:participant])
@participant.ptype = Participant::TYPE[:main]
if @participant.save
- flash[:notice] = 'Participant was successfully created.'
+ flash[:notice] = "Participant \"#{CGI.escapeHTML @participant.name}\" was successfully created."
redirect_to admin_participants_path
- else
+ else
@organizations = Organization.find(:all, :order => :id)
render :action => 'new'
end
end
-
+
def edit
@participant = Participant.find(params[:id])
@organizations = Organization.find(:all, :order => :id)
@@ -94,13 +94,14 @@ class Admin::ParticipantsController < ApplicationController
render :action => 'edit'
end
end
-
+
def destroy
- Participant.find(params[:id]).destroy
- flash[:notice] = 'Participant was successfully destroyed.'
- redirect_to admin_participants_path
+ p = Participant.find(params[:id])
+ p.destroy
+ flash[:notice] = "Participant \"#{CGI.escapeHTML p.name}\" was successfully destroyed."
+ redirect_to_admin_participants_path
end
-
+
def index_communities
@participant = Participant.find(params[:id])
@communities=Participant.find(params[:id]).memberships.collect {|i| i.community }.uniq.sort{|x,y| x.id <=> y.id }