From 509a279eec97d6a2461fc70952447675c4bb1dcd Mon Sep 17 00:00:00 2001 From: MontrealSergiy Date: Mon, 27 Jan 2025 14:02:30 -0500 Subject: [PATCH] remove unconfigured tools from the welcome page #1409 --- BrainPortal/app/controllers/portal_controller.rb | 4 ++-- BrainPortal/app/views/portal/welcome.html.erb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BrainPortal/app/controllers/portal_controller.rb b/BrainPortal/app/controllers/portal_controller.rb index e02b0b1a3..456f17d2f 100644 --- a/BrainPortal/app/controllers/portal_controller.rb +++ b/BrainPortal/app/controllers/portal_controller.rb @@ -46,14 +46,14 @@ def welcome #:nodoc: @default_data_provider = DataProvider.find_by_id(current_user.meta["pref_data_provider_id"]) @default_bourreau = Bourreau.find_by_id(current_user.meta["pref_bourreau_id"]) - @tool_count = Tool + @tool_names = Tool .joins(:tool_configs) .where.not(category: 'background') .where('tool_configs.bourreau_id IS NOT NULL') .where('tool_configs.bourreau_id > 0') .where('tool_configs.version_name IS NOT NULL') .distinct - .count + .pluck 'name' @dashboard_messages = Message .where(:message_type => 'cbrain_dashboard') diff --git a/BrainPortal/app/views/portal/welcome.html.erb b/BrainPortal/app/views/portal/welcome.html.erb index 0df2ac6a6..789dcbc65 100644 --- a/BrainPortal/app/views/portal/welcome.html.erb +++ b/BrainPortal/app/views/portal/welcome.html.erb @@ -167,8 +167,8 @@ Your current time: <%= to_localtime(Time.now, :datetime) %>

- Tools available to you ( out of <%= link_to @tool_count , available_path %> ) :
- <%= array_to_table(current_user.available_tools.where( "category <> 'background'" ).to_a.map(&:name).sort, :table_class => 'simple', :cols => 4) %> + Tools available to you ( out of <%= link_to @tool_names.count , available_path %> ) :
+ <%= array_to_table(current_user.available_tools.pluck(:name).sort&@tool_names, :table_class => 'simple', :cols => 4) %>

Note: The full list of all tools and curated datasets is <%= link_to 'here', available_path %>