2411: Add copyright notices to everything.
[arvados.git] / apps / workbench / app / views / container_requests / _extra_tab_line_buttons.html.erb
index 6d5ba6422ec14553dcbf9cf767af1b7140603d62..b698c938a1d0f846779de8ba6801ae59ca9c0529 100644 (file)
@@ -1,10 +1,19 @@
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
 <% 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 +23,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>
       </div>
 
       <div class="modal-body">
-              <%= check_box_tag(:no_reuse, "true", false) %>
-              <%= label_tag(:script_use_latest, "Disable container reuse") %>
+              <%= check_box_tag(:use_existing, "true", false) %>
+              <%= label_tag(:use_existing, "Enable container reuse") %>
       </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 +44,5 @@
     <% end %>
   </div>
 </div>
+
+<% end %>