Skip to content

Commit

Permalink
remove unconfigured tools from the welcome page aces#1409
Browse files Browse the repository at this point in the history
  • Loading branch information
MontrealSergiy committed Jan 27, 2025
1 parent becdc18 commit 509a279
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions BrainPortal/app/controllers/portal_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions BrainPortal/app/views/portal/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@
<strong>Your current time:</strong> <%= to_localtime(Time.now, :datetime) %><BR>
</p>
<p>
<strong>Tools available to you ( out of <%= link_to @tool_count , available_path %> ) :</strong><br/>
<%= array_to_table(current_user.available_tools.where( "category <> 'background'" ).to_a.map(&:name).sort, :table_class => 'simple', :cols => 4) %>
<strong>Tools available to you ( out of <%= link_to @tool_names.count , available_path %> ) :</strong><br/>
<%= array_to_table(current_user.available_tools.pluck(:name).sort&@tool_names, :table_class => 'simple', :cols => 4) %>
</p>
<p>
<strong>Note:</strong> The full list of <em> all tools </em> and curated datasets is <%= link_to 'here', available_path %>
Expand Down

0 comments on commit 509a279

Please sign in to comment.