<% if @object.state == 'Final' %>
- <%= link_to(copy_container_request_path('id' => @object.uuid, 'no_reuse' => true),
- class: 'btn btn-sm btn-primary',
- data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it without container reuse',
- method: :post,
- ) do %>
- <i class="fa fa-fw fa-play"></i> Re-run without reuse
- <% end %>
- <%= link_to(copy_container_request_path('id' => @object.uuid),
- class: 'btn btn-sm btn-primary',
- data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it',
- method: :post,
- ) do %>
- <i class="fa fa-fw fa-play"></i> Re-run
- <% end %>
+ <%= 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">
+ <div class="modal-dialog">
+ <div class="modal-content">
+
+ <%= 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">×</button>
+ <div>
+ <div class="col-sm-6"> <h4 class="modal-title">Re-run container request</h4> </div>
+ </div>
+ <br/>
+ </div>
+
+ <div class="modal-body">
+ <%= check_box_tag(:no_reuse, "true", false) %>
+ <%= label_tag(:script_use_latest, "Disable container reuse") %>
+ </div>
+
+ <div class="modal-footer">
+ <button class="btn btn-default" onClick="reset_form()" 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>
+
+ </div>
+ <% end %>
+ </div>
+</div>
assert_select 'Download the log', false
end
- test "completed container request offers re-run options" do
+ test "completed container request offers re-run option" do
use_token 'active'
uuid = api_fixture('container_requests')['completed']['uuid']
get :show, {id: uuid}, session_for(:active)
assert_response :success
- assert_includes @response.body, "href=\"/container_requests/#{uuid}/copy\""
- assert_includes @response.body, "href=\"/container_requests/#{uuid}/copy?no_reuse=true\""
+ assert_includes @response.body, "action=\"/container_requests/#{uuid}/copy\""
end
test "container request copy" do