[ARVADOS] updated: 7e4cdc1969319161c8412f57e4c68692421408a4

git at public.curoverse.com git at public.curoverse.com
Mon Jan 13 17:32:42 EST 2014


Summary of changes:
 .../app/assets/stylesheets/application.css         |    6 +++++
 apps/workbench/app/controllers/users_controller.rb |    7 ++++++
 apps/workbench/app/views/users/_tables.html.erb    |   21 +++++++++++++++++++-
 3 files changed, 33 insertions(+), 1 deletions(-)

       via  7e4cdc1969319161c8412f57e4c68692421408a4 (commit)
      from  2f464437d84aaccd5310d39e493767f93b0eab2c (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 7e4cdc1969319161c8412f57e4c68692421408a4
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Jan 13 13:48:33 2014 -0800

    Add collection search box on home page.
    
    refs #1499

diff --git a/apps/workbench/app/assets/stylesheets/application.css b/apps/workbench/app/assets/stylesheets/application.css
index eca9be8..9c67653 100644
--- a/apps/workbench/app/assets/stylesheets/application.css
+++ b/apps/workbench/app/assets/stylesheets/application.css
@@ -69,3 +69,9 @@ table.table-fixedlayout td {
 table.table-smallcontent td {
     font-size: 85%;
 }
+form input.search-mini {
+    padding: 0 6px;
+}
+form.small-form-margin {
+    margin-bottom: 2px;
+}
diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 89d336f..f9a74e2 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -15,6 +15,8 @@ class UsersController < ApplicationController
     # @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').
@@ -25,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').
diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index 6e740df..bcbf3d7 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -140,17 +140,29 @@
 <div>
   <strong>Recent collections</strong>
   <%= link_to raw("Show all collections →"), collections_path, class: 'pull-right' %>
+  <div class="pull-right" style="padding-right: 1em">
+    <%= form_tag collections_path,
+          method: 'get',
+          class: 'form-search small-form-margin' do %>
+    <div class="input-append">
+      <%= text_field_tag :search, params[:search], class: 'search-query search-mini' %>
+      <%= submit_tag "Search", name: nil, class: 'btn btn-mini btn-info' %>
+    </div>  
+    <% end %>
+  </div>
   <% if not current_user.andand.is_active or @my_collections.empty? %>
     <br/>(None)
   <% else %>
     <table class="table table-bordered table-condensed table-fixedlayout">
       <colgroup>
-        <col width="73%" />
+        <col width="46%" />
+        <col width="27%" />
         <col width="27%" />
       </colgroup>
 
       <tr>
 	<th>Contents</th>
+	<th>Tags</th>
 	<th>Age</th>
       </tr>
 
@@ -166,6 +178,13 @@
             </small>
           </td>
           <td>
+            <% if @my_tag_links[c.uuid] %>
+            <small>
+              <%= @my_tag_links[c.uuid].collect(&:name).join(", ") %>
+            </small>
+            <% end %>
+          </td>
+          <td>
             <small>
 	      <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about
 ','~').sub(' ',' ')) if c.created_at %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list