- <%= radio_button_tag(:use_script, "latest", true) %>
- <%= label_tag(:script_use_latest, "Use latest script version") %>
- <p style="padding-left: 1em"> Use the current commit indicated by '<%=job_info['supplied_script_version']%>' in the '<%=job_info['repository']%>' repository.</p>
- <%= radio_button_tag(:use_script, "same") %>
- <%= label_tag(:script_use_same, "Use same script version as this run") %>
- <p style="padding-left: 1em"> Use the same script version as the current job.</p>
- <input type="hidden" name="job_info" value="<%=job_info.to_json%>">
+ <% if (@job.supplied_script_version.blank? or
+ (@job.supplied_script_version == @job.script_version)) %>
+ <%= f.hidden_field(:script_version) %>
+ <% else %>
+ <%= f.radio_button("script_version", @job.script_version) %>
+ <%= f.label(:script_version, "Use same script version as this run", value: @job.script_version) %>
+ <p style="padding-left: 1em"> Use the same script version as the current job.</p>
+
+ <%= f.radio_button(:script_version, @job.supplied_script_version) %>
+ <%= f.label(:script_version, "Use latest script version", value: @job.supplied_script_version) %>
+ <p style="padding-left: 1em"> Use the current commit indicated by '<%= @job.supplied_script_version %>' in the '<%= @job.repository %>' repository.</p>
+ <% end %>