Added empty sharing popup.
authorPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 6 May 2014 18:52:54 +0000 (14:52 -0400)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Tue, 6 May 2014 18:52:54 +0000 (14:52 -0400)
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/views/collections/_sharing_popup.html.erb [new file with mode: 0644]
apps/workbench/app/views/collections/_show_files.html.erb
apps/workbench/app/views/collections/sharing_popup.js.erb [new file with mode: 0644]
apps/workbench/config/routes.rb

index 4178e38361b7481903df9743535d6a2c23818b90..ce72d6201ed55c4a9d035f69390b07c98d5b893d 100644 (file)
@@ -171,6 +171,13 @@ class CollectionsController < ApplicationController
     end
   end
 
+  def sharing_popup
+    respond_to do |format|
+      format.html
+      format.js
+    end
+  end
+
   protected
 
   def find_usable_token
diff --git a/apps/workbench/app/views/collections/_sharing_popup.html.erb b/apps/workbench/app/views/collections/_sharing_popup.html.erb
new file mode 100644 (file)
index 0000000..b19cb6f
--- /dev/null
@@ -0,0 +1,10 @@
+<div class="modal-dialog">
+  <div class="modal-content">
+    <div class="modal-header">
+      <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
+      <h4 class="modal-title">Sharing</h4>
+    </div>
+    <div class="modal-body">
+    </div>
+  </div>
+</div>
index 4b63162be0550f32a4e74ca636739fc27149b286..371493d9d2c522accf6dd18905bfd5ff0a0cc97f 100644 (file)
   <div class="col-md-6"></div>
   <div class="col-md-6">
     <div class="pull-right">
-      Collection storage status:
+      <%= link_to "Share", sharing_popup_collection_url(id: @object.uuid),  {class: 'btn btn-primary', :remote => true, 'data-toggle' =>  "modal", 'data-target' => '#collection-sharing-modal-window'}  %>
+      <span style="padding-left: 1em">Collection storage status:</span>
       <%= render partial: 'toggle_persist', locals: { uuid: @object.uuid, current_state: (@is_persistent ? 'persistent' : 'cache') } %>
+
     </div>
   </div>
 </div>
@@ -73,3 +75,7 @@
     <% end; end %>
   </tbody>
 </table>
+
+<% content_for :footer_html do %>
+<div id="collection-sharing-modal-window" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"></div>
+<% end %>
diff --git a/apps/workbench/app/views/collections/sharing_popup.js.erb b/apps/workbench/app/views/collections/sharing_popup.js.erb
new file mode 100644 (file)
index 0000000..fea8593
--- /dev/null
@@ -0,0 +1 @@
+$("#collection-sharing-modal-window").html("<%= escape_javascript(render partial: 'sharing_popup') %>");
index e8862c24267846a461708d9f43f1162df0e4dbfc..cd9489e53f9139b9f69bab631ef2804f70686ef4 100644 (file)
@@ -42,6 +42,7 @@ ArvadosWorkbench::Application.routes.draw do
   match '/collections/graph' => 'collections#graph'
   resources :collections do
     post 'set_persistent', on: :member
+    get 'sharing_popup', :on => :member
   end
   get '/collections/:uuid/*file' => 'collections#show_file', :format => false
   resources :folders do