[ARVADOS] updated: 498f3130928f58e830be3abe74b20d06904af3cd

git at public.curoverse.com git at public.curoverse.com
Thu Sep 4 10:56:52 EDT 2014


Summary of changes:
 apps/workbench/app/assets/javascripts/selection.js |   5 +
 .../app/controllers/actions_controller.rb          |   8 +-
 .../app/views/collections/_show_files.html.erb     | 141 ++++++++++++---------
 .../app/views/collections/_show_recent.html.erb    |  95 ++++++++------
 4 files changed, 153 insertions(+), 96 deletions(-)

       via  498f3130928f58e830be3abe74b20d06904af3cd (commit)
      from  33710e325a775d8f52ce89ce365b4a5153a68b18 (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 498f3130928f58e830be3abe74b20d06904af3cd
Author: radhika <radhika at curoverse.com>
Date:   Thu Sep 4 10:55:12 2014 -0400

    3654: add selection dropdown to collections pages

diff --git a/apps/workbench/app/assets/javascripts/selection.js b/apps/workbench/app/assets/javascripts/selection.js
index c82b6ef..fe62700 100644
--- a/apps/workbench/app/assets/javascripts/selection.js
+++ b/apps/workbench/app/assets/javascripts/selection.js
@@ -217,6 +217,11 @@ function enable_disable_selection_actions() {
         toggleClass('disabled',
                     ($checked.filter('[value*=-j7d0g-]').length > 0) ||
                     ($checked.length < 1));
+    $('[data-selection-action=combine]').
+        closest('li').
+        toggleClass('disabled',
+                    ($checked.filter('[value*=-4zz18-]').length < 1) ||
+                    ($checked.length != $checked.filter('[value*=-4zz18-]').length));
 }
 
 $(document).
diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb
index fcca2ab..7c68ce9 100644
--- a/apps/workbench/app/controllers/actions_controller.rb
+++ b/apps/workbench/app/controllers/actions_controller.rb
@@ -164,7 +164,13 @@ class ActionsController < ApplicationController
       l.save!
     end
 
-    redirect_to controller: 'collections', action: :show, id: newc.uuid
+    if params["show_project"]
+      respond_to do |format|
+        format.js {render inline: "location.reload();" }
+      end
+    else
+      redirect_to controller: 'collections', action: :show, id: newc.uuid
+    end
   end
 
   def report_issue_popup
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index d888b2e..6cd9925 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -1,62 +1,87 @@
-<% file_tree = @object.andand.files_tree %>
-<% if file_tree.nil? or file_tree.empty? %>
-  <p>This collection is empty.</p>
-<% else %>
-  <ul id="collection_files" class="collection_files">
-  <% dirstack = [file_tree.first.first] %>
-  <% file_tree.each_with_index do |(dirname, filename, size), index| %>
-    <% file_path = CollectionsHelper::file_path([dirname, filename]) %>
-    <% while dirstack.any? and (dirstack.last != dirname) %>
-      <% dirstack.pop %></ul></li>
-    <% end %>
-    <li>
-    <% if size.nil?  # This is a subdirectory. %>
-      <% dirstack.push(File.join(dirname, filename)) %>
-      <div class="collection_files_row">
-       <div class="collection_files_name"><i class="fa fa-fw fa-folder-open"></i> <%= filename %></div>
+<div class="selection-action-container" style="padding-left: 1em">
+  <div class="row">
+    <div class="pull-left">
+      <div class="btn-group btn-group-sm">
+        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
+        <ul class="dropdown-menu" role="menu">
+          <li><%= link_to "Combine selections into a new collection", '/combine_selected',
+                  'data-href' => url_for('/combine_selected'),
+                  'data-selection-param-name' => 'selection[]',
+                  'data-selection-action' => 'combine',
+                  'data-remote' => true,
+                  'data-toggle' => 'dropdown'
+            %></li>
+        </ul>
       </div>
-      <ul class="collection_files">
-    <% else %>
-      <% link_params = {controller: 'collections', action: 'show_file',
-                        uuid: @object.portable_data_hash, file: file_path, size: size} %>
-       <div class="collection_files_row">
-        <div class="collection_files_buttons pull-right">
-          <%= raw(human_readable_bytes_html(size)) %>
-          <% if !defined? no_checkboxes or !no_checkboxes %>
-          <%= check_box_tag 'uuids[]', "#{@object.uuid}/#{file_path}", false, {
-                :class => 'persistent-selection',
-                :friendly_type => "File",
-                :friendly_name => "#{@object.uuid}/#{file_path}",
-                :href => url_for(controller: 'collections', action: 'show_file',
-                                 uuid: @object.portable_data_hash, file: file_path),
-                :title => "Include #{file_path} in your selections",
-              } %>
-          <% end %>
-          <%= link_to(raw('<i class="fa fa-search"></i>'),
-                      link_params.merge(disposition: 'inline'),
-                      {title: "View #{file_path}", class: "btn btn-info btn-sm"}) %>
-          <%= link_to(raw('<i class="fa fa-download"></i>'),
-                      link_params.merge(disposition: 'attachment'),
-                      {title: "Download #{file_path}", class: "btn btn-info btn-sm"}) %>
-        </div>
-      <% if CollectionsHelper::is_image(filename) %>
-        <div class="collection_files_name"><i class="fa fa-fw fa-bar-chart-o"></i> <%= filename %></div>
-       </div>
-        <div class="collection_files_inline">
-          <%= link_to(image_tag("#{url_for @object}/#{file_path}"),
-                      link_params.merge(disposition: 'inline'),
-                      {title: file_path}) %>
+    </div>
+  </div>
+  <p/>
+
+  <% file_tree = @object.andand.files_tree %>
+  <% if file_tree.nil? or file_tree.empty? %>
+    <p>This collection is empty.</p>
+  <% else %>
+    <ul id="collection_files" class="collection_files">
+    <% dirstack = [file_tree.first.first] %>
+    <% file_tree.each_with_index do |(dirname, filename, size), index| %>
+      <% file_path = CollectionsHelper::file_path([dirname, filename]) %>
+      <% while dirstack.any? and (dirstack.last != dirname) %>
+        <% dirstack.pop %></ul></li>
+      <% end %>
+      <li>
+      <% if size.nil?  # This is a subdirectory. %>
+        <% dirstack.push(File.join(dirname, filename)) %>
+        <div class="collection_files_row">
+         <div class="collection_files_name"><i class="fa fa-fw fa-folder-open"></i> <%= filename %></div>
         </div>
+        <ul class="collection_files">
       <% else %>
-        <div class="collection_files_name"><i class="fa fa-fw fa-file"></i> <%= filename %></div>
-       </div>
-      <% end %>
-      </li>
-    <% end  # if file or directory %>
-  <% end  # file_tree.each %>
-  <%= raw(dirstack.map { |_| "</ul>" }.join("</li>")) %>
-<% end  # if file_tree %>
+        <% link_params = {controller: 'collections', action: 'show_file',
+                          uuid: @object.portable_data_hash, file: file_path, size: size} %>
+         <div class="collection_files_row">
+          <div class="collection_files_buttons pull-right">
+            <%= raw(human_readable_bytes_html(size)) %>
+            <%= link_to(raw('<i class="fa fa-search"></i>'),
+                        link_params.merge(disposition: 'inline'),
+                        {title: "View #{file_path}", class: "btn btn-info btn-sm"}) %>
+            <%= link_to(raw('<i class="fa fa-download"></i>'),
+                        link_params.merge(disposition: 'attachment'),
+                        {title: "Download #{file_path}", class: "btn btn-info btn-sm"}) %>
+          </div>
+
+          <div class="row pull-left">
+            <div class="col-md-1">
+              <% if !defined? no_checkboxes or !no_checkboxes %>
+              <%= check_box_tag 'uuids[]', "#{@object.uuid}/#{file_path}", false, {
+                    :class => 'persistent-selection',
+                    :friendly_type => "File",
+                    :friendly_name => "#{@object.uuid}/#{file_path}",
+                    :href => url_for(controller: 'collections', action: 'show_file',
+                                     uuid: @object.portable_data_hash, file: file_path),
+                    :title => "Include #{file_path} in your selections",
+                  } %>
+              <% end %>
+            </div>
+
+            <% if CollectionsHelper::is_image(filename) %>
+              <div class="collection_files_name col-md-9"><i class="fa fa-fw fa-bar-chart-o"></i> <%= filename %></div>
+             </div>
+                <%= link_to(image_tag("#{url_for @object}/#{file_path}"),
+                            link_params.merge(disposition: 'inline'),
+                            {title: file_path}) %>
+            <% else %>
+              <div class="collection_files_name col-md-9"><i class="fa fa-fw fa-file"></i> <%= filename %></div>
+             </div>
+            <% end %>
+          </div>
+        </li>
+      <% end  # if file or directory %>
+    <% end  # file_tree.each %>
+    <%= raw(dirstack.map { |_| "</ul>" }.join("</li>")) %>
+  <% end  # if file_tree %>
+
+  <% content_for :footer_html do %>
+  <div id="collection-sharing-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
+  <% end %>
 
-<% content_for :footer_html do %>
-<div id="collection-sharing-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
-<% end %>
+</div>
diff --git a/apps/workbench/app/views/collections/_show_recent.html.erb b/apps/workbench/app/views/collections/_show_recent.html.erb
index 54fc9f3..9573f6e 100644
--- a/apps/workbench/app/views/collections/_show_recent.html.erb
+++ b/apps/workbench/app/views/collections/_show_recent.html.erb
@@ -1,40 +1,61 @@
-<%= render partial: "paging", locals: {results: @collections, object: @object} %>
-
-<div style="padding-right: 1em">
-
-<%= form_tag do |f| %>
-
-<table id="collections-index" class="topalign table table-condensed table-fixedlayout"> <!-- table-fixed-header-row -->
-  <colgroup>
-    <col width="10%" />
-    <col width="10%" />
-    <col width="40%" />
-    <col width="10%" />
-    <col width="30%" />
-  </colgroup>
-  <thead>
-    <tr class="contain-align-left">
-      <th></th>
-      <th>uuid</th>
-      <th>contents</th>
-      <th>created at</th>
-      <th>tags</th>
-    </tr>
-  </thead>
-  <tbody>
-    <%= render partial: 'index_tbody' %>
-  </tbody>
-</table>
-
-<% end %>
+<div class="selection-action-container" style="padding-left: 1em">
+  <div class="row">
+    <div class="pull-left">
+      <div class="btn-group btn-group-sm">
+        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
+        <ul class="dropdown-menu" role="menu">
+          <li><%= link_to "Combine selections into a new collection", '/combine_selected',
+                  'data-href' => url_for('/combine_selected'),
+                  'data-selection-param-name' => 'selection[]',
+                  'data-selection-action' => 'combine',
+                  'data-remote' => true,
+                  'data-toggle' => 'dropdown'
+            %></li>
+        </ul>
+      </div>
+    </div>
+  </div>
+  <p/>
 
-</div>
+  <%= render partial: "paging", locals: {results: @collections, object: @object} %>
+
+  <div style="padding-right: 1em">
+
+  <%= form_tag do |f| %>
+
+  <table id="collections-index" class="topalign table table-condensed table-fixedlayout"> <!-- table-fixed-header-row -->
+    <colgroup>
+      <col width="10%" />
+      <col width="10%" />
+      <col width="40%" />
+      <col width="10%" />
+      <col width="30%" />
+    </colgroup>
+    <thead>
+      <tr class="contain-align-left">
+        <th></th>
+        <th>uuid</th>
+        <th>contents</th>
+        <th>created at</th>
+        <th>tags</th>
+      </tr>
+    </thead>
+    <tbody>
+      <%= render partial: 'index_tbody' %>
+    </tbody>
+  </table>
 
-<%= render partial: "paging", locals: {results: @collections, object: @object} %>
+  <% end %>
 
-<% content_for :footer_js do %>
-$(document).on('click', 'form[data-remote] input[type=submit]', function() {
-  $('table#collections-index tbody').fadeTo(200, 0.3);
-  return true;
-});
-<% end %>
+  </div>
+
+  <%= render partial: "paging", locals: {results: @collections, object: @object} %>
+
+  <% content_for :footer_js do %>
+  $(document).on('click', 'form[data-remote] input[type=submit]', function() {
+    $('table#collections-index tbody').fadeTo(200, 0.3);
+    return true;
+  });
+  <% end %>
+
+</div>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list