[ARVADOS] updated: 885a37384af5c3252f81518e6bcedc2abf50489b

git at public.curoverse.com git at public.curoverse.com
Mon Jun 2 03:16:25 EDT 2014


Summary of changes:
 .../app/controllers/application_controller.rb      |  8 ++++++++
 .../folders/_index_jobs_and_pipelines.html.erb     | 21 +++++++++++++++++++++
 apps/workbench/app/views/folders/index.html.erb    | 22 ++++++++++++++++++++++
 apps/workbench/config/routes.rb                    |  2 +-
 4 files changed, 52 insertions(+), 1 deletion(-)
 create mode 100644 apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb

       via  885a37384af5c3252f81518e6bcedc2abf50489b (commit)
      from  06f5f794cd1fc8cb4dbf72e3a2fbc440b44101b9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 885a37384af5c3252f81518e6bcedc2abf50489b
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jun 2 03:16:08 2014 -0400

    2872: Add recent jobs and pipelines to folder index, use as root url.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index c1e82eb..4347b9b 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -496,6 +496,14 @@ class ApplicationController < ActionController::Base
     end
   end
 
+  helper_method :recent_jobs_and_pipelines
+  def recent_jobs_and_pipelines
+    (Job.limit(10) | PipelineInstance.limit(10)).
+      sort_by do |x|
+      x.finished_at || x.started_at || x.created_at rescue x.created_at
+    end
+  end
+
   helper_method :get_object
   def get_object uuid
     if @get_object.nil? and @objects
diff --git a/apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb b/apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb
new file mode 100644
index 0000000..fb688b4
--- /dev/null
+++ b/apps/workbench/app/views/folders/_index_jobs_and_pipelines.html.erb
@@ -0,0 +1,21 @@
+<div class="container-fluid">
+  <% recent_jobs_and_pipelines[0..9].each do |object| %>
+    <% any = true %>
+    <div class="row">
+      <div class="col-sm-4">
+        <%= render :partial => "show_object_button", :locals => {object: object, size: 'xs'} %>
+        <%= render_editable_attribute object, 'name', nil %>
+      </div>
+      <div class="col-sm-8 arv-description-in-table">
+        <%= render_controller_partial(
+            'show_object_description_cell.html',
+            controller_name: object.controller_name,
+            locals: {object: object})
+            %>
+      </div>
+    </div>
+  <% end %>
+  <% if not defined? any %>
+    <span class="deemphasize">No jobs or pipelines to display.</span>
+  <% end %>
+</div>
diff --git a/apps/workbench/app/views/folders/index.html.erb b/apps/workbench/app/views/folders/index.html.erb
index 7666e54..5197f84 100644
--- a/apps/workbench/app/views/folders/index.html.erb
+++ b/apps/workbench/app/views/folders/index.html.erb
@@ -54,4 +54,26 @@
       </div>
     </div>
   </div>
+  <div class="row">
+    <div class="col-sm-12">
+      <div class="panel panel-default">
+        <div class="panel-heading">
+          <div class="pull-right">
+            <%= link_to jobs_path, class: 'btn btn-default btn-xs' do %>
+              All jobs <i class="fa fa-fw fa-arrow-circle-right"></i>
+            <% end %>
+            <%= link_to pipeline_instances_path, class: 'btn btn-default btn-xs' do %>
+              All pipelines <i class="fa fa-fw fa-arrow-circle-right"></i>
+            <% end %>
+          </div>
+          <h3 class="panel-title">
+            Recent jobs and pipelines
+          </h3>
+        </div>
+        <div class="panel-body">
+          <%= render partial: 'index_jobs_and_pipelines' %>
+        </div>
+      </div>
+    </div>
+  </div>
 </div>
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index a28cc69..94e2a11 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -62,7 +62,7 @@ ArvadosWorkbench::Application.routes.draw do
   post 'actions' => 'actions#post'
   get 'websockets' => 'websocket#index'
 
-  root :to => 'users#welcome'
+  root :to => 'folders#index'
 
   # Send unroutable requests to an arbitrary controller
   # (ends up at ApplicationController#render_not_found)

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list