Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / views / container_requests / _extra_tab_line_buttons.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <% if @object.state == 'Final' %>
6 <script type="application/javascript">
7   function reset_form_cr_reuse() {
8     $('#use_existing').removeAttr('checked');
9   }
10 </script>
11
12   <%= link_to raw('<i class="fa fa-fw fa-play"></i> Re-run...'),
13       "#",
14       {class: 'btn btn-sm btn-primary', 'data-toggle' => 'modal',
15        'data-target' => '#clone-and-edit-modal-window',
16        title: 'This will make a copy and take you there. You can then make any needed changes and run it'}  %>
17
18 <div id="clone-and-edit-modal-window" class="modal fade" role="dialog"
19      aria-labelledby="myModalLabel" aria-hidden="true">
20   <div class="modal-dialog">
21     <div class="modal-content">
22
23     <%= form_tag copy_container_request_path do |f| %>
24
25       <div class="modal-header">
26         <button type="button" class="close" onClick="reset_form_cr_reuse()" data-dismiss="modal" aria-hidden="true">&times;</button>
27         <div>
28           <div class="col-sm-6"> <h4 class="modal-title">Re-run container request</h4> </div>
29         </div>
30         <br/>
31       </div>
32
33       <div class="modal-body">
34               <%= check_box_tag(:use_existing, "true", false) %>
35               <%= label_tag(:use_existing, "Enable container reuse") %>
36       </div>
37
38       <div class="modal-footer">
39         <button class="btn btn-default" onClick="reset_form_cr_reuse()" data-dismiss="modal" aria-hidden="true">Cancel</button>
40         <button type="submit" class="btn btn-primary" name="container_request[state]" value="Uncommitted">Copy and edit inputs</button>
41       </div>
42
43     </div>
44     <% end %>
45   </div>
46 </div>
47
48 <% end %>