Account status is now part of the "notifications" area
[arvados.git] / apps / workbench / app / controllers / users_controller.rb
index e15dc23559361af08cee6026d8e9175d9275c90d..89d336f5e9826c2247b39796d6bf3aaed1560f7d 100644 (file)
@@ -1,23 +1,35 @@
 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
 
   def welcome
     if current_user
       redirect_to home_user_path(current_user.uuid)
-    else
-      redirect_to $arvados_api_client.arvados_login_url(return_to: request.url)
     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_last_job = Job.
-      limit(1).
-      order(:created_at).
-      where(created_by: current_user.uuid).
-      last
+    # @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_jobs = Job.
+      limit(10).
+      order('created_at desc').
+      where(created_by: current_user.uuid)
+
+    @my_collections = Collection.
+      limit(10).
+      order('created_at desc').
+      where(created_by: current_user.uuid)
+
+    @my_pipelines = PipelineInstance.
+      limit(10).
+      order('created_at desc').
+      where(created_by: current_user.uuid)
+
 
     # A Tutorial is a Link which has link_class "resources" and name
     # "wants", and is owned by the Tutorials Group (i.e., named