X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/10be0dd7536aeb8909cb21573f9c47bfdc4cfbea..a179c4405895aba6784be3e612c870da1c082f2f:/apps/workbench/app/controllers/users_controller.rb?ds=sidebyside diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb index 002ea62bea..3ccaa525ce 100644 --- a/apps/workbench/app/controllers/users_controller.rb +++ b/apps/workbench/app/controllers/users_controller.rb @@ -1,18 +1,22 @@ class UsersController < ApplicationController skip_before_filter :find_object_by_uuid, :only => :welcome - skip_around_filter :thread_with_api_token, :only => :welcome - around_filter :thread_with_optional_api_token, :only => :welcome + skip_around_filter :thread_with_mandatory_api_token, :only => :welcome def welcome if current_user - redirect_to home_user_path(current_user.uuid) + params[:action] = 'home' + home end end def home + @showallalerts = false @my_ssh_keys = AuthorizedKey.where(authorized_user_uuid: current_user.uuid) # @my_vm_perms = Link.where(tail_uuid: current_user.uuid, head_kind: 'arvados#virtual_machine', link_class: 'permission', name: 'can_login') # @my_repo_perms = Link.where(tail_uuid: current_user.uuid, head_kind: 'arvados#repository', link_class: 'permission', name: 'can_write') + + @my_tag_links = {} + @my_jobs = Job. limit(10). order('created_at desc'). @@ -23,6 +27,11 @@ class UsersController < ApplicationController order('created_at desc'). where(created_by: current_user.uuid) + Link.limit(1000).where(head_uuid: @my_collections.collect(&:uuid), + link_class: 'tag').each do |link| + (@my_tag_links[link.head_uuid] ||= []) << link + end + @my_pipelines = PipelineInstance. limit(10). order('created_at desc'). @@ -44,5 +53,9 @@ class UsersController < ApplicationController @tutorial_complete = { 'Run a job' => @my_last_job } + respond_to do |f| + f.js { render template: 'users/home.js' } + f.html { render template: 'users/home' } + end end end