11580: add container_requests index page
[arvados.git] / apps / workbench / app / views / container_requests / _extra_tab_line_buttons.html.erb
index fc810b1525cc36db630a9c0086d1fb355bdbc408..049be759beed84778bf4bf35bb474f3e83e7a0cd 100644 (file)
@@ -1,10 +1,15 @@
 <% if @object.state == 'Final' %>
-  <%= link_to raw('<i class="fa fa-fw fa-play"></i> Re-run'),
+<script type="application/javascript">
+  function reset_form_cr_reuse() {
+    $('#use_existing').removeAttr('checked');
+  }
+</script>
+
+  <%= link_to raw('<i class="fa fa-fw fa-play"></i> Re-run...'),
       "#",
       {class: 'btn btn-sm btn-primary', 'data-toggle' => 'modal',
        'data-target' => '#clone-and-edit-modal-window',
        title: 'This will make a copy and take you there. You can then make any needed changes and run it'}  %>
-<% end %>
 
 <div id="clone-and-edit-modal-window" class="modal fade" role="dialog"
      aria-labelledby="myModalLabel" aria-hidden="true">
@@ -14,7 +19,7 @@
     <%= form_tag copy_container_request_path do |f| %>
 
       <div class="modal-header">
-        <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">&times;</button>
+        <button type="button" class="close" onClick="reset_form_cr_reuse()" data-dismiss="modal" aria-hidden="true">&times;</button>
         <div>
           <div class="col-sm-6"> <h4 class="modal-title">Re-run container request</h4> </div>
         </div>
@@ -27,7 +32,7 @@
       </div>
 
       <div class="modal-footer">
-        <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
+        <button class="btn btn-default" onClick="reset_form_cr_reuse()" data-dismiss="modal" aria-hidden="true">Cancel</button>
         <button type="submit" class="btn btn-primary" name="container_request[state]" value="Uncommitted">Copy and edit inputs</button>
       </div>
 
@@ -35,3 +40,5 @@
     <% end %>
   </div>
 </div>
+
+<% end %>