[ARVADOS] created: 3f9aa0401350fc8a41a2dce81151da4aa050e771

git at public.curoverse.com git at public.curoverse.com
Tue Jun 17 11:37:14 EDT 2014


        at  3f9aa0401350fc8a41a2dce81151da4aa050e771 (commit)


commit 3f9aa0401350fc8a41a2dce81151da4aa050e771
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Jun 17 11:37:08 2014 -0400

    2884: AJAX load a preview panel in collection and pipeline template picker.

diff --git a/apps/workbench/app/assets/javascripts/select_modal.js b/apps/workbench/app/assets/javascripts/select_modal.js
index 6e22d80..a22b990 100644
--- a/apps/workbench/app/assets/javascripts/select_modal.js
+++ b/apps/workbench/app/assets/javascripts/select_modal.js
@@ -14,6 +14,15 @@ $(document).on('click', '.selectable', function() {
         closest('.modal').
         find('[data-enable-if-selection]').
         prop('disabled', !any);
+
+    if ($this.hasClass('active')) {
+        $(".modal-dialog-preview-pane").html('<img src="/assets/ajax-loader.gif"></img>');
+        $.ajax($(this).attr('data-preview-href'),
+               {dataType: "html"}).done(function(data, status, jqxhr) {
+                   $(".modal-dialog-preview-pane").html(data);
+               });
+    }
+
 }).on('click', '.modal button[data-action-href]', function() {
     var selection = [];
     var data = [];
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index fa83714..3017be9 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -174,16 +174,20 @@ class CollectionsController < ApplicationController
         .results.any?
       @search_sharing = search_scopes
     end
-    @prov_svg = ProvenanceHelper::create_provenance_graph(@object.provenance, "provenance_svg",
-                                                          {:request => request,
-                                                            :direction => :bottom_up,
-                                                            :combine_jobs => :script_only}) rescue nil
-    @used_by_svg = ProvenanceHelper::create_provenance_graph(@object.used_by, "used_by_svg",
-                                                             {:request => request,
-                                                               :direction => :top_down,
-                                                               :combine_jobs => :script_only,
-                                                               :pdata_only => true}) rescue nil
 
+    if params["tab_pane"] == "Provenance_graph"
+      @prov_svg = ProvenanceHelper::create_provenance_graph(@object.provenance, "provenance_svg",
+                                                            {:request => request,
+                                                              :direction => :bottom_up,
+                                                              :combine_jobs => :script_only}) rescue nil
+    end
+    if params["tab_pane"] == "Used_by"
+      @used_by_svg = ProvenanceHelper::create_provenance_graph(@object.used_by, "used_by_svg",
+                                                               {:request => request,
+                                                                 :direction => :top_down,
+                                                                 :combine_jobs => :script_only,
+                                                                 :pdata_only => true}) rescue nil
+    end
     super
   end
 
diff --git a/apps/workbench/app/views/application/_choose.html.erb b/apps/workbench/app/views/application/_choose.html.erb
index c42adac..5c2aa96 100644
--- a/apps/workbench/app/views/application/_choose.html.erb
+++ b/apps/workbench/app/views/application/_choose.html.erb
@@ -15,9 +15,13 @@
             </div>
           </div>
         </div>
-        <div class="container-fluid arv-filterable-list selectable-container" style="height: 20em; overflow-y: scroll" data-infinite-scroller="#choose-scroll" id="choose-scroll" data-infinite-content-href="<%= @next_page_href %>">
+
+        <div class="row" style="height: 20em">
+          <div class="col-sm-6 container-fluid arv-filterable-list selectable-container" style="height: 100%; overflow-y: scroll" data-infinite-scroller="#choose-scroll" id="choose-scroll" data-infinite-content-href="<%= @next_page_href %>">
           <%= render partial: 'choose_rows', locals: {multiple: multiple} %>
-        </div>
+          </div>
+          <div class="col-sm-6 modal-dialog-preview-pane" style="height: 100%; overflow-y: scroll">
+          </div>
       </div>
 
       <div class="modal-footer">
diff --git a/apps/workbench/app/views/collections/_choose_rows.html.erb b/apps/workbench/app/views/collections/_choose_rows.html.erb
index 650a8c8..d87f56f 100644
--- a/apps/workbench/app/views/collections/_choose_rows.html.erb
+++ b/apps/workbench/app/views/collections/_choose_rows.html.erb
@@ -1,17 +1,13 @@
 <% @name_links.each do |name_link| %>
   <% if (object = get_object(name_link.head_uuid)) %>
-    <div class="row filterable selectable <%= 'multiple' if multiple %>" data-object-uuid="<%= name_link.uuid %>">
-      <div class="col-sm-12" style="overflow-x:hidden">
+    <div class="row filterable selectable <%= 'multiple' if multiple %>" data-object-uuid="<%= name_link.uuid %>"
+         data-preview-href="<%= url_for object %>?tab_pane=chooser_preview"
+         style="margin-left: 1em; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #DDDDDD">
         <i class="fa fa-fw fa-archive"></i>
         <%= name_link.name %>
-      </div>
-      <div class="col-sm-11 col-sm-push-1" style="overflow-x: hidden">
-        <%= render_controller_partial(
-            'show_object_description_cell.html',
-            controller_name: 'collections',
-            locals: {object: object})
-            %>
-      </div>
+    <% Link.filter([['link_class','=','tag'],['head_uuid','=',object.uuid]]).collect(&:name).each do |tagname| %>
+      <span class="label label-info"><%= tagname %></span>
+    <% end %>
     </div>
   <% end %>
 <% end %>
diff --git a/apps/workbench/app/views/collections/_show_chooser_preview.html.erb b/apps/workbench/app/views/collections/_show_chooser_preview.html.erb
new file mode 100644
index 0000000..4477357
--- /dev/null
+++ b/apps/workbench/app/views/collections/_show_chooser_preview.html.erb
@@ -0,0 +1,2 @@
+<%= render partial: "show_source_summary" %>
+<%= render partial: "show_files" %>
diff --git a/apps/workbench/app/views/collections/_show_object_description_cell.html.erb b/apps/workbench/app/views/collections/_show_object_description_cell.html.erb
deleted file mode 100644
index 1f1325d..0000000
--- a/apps/workbench/app/views/collections/_show_object_description_cell.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-<div class="nowrap">
-  <span class="deemphasize">
-    Files (<%= human_readable_bytes_html(object.total_bytes) %>):
-  </span><span class="arvados-filename">
-    <% object.files.each do |path, file, size| %>
-      <%= file %>
-    <% end %>
-  </span>
-  <div>
-    <% Link.filter([['link_class','=','tag'],['head_uuid','=',object.uuid]]).collect(&:name).each do |tagname| %>
-      <span class="label label-info"><%= tagname %></span>
-    <% end %>
-  </div>
-</div>
diff --git a/apps/workbench/app/views/collections/_show_source_summary.html.erb b/apps/workbench/app/views/collections/_show_source_summary.html.erb
new file mode 100644
index 0000000..e3f2995
--- /dev/null
+++ b/apps/workbench/app/views/collections/_show_source_summary.html.erb
@@ -0,0 +1,21 @@
+<% if not (@output_of.andand.any? or @log_of.andand.any?) %>
+  <p><i>No source information available.</i></p>
+<% end %>
+
+<% if @output_of.andand.any? %>
+  <p><i>This collection was the output of:</i><br />
+    <%= render_arvados_object_list_start(@output_of, 'Show all jobs',
+                                         jobs_path(filters: [['output', '=', @object.uuid]].to_json)) do |job| %>
+      <%= link_to_if_arvados_object(job, friendly_name: true) %><br />
+    <% end %>
+  </p>
+<% end %>
+
+<% if @log_of.andand.any? %>
+  <p><i>This collection contains log messages from:</i><br />
+    <%= render_arvados_object_list_start(@log_of, 'Show all jobs',
+                                         jobs_path(filters: [['log', '=', @object.uuid]].to_json)) do |job| %>
+      <%= link_to_if_arvados_object(job, friendly_name: true) %><br />
+    <% end %>
+  </p>
+<% end %>
diff --git a/apps/workbench/app/views/collections/show.html.erb b/apps/workbench/app/views/collections/show.html.erb
index 1097951..a51c450 100644
--- a/apps/workbench/app/views/collections/show.html.erb
+++ b/apps/workbench/app/views/collections/show.html.erb
@@ -11,27 +11,7 @@
 	<p><i>Content hash:</i><br />
 	  <span class="arvados-uuid"><%= @object.uuid %></span></p>
 
-        <% if not (@output_of.andand.any? or @log_of.andand.any?) %>
-          <p><i>No source information available.</i></p>
-        <% end %>
-
-        <% if @output_of.andand.any? %>
-          <p><i>This collection was the output of:</i><br />
-          <%= render_arvados_object_list_start(@output_of, 'Show all jobs',
-                jobs_path(filters: [['output', '=', @object.uuid]].to_json)) do |job| %>
-            <%= link_to_if_arvados_object(job, friendly_name: true) %><br />
-          <% end %>
-          </p>
-        <% end %>
-
-        <% if @log_of.andand.any? %>
-          <p><i>This collection contains log messages from:</i><br />
-          <%= render_arvados_object_list_start(@log_of, 'Show all jobs',
-                jobs_path(filters: [['log', '=', @object.uuid]].to_json)) do |job| %>
-            <%= link_to_if_arvados_object(job, friendly_name: true) %><br />
-          <% end %>
-          </p>
-        <% end %>
+        <%= render partial: "show_source_summary" %>
       </div>
     </div>
   </div>
diff --git a/apps/workbench/app/views/pipeline_templates/_choose_rows.html.erb b/apps/workbench/app/views/pipeline_templates/_choose_rows.html.erb
index 6ffd6ae..5cec682 100644
--- a/apps/workbench/app/views/pipeline_templates/_choose_rows.html.erb
+++ b/apps/workbench/app/views/pipeline_templates/_choose_rows.html.erb
@@ -1,5 +1,5 @@
 <% @objects.each do |object| %>
-  <div class="row filterable selectable <%= 'multiple' if multiple %>" data-object-uuid="<%= object.uuid %>">
+  <div class="row filterable selectable <%= 'multiple' if multiple %>" data-object-uuid="<%= object.uuid %>" data-preview-href="<%= url_for object %>?tab_pane=Components">
     <div class="col-sm-12" style="overflow-x:hidden">
       <i class="fa fa-fw fa-gear"></i>
       <%= object.name %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list