<%= @run.title %>

New checkpoint

<%= form_with model: [@run, @checkpoint], class: "space-y-4" do |f| %>
<%= f.label :comment %>
<%= f.text_area :comment %>
<% unless @run.checked_in? %>
<%= f.label :save_file %>
<%= f.file_field :save_file %>
<% end %>
<%= f.radio_button :kind, "comment" %> <%= f.label :kind_comment, "I'm just leaving a comment" %>
<% if @run.checked_in? %>
<%= f.radio_button :kind, "checkout" %> <%= f.label :kind_checkout, "I'm checking out this save file, lock the run until I check it back in" %>
<% elsif @run.checked_out_user == current_user %>
<%= f.radio_button :kind, "checkin" %> <%= f.label :kind_checkin, "I'm checking in this save file so another trainer can play it" %>
<% end %>
<%= f.submit "Save checkpoint", class: "btn-primary" %>
<% if @checkpoint.errors.any? %>

<%= pluralize(@checkpoint.errors.count, "error") %> prohibited this checkpoint from being saved:

<% end %> <% end %>