mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 21:21:50 +08:00
hide private projects
This commit is contained in:
parent
4c086a6fc1
commit
db806f3c10
3 changed files with 4 additions and 11 deletions
|
@ -15,7 +15,7 @@ class ProjectsController < ApplicationController
|
||||||
before_action :check_experiment_archive_permissions,
|
before_action :check_experiment_archive_permissions,
|
||||||
only: [:experiment_archive]
|
only: [:experiment_archive]
|
||||||
|
|
||||||
filter_by_archived = false
|
@filter_by_archived = false
|
||||||
|
|
||||||
# except parameter could be used but it is not working.
|
# except parameter could be used but it is not working.
|
||||||
layout :choose_layout
|
layout :choose_layout
|
||||||
|
@ -31,7 +31,6 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
if current_user.organizations.any?
|
if current_user.organizations.any?
|
||||||
@current_organization_id = current_organization.id
|
@current_organization_id = current_organization.id
|
||||||
@organization_projects = current_organization.active_project
|
|
||||||
@current_sort = params[:sort].to_s
|
@current_sort = params[:sort].to_s
|
||||||
@projects_by_orgs = current_user
|
@projects_by_orgs = current_user
|
||||||
.projects_by_orgs(@current_organization_id,
|
.projects_by_orgs(@current_organization_id,
|
||||||
|
@ -41,7 +40,6 @@ class ProjectsController < ApplicationController
|
||||||
|
|
||||||
@organizations = current_user.organizations
|
@organizations = current_user.organizations
|
||||||
|
|
||||||
|
|
||||||
# New project for create new project modal
|
# New project for create new project modal
|
||||||
@project = Project.new
|
@project = Project.new
|
||||||
end
|
end
|
||||||
|
|
|
@ -305,8 +305,4 @@ class Organization < ActiveRecord::Base
|
||||||
def protocol_keywords_list
|
def protocol_keywords_list
|
||||||
ProtocolKeyword.where(organization: self).pluck(:name)
|
ProtocolKeyword.where(organization: self).pluck(:name)
|
||||||
end
|
end
|
||||||
|
|
||||||
def active_project
|
|
||||||
projects.where(archived: false)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -111,11 +111,10 @@
|
||||||
</div>
|
</div>
|
||||||
<% else %>
|
<% else %>
|
||||||
<h2 class="page-header"><%= current_organization.name %></h2>
|
<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",
|
<%= render partial: "projects/index/org_projects",
|
||||||
locals: { org: current_organization,
|
locals: {org: org, projects: projects} %>
|
||||||
projects: @organization_projects } %>
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= javascript_include_tag "projects/index", "data-turbolinks-track" => true %>
|
<%= javascript_include_tag "projects/index", "data-turbolinks-track" => true %>
|
||||||
|
|
Loading…
Reference in a new issue