@@ -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
@@ -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
@@ -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>