summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/checkpoints_controller.rb2
-rw-r--r--app/views/checkpoints/new.html.erb11
-rw-r--r--app/views/runs/show.html.erb11
3 files changed, 11 insertions, 13 deletions
diff --git a/app/controllers/checkpoints_controller.rb b/app/controllers/checkpoints_controller.rb
index ef53a6b..07c1a5a 100644
--- a/app/controllers/checkpoints_controller.rb
+++ b/app/controllers/checkpoints_controller.rb
@@ -18,7 +18,7 @@ class CheckpointsController < ApplicationController
protected
def checkpoint_params
- params.require(:checkpoint).permit(:title, :description, :save_file, :kind)
+ params.require(:checkpoint).permit(:comment, :save_file, :kind)
end
def set_run
diff --git a/app/views/checkpoints/new.html.erb b/app/views/checkpoints/new.html.erb
index 712eae1..b11a9bc 100644
--- a/app/views/checkpoints/new.html.erb
+++ b/app/views/checkpoints/new.html.erb
@@ -5,17 +5,12 @@
<%= form_with model: [@run, @checkpoint], class: "space-y-4" do |f| %>
<div>
- <%= f.label :title %>
- <%= f.text_field :title %>
+ <div><%= f.label :comment %></div>
+ <%= f.text_area :comment %>
</div>
<div>
- <%= f.label :description %>
- <%= f.text_area :description %>
- </div>
-
- <div>
- <%= f.label :save_file %>
+ <div><%= f.label :save_file %></div>
<%= f.file_field :save_file %>
</div>
diff --git a/app/views/runs/show.html.erb b/app/views/runs/show.html.erb
index d7d65b6..55bef02 100644
--- a/app/views/runs/show.html.erb
+++ b/app/views/runs/show.html.erb
@@ -23,8 +23,8 @@
<h2 class="text-xl">Checkpoints</h2>
<%= link_to "New checkpoint", new_run_checkpoint_path(@run) %>
- <div class="border-l border-orange-900 p-2">
- <% @run.checkpoints.each do |checkpoint| %>
+ <% @run.checkpoints.order(:created_at).reverse.each do |checkpoint| %>
+ <div class="border-l border-orange-900 p-2">
<div class="flex flex-col">
<div>
<%= time_ago_in_words(checkpoint.created_at) %> ago by
@@ -38,7 +38,10 @@
<span>(No save file attached.)</span>
<% end %>
</div>
+ <% if checkpoint.comment %>
+ <div><%= checkpoint.comment %></div>
+ <% end %>
</div>
- <% end %>
- </div>
+ </div>
+ <% end %>
</div>