diff options
Diffstat (limited to 'app/views/checkpoints/new.html.erb')
-rw-r--r-- | app/views/checkpoints/new.html.erb | 72 |
1 files changed, 48 insertions, 24 deletions
diff --git a/app/views/checkpoints/new.html.erb b/app/views/checkpoints/new.html.erb index d122d91..712eae1 100644 --- a/app/views/checkpoints/new.html.erb +++ b/app/views/checkpoints/new.html.erb @@ -1,31 +1,55 @@ -<%= form_with model: [@run, @checkpoint] do |f| %> - <div> - <%= f.label :title %> - <%= f.text_field :title %> - </div> +<div class="space-y-4"> + <h1 class="text-xl"><%= @run.title %></h1> - <div> - <%= f.label :description %> - <%= f.text_area :description %> - </div> + <p class="subtitle">New checkpoint</p> - <div> - <%= f.label :save_file %> - <%= f.file_field :save_file %> - </div> + <%= form_with model: [@run, @checkpoint], class: "space-y-4" do |f| %> + <div> + <%= f.label :title %> + <%= f.text_field :title %> + </div> - <div> - <%= f.submit "Submit checkpoint", class: "btn-primary" %> - </div> + <div> + <%= f.label :description %> + <%= f.text_area :description %> + </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> + <%= f.label :save_file %> + <%= f.file_field :save_file %> </div> + + <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> + <% else %> + <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 %> -<% end %> +</div> |