diff options
-rw-r--r-- | app/views/runs/index.html.erb | 3 | ||||
-rw-r--r-- | app/views/runs/show.html.erb | 46 | ||||
-rw-r--r-- | app/views/users/show.html.erb | 2 |
3 files changed, 38 insertions, 13 deletions
diff --git a/app/views/runs/index.html.erb b/app/views/runs/index.html.erb index 9f01859..5e49429 100644 --- a/app/views/runs/index.html.erb +++ b/app/views/runs/index.html.erb @@ -15,7 +15,8 @@ <ul class="list-disc"> <% @runs.each do |run| %> - <li><%= run.game.title %> - <%= link_to run.title, run_path(run) %> - Started by <%= run.user.name %></li> + <li><%= run.game.title %> - <%= link_to run.title, run_path(run) %> + - Started by <%= link_to run.user.name || "???", user_path(run.user) %></li> <% end %> </ul> </div> diff --git a/app/views/runs/show.html.erb b/app/views/runs/show.html.erb index 24f551a..d7d65b6 100644 --- a/app/views/runs/show.html.erb +++ b/app/views/runs/show.html.erb @@ -1,20 +1,44 @@ <div class="space-y-4"> - <h1 class="text-2xl"><%= @run.title %></h1> - <p class="subtitle"><%= @run.game.title %></p> - - <p>Run started by: <%= @run.user.name || "Unknown trainer" %></p> + <div class="space-y-2"> + <h1 class="text-2xl"><%= @run.title %></h1> + <p class="subtitle"><%= @run.game.title %></p> + <p>Started by <%= link_to @run.user.name || "???", user_path(@run.user) %> + <%= time_ago_in_words(@run.created_at) %> ago.</p> + </div> + <div class="font-bold"> + This run is currently + <% if @run.checked_in? %> + checked in! You can progress this run <%= link_to "by creating a checkpoint", new_run_checkpoint_path(@run) %>. + <% else %> + checked out by <%= link_to @run.checked_out_user.name || "???", user_path(@run.checked_out_user) %>. + <% if @run.last_save_file.attached? %> + You can + <%= link_to "download the last save file", rails_blob_path(@run.last_save_file, disposition: "attachment") %> + to check it out, but you won't be able to check in any progress. + <% end %> + <% end %> + </div> <h2 class="text-xl">Checkpoints</h2> <%= link_to "New checkpoint", new_run_checkpoint_path(@run) %> - <ul class="list-disc"> + <div class="border-l border-orange-900 p-2"> <% @run.checkpoints.each do |checkpoint| %> - <li><%= checkpoint.created_at %> - <% if checkpoint.save_file.attached? %> - <%= link_to "[save file]", rails_blob_path(checkpoint.save_file, disposition: "attachment") %> - <% end %> - </li> + <div class="flex flex-col"> + <div> + <%= time_ago_in_words(checkpoint.created_at) %> ago by + <%= link_to checkpoint.user.name || "???", user_path(checkpoint.user) %> + </div> + <div class="text-sm"> + <span><%= checkpoint.created_at %></span> + <% if checkpoint.save_file.attached? %> + <%= link_to "Download save file", rails_blob_path(checkpoint.save_file, disposition: "attachment") %> + <% else %> + <span>(No save file attached.)</span> + <% end %> + </div> + </div> <% end %> - </ul> + </div> </div> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index f0335eb..4df3273 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -1,7 +1,7 @@ <div class="space-y-4"> <h1 class="text-2xl"> <span class="px-4 py-2 text-lg text-slate-900 bg-orange-500 rounded">TRAINER CARD</span> - <%= @user.name || "Unknown" %> + <%= @user.name || "???" %> </h1> <p class="subtitle">ID No. <%= @user.id %></p> |