diff options
-rw-r--r-- | app/controllers/admin/communities_controller.rb | 6 | ||||
-rw-r--r-- | app/controllers/admin/participants_controller.rb | 10 | ||||
-rw-r--r-- | app/views/admin/participants/_form.html.erb | 2 |
3 files changed, 16 insertions, 2 deletions
diff --git a/app/controllers/admin/communities_controller.rb b/app/controllers/admin/communities_controller.rb index 8012eec..86692d4 100644 --- a/app/controllers/admin/communities_controller.rb +++ b/app/controllers/admin/communities_controller.rb @@ -28,7 +28,11 @@ class Admin::CommunitiesController < ApplicationController end def list - @communities=Community.all.distinct + if ECS_CONFIG["participants"]["allow_anonymous"] + @communities=Community.all.distinct + else + @communities=Community.all.where.not(name: "public").distinct + end end def show diff --git a/app/controllers/admin/participants_controller.rb b/app/controllers/admin/participants_controller.rb index 4825073..beabd28 100644 --- a/app/controllers/admin/participants_controller.rb +++ b/app/controllers/admin/participants_controller.rb @@ -72,6 +72,11 @@ class Admin::ParticipantsController < ApplicationController def new @participant = Participant.new @organizations = Organization.all.order(:id) + if ECS_CONFIG["participants"]["allow_anonymous"] + @communities=Community.all.distinct + else + @communities=Community.all.where.not(name: "public").distinct + end @participant.identities.build end @@ -90,6 +95,11 @@ class Admin::ParticipantsController < ApplicationController def edit @participant = Participant.find(params[:id]) @organizations = Organization.all.order(:id) + if ECS_CONFIG["participants"]["allow_anonymous"] + @communities=Community.all.distinct + else + @communities=Community.all.where.not(name: "public").distinct + end end def reset diff --git a/app/views/admin/participants/_form.html.erb b/app/views/admin/participants/_form.html.erb index dd85b60..2aaf202 100644 --- a/app/views/admin/participants/_form.html.erb +++ b/app/views/admin/participants/_form.html.erb @@ -110,7 +110,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>. <th>join</th> </tr> - <% Community.all.each do |community| %> + <% @communities.each do |community| %> <tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>"> <!-- <tr align="left" valign="top"> --> <TD> |