[ARVADOS] updated: f6f07b1856fc0aa32cdf1f96d5bdeb12e9e314ef

git at public.curoverse.com git at public.curoverse.com
Thu Apr 24 20:15:49 EDT 2014


Summary of changes:
 .../app/controllers/collections_controller.rb      |    3 +
 apps/workbench/app/controllers/users_controller.rb |   36 +++----
 .../app/views/collections/_index_tbody.html.erb    |    9 +--
 .../app/views/collections/_show_files.html.erb     |   12 ++
 .../app/views/collections/_toggle_persist.html.erb |    8 ++
 apps/workbench/app/views/users/_tables.html.erb    |  114 ++++++++++----------
 6 files changed, 99 insertions(+), 83 deletions(-)
 create mode 100644 apps/workbench/app/views/collections/_toggle_persist.html.erb

       via  f6f07b1856fc0aa32cdf1f96d5bdeb12e9e314ef (commit)
       via  919cf4c2c9f803f0cdb80619bcbf5d23b7c02d25 (commit)
       via  6c0b68255c0c66d90c0473561461d9215860f018 (commit)
       via  9e97504e5f65c8a3a6f1f34da678ac7e1828e8e1 (commit)
       via  62db3393df8d6bc7c48a3c5101468361cb2f3cf3 (commit)
       via  e062efe37ddf066af1c5c762b126bb72766fee25 (commit)
      from  20334fa95bb7d554c09225c02fae3d4e83c6c6c5 (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 f6f07b1856fc0aa32cdf1f96d5bdeb12e9e314ef
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 24 20:15:48 2014 -0400

    Untabify.

diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index 53e5117..ed38429 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -17,36 +17,36 @@
         </colgroup>
 
         <tr>
-	  <th>Script</th>
-	  <th>Output</th>
-	  <th>Log</th>
-	  <th>Age</th>
-	  <th>Status</th>
-	  <th>Progress</th>
-	</tr>
+          <th>Script</th>
+          <th>Output</th>
+          <th>Log</th>
+          <th>Age</th>
+          <th>Status</th>
+          <th>Progress</th>
+        </tr>
 
         <% @my_jobs[0..6].each do |j| %>
           <tr>
             <td>
               <small>
-		<%= link_to((j.script.andand[0..31] || j.uuid), job_path(j.uuid)) %>
+                <%= link_to((j.script.andand[0..31] || j.uuid), job_path(j.uuid)) %>
               </small>
             </td>
 
-	    <td>
-	      <small>
-		<% if j.success and j.output %>
+            <td>
+              <small>
+                <% if j.success and j.output %>
 
-		  <a href="<%= collection_path(j.output) %>">
-		    <% Collection.limit(1).where(uuid: j.output).each do |c| %>
-			 <% c.files.each do |file| %>
-		      <%= file[0] == '.' ? file[1] : "#{file[0]}/#{file[1]}" %>
-		    <% end %>
-		<% end %>
-		</a>
+                  <a href="<%= collection_path(j.output) %>">
+                    <% Collection.limit(1).where(uuid: j.output).each do |c| %>
+                         <% c.files.each do |file| %>
+                      <%= file[0] == '.' ? file[1] : "#{file[0]}/#{file[1]}" %>
+                    <% end %>
+                <% end %>
+                </a>
 
-	<% end %>
-	</small>
+        <% end %>
+        </small>
 </td>
 
 <td>
@@ -103,24 +103,24 @@
       </colgroup>
 
       <tr>
-	<th>Instance</th>
-	<th>Template</th>
-	<th>Age</th>
-	<th>Status</th>
-	<th>Progress</th>
+        <th>Instance</th>
+        <th>Template</th>
+        <th>Age</th>
+        <th>Status</th>
+        <th>Progress</th>
       </tr>
 
       <% @my_pipelines[0..6].each do |p| %>
         <tr>
           <td>
             <small>
-	      <%= link_to_if_arvados_object p.uuid, friendly_name: true %>
+              <%= link_to_if_arvados_object p.uuid, friendly_name: true %>
             </small>
           </td>
 
           <td>
             <small>
-	      <%= link_to_if_arvados_object p.pipeline_template_uuid, friendly_name: true %>
+              <%= link_to_if_arvados_object p.pipeline_template_uuid, friendly_name: true %>
             </small>
           </td>
 
@@ -185,11 +185,11 @@
         <tr>
           <td>
             <small>
-	      <a href="<%= collection_path(c.uuid) %>">
-		<% c.files.each do |file| %>
-		  <%= file[0] == '.' ? file[1] : "#{file[0]}/#{file[1]}" %>
-		<% end %>
-	      </a>
+              <a href="<%= collection_path(c.uuid) %>">
+                <% c.files.each do |file| %>
+                  <%= file[0] == '.' ? file[1] : "#{file[0]}/#{file[1]}" %>
+                <% end %>
+              </a>
             </small>
           </td>
           <td>
@@ -222,19 +222,19 @@
     <div class="col-sm-8">
       <h2>Welcome to Arvados, <%= current_user.first_name %>!</h2>
       <div class="well">
-	<p>
-	  Your account must be activated by an Arvados administrator.  If this
-	  is your first time accessing Arvados and would like to request
-	  access, or you believe you are seeing the page in error, please
-	  <%= link_to "contact us", Rails.configuration.activation_contact_link %>.
-	  You should receive an email at the address you used to log in when
-	  your account is activated.  In the mean time, you can
-	  <%= link_to "learn more about Arvados", "https://arvados.org/projects/arvados/wiki/Introduction_to_Arvados" %>,
-	  and <%= link_to "read the Arvados user guide", "http://doc.arvados.org/user" %>.
-	</p>
-	<p style="padding-bottom: 1em">
-	  <%= link_to raw('Contact us &#x2709;'),
-	      Rails.configuration.activation_contact_link, class: "pull-right btn btn-primary" %></p>
+        <p>
+          Your account must be activated by an Arvados administrator.  If this
+          is your first time accessing Arvados and would like to request
+          access, or you believe you are seeing the page in error, please
+          <%= link_to "contact us", Rails.configuration.activation_contact_link %>.
+          You should receive an email at the address you used to log in when
+          your account is activated.  In the mean time, you can
+          <%= link_to "learn more about Arvados", "https://arvados.org/projects/arvados/wiki/Introduction_to_Arvados" %>,
+          and <%= link_to "read the Arvados user guide", "http://doc.arvados.org/user" %>.
+        </p>
+        <p style="padding-bottom: 1em">
+          <%= link_to raw('Contact us &#x2709;'),
+              Rails.configuration.activation_contact_link, class: "pull-right btn btn-primary" %></p>
       </div>
     </div>
   </div>

commit 919cf4c2c9f803f0cdb80619bcbf5d23b7c02d25
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 24 20:14:28 2014 -0400

    Add persistent/cache toggle to collections table on dashboard.

diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index a3756e8..37b8470 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -102,10 +102,24 @@ class UsersController < ApplicationController
       limit(10).
       order('created_at desc').
       where(created_by: current_user.uuid)
+    collection_uuids = @my_collections.collect &:uuid
 
-    Link.limit(1000).where(head_uuid: @my_collections.collect(&:uuid),
-                           link_class: 'tag').each do |link|
-      (@my_tag_links[link.head_uuid] ||= []) << link
+    @persist_state = {}
+    collection_uuids.each do |uuid|
+      @persist_state[uuid] = 'cache'
+    end
+
+    Link.limit(1000).filter([['head_uuid', 'in', collection_uuids],
+                             ['link_class', 'in', ['tag', 'resources']]]).
+      each do |link|
+      case link.link_class
+      when 'tag'
+        (@my_tag_links[link.head_uuid] ||= []) << link
+      when 'resources'
+        if link.name == 'wants'
+          @persist_state[link.head_uuid] = 'persistent'
+        end
+      end
     end
 
     @my_pipelines = PipelineInstance.
diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index 0ea76ac..53e5117 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -169,14 +169,16 @@
     <table class="table table-bordered table-condensed table-fixedlayout">
       <colgroup>
         <col width="46%" />
-        <col width="27%" />
-        <col width="27%" />
+        <col width="24%" />
+        <col width="10%" />
+        <col width="20%" />
       </colgroup>
 
       <tr>
-	<th>Contents</th>
-	<th>Tags</th>
-	<th>Age</th>
+        <th>Contents</th>
+        <th>Tags</th>
+        <th>Age</th>
+        <th>Storage</th>
       </tr>
 
       <% @my_collections[0..6].each do |c| %>
@@ -202,6 +204,9 @@
               <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about ','~').sub(' ',' ')) if c.created_at %>
             </small>
           </td>
+          <td>
+            <%= render partial: 'collections/toggle_persist', locals: { uuid: c.uuid, current_state: @persist_state[c.uuid] } %>
+          </td>
         </tr>
       <% end %>
     </table>

commit 6c0b68255c0c66d90c0473561461d9215860f018
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 24 20:06:23 2014 -0400

    Remove unused tutorial_group and tutorial_links queries.

diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 3077c2f..a3756e8 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -113,22 +113,6 @@ class UsersController < ApplicationController
       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
-    # "Arvados Tutorials" and owned by the system user).
-    @tutorial_group = Group.where(owner_uuid: User.system.uuid,
-                                  name: 'Arvados Tutorials').first
-    if @tutorial_group
-      @tutorial_links = Link.where(tail_uuid: @tutorial_group.uuid,
-                                   link_class: 'resources',
-                                   name: 'wants')
-    else
-      @tutorial_links = []
-    end
-    @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' }

commit 9e97504e5f65c8a3a6f1f34da678ac7e1828e8e1
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 24 20:02:33 2014 -0400

    Fix s/about/~/ substitution on dashboard.

diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index 9e1c220..0ea76ac 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -67,8 +67,7 @@
 
 <td>
   <small>
-    <%= raw(distance_of_time_in_words(j.created_at, Time.now).sub('about
-','~').sub(' ',' ')) if j.created_at %>
+    <%= raw(distance_of_time_in_words(j.created_at, Time.now).sub('about ','~').sub(' ',' ')) if j.created_at %>
   </small>
 </td>
 
@@ -127,8 +126,7 @@
 
           <td>
             <small>
-	      <%= raw(distance_of_time_in_words(p.created_at, Time.now).sub('about
-','~').sub(' ',' ')) if p.created_at %>
+              <%= raw(distance_of_time_in_words(p.created_at, Time.now).sub('about ','~').sub(' ',' ')) if p.created_at %>
             </small>
           </td>
 
@@ -201,8 +199,7 @@
           </td>
           <td>
             <small>
-	      <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about
-','~').sub(' ',' ')) if c.created_at %>
+              <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about ','~').sub(' ',' ')) if c.created_at %>
             </small>
           </td>
         </tr>

commit 62db3393df8d6bc7c48a3c5101468361cb2f3cf3
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 24 19:52:09 2014 -0400

    Add persistent/cache toggle to collections#show page.

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index bed09d3..3089a1e 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -129,6 +129,9 @@ class CollectionsController < ApplicationController
     Link.where(head_uuid: @sourcedata.keys | @output2job.keys).each do |link|
       if link.link_class == 'resources' and link.name == 'wants'
         @protected[link.head_uuid] = true
+        if link.tail_uuid == current_user.uuid
+          @is_persistent = true
+        end
       end
     end
     Link.where(tail_uuid: @sourcedata.keys).each do |link|
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index c3a2c78..4b63162 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -5,6 +5,18 @@
 }
 <% end %>
 
+<% content_for :tab_line_buttons do %>
+<div class="row">
+  <div class="col-md-6"></div>
+  <div class="col-md-6">
+    <div class="pull-right">
+      Collection storage status:
+      <%= render partial: 'toggle_persist', locals: { uuid: @object.uuid, current_state: (@is_persistent ? 'persistent' : 'cache') } %>
+    </div>
+  </div>
+</div>
+<% end %>
+
 <table class="table table-condensed table-fixedlayout">
   <colgroup>
     <col width="4%" />

commit e062efe37ddf066af1c5c762b126bb72766fee25
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Apr 24 19:22:33 2014 -0400

    Move persistent/cache toggle into a partial.

diff --git a/apps/workbench/app/views/collections/_index_tbody.html.erb b/apps/workbench/app/views/collections/_index_tbody.html.erb
index b2b5b23..207ae13 100644
--- a/apps/workbench/app/views/collections/_index_tbody.html.erb
+++ b/apps/workbench/app/views/collections/_index_tbody.html.erb
@@ -28,14 +28,7 @@
   </td>
   <td>
     <% current_state = @collection_info[c.uuid][:wanted_by_me] ? 'persistent' : 'cache' %>
-    <div class="btn-group btn-group-xs toggle-persist fill" data-toggle="buttons" data-remote-href="<%= set_persistent_collection_path(id: c.uuid) %>" data-persistent-state="<%= current_state %>">
-      <label class="btn btn-info <%= 'active' if current_state=='persistent' %>">
-        <input type="radio" name="wants" value="persistent">Persistent
-      </label>
-      <label class="btn btn-info <%= 'active' if current_state=='cache' %>">
-        <input type="radio" name="wants" value="cache">Cache
-      </label>
-    </div>
+    <%= render partial: 'toggle_persist', locals: { uuid: c.uuid, current_state: current_state } %>
   </td>
   <td class="add-tag-button">
     <a class="btn btn-xs btn-info add-tag-button pull-right" data-remote-href="<%= url_for(controller: 'links', action: 'create') %>" data-remote-method="post"><i class="glyphicon glyphicon-plus"></i> Add</a>
diff --git a/apps/workbench/app/views/collections/_toggle_persist.html.erb b/apps/workbench/app/views/collections/_toggle_persist.html.erb
new file mode 100644
index 0000000..eaca3f4
--- /dev/null
+++ b/apps/workbench/app/views/collections/_toggle_persist.html.erb
@@ -0,0 +1,8 @@
+<div class="btn-group btn-group-xs toggle-persist fill" data-toggle="buttons" data-remote-href="<%= set_persistent_collection_path(id: uuid) %>" data-persistent-state="<%= current_state %>">
+  <label class="btn btn-info <%= 'active' if current_state=='persistent' %>">
+    <input type="radio" name="wants" value="persistent">Persistent
+  </label>
+  <label class="btn btn-info <%= 'active' if current_state=='cache' %>">
+    <input type="radio" name="wants" value="cache">Cache
+  </label>
+</div>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list