blob: dad7e82c37404a2575570260a1d15f5aadd6abb9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
<div class="space-y-4">
<h1 class="text-xl"><%= @run.title %></h1>
<p class="subtitle">New checkpoint</p>
<%= form_with model: [@run, @checkpoint], class: "space-y-4" do |f| %>
<div>
<div><%= f.label :comment %></div>
<%= f.text_area :comment %>
</div>
<% unless @run.checked_in? %>
<div>
<div><%= f.label :save_file %></div>
<%= f.file_field :save_file %>
</div>
<% end %>
<div>
<div>
<%= f.radio_button :kind, "comment" %>
<%= f.label :kind_comment, "I'm just leaving a comment" %>
</div>
<% if @run.checked_in? %>
<div>
<%= 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" %>
</div>
<% elsif @run.checked_out_user == current_user %>
<div>
<%= f.radio_button :kind, "checkin" %>
<%= f.label :kind_checkin, "I'm checking in this save file so another trainer can play it" %>
</div>
<% end %>
</div>
<div>
<%= f.submit "Save checkpoint", class: "btn-primary" %>
</div>
<% if @checkpoint.errors.any? %>
<div>
<p><%= pluralize(@checkpoint.errors.count, "error") %> prohibited this checkpoint from being saved:</p>
<ul>
<% @checkpoint.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<% end %>
</div>
|