hide private projects

This commit is contained in:
zmagod 2016-10-21 09:06:19 +02:00
parent 4c086a6fc1
commit db806f3c10
3 changed files with 4 additions and 11 deletions

View file

@ -15,7 +15,7 @@ class ProjectsController < ApplicationController
before_action :check_experiment_archive_permissions,
only: [:experiment_archive]
filter_by_archived = false
@filter_by_archived = false
# except parameter could be used but it is not working.
layout :choose_layout
@ -31,7 +31,6 @@ class ProjectsController < ApplicationController
if current_user.organizations.any?
@current_organization_id = current_organization.id
@organization_projects = current_organization.active_project
@current_sort = params[:sort].to_s
@projects_by_orgs = current_user
.projects_by_orgs(@current_organization_id,
@ -41,7 +40,6 @@ class ProjectsController < ApplicationController
@organizations = current_user.organizations
# New project for create new project modal
@project = Project.new
end

View file

@ -305,8 +305,4 @@ class Organization < ActiveRecord::Base
def protocol_keywords_list
ProtocolKeyword.where(organization: self).pluck(:name)
end
def active_project
projects.where(archived: false)
end
end

View file

@ -111,11 +111,10 @@
</div>
<% else %>
<h2 class="page-header"><%= current_organization.name %></h2>
<% if @organization_projects.any? %>
<% @projects_by_orgs.each do |org, projects| %>
<%= render partial: "projects/index/org_projects",
locals: { org: current_organization,
projects: @organization_projects } %>
locals: {org: org, projects: projects} %>
<% end %>
<% end %>
<%= javascript_include_tag "projects/index", "data-turbolinks-track" => true %>