From b62d43ccde70aa6fccf5341e57a695a2cfb289c1 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 13 Mar 2019 15:48:14 -0400 Subject: Game list is sortable --- app/views/games/index.html.haml | 45 ++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 21 deletions(-) (limited to 'app/views') diff --git a/app/views/games/index.html.haml b/app/views/games/index.html.haml index f7e7a44..56c5a05 100644 --- a/app/views/games/index.html.haml +++ b/app/views/games/index.html.haml @@ -1,23 +1,26 @@ - title "Games" -%h2 Games +.breadcrumb= link_to "← Back to home page", root_path +%h2#games-title Games %table#games-table - %tr - %th Title - %th Status - %th Score - %th Progress - - @games.each do |game| - %tr{ class: cycle("even", "odd") } - %td - %span.game-title= game.title - - unless game.started_on.blank? - %span.game-started - Started on - %time= game.started_on - - unless game.finished_on.blank? - %span.game-finished - Finished on - %time= game.finished_on - %td= game.status - %td= game.score - %td.game-progress= simple_format game.progress + %thead + %tr + %th= sortable "title" + %th= sortable "status" + %th= sortable "score" + %th= sortable "progress" + %tbody + - @games.each do |game| + %tr{ class: cycle("even", "odd") } + %td + %span.game-title= game.title + - unless game.started_on.blank? + %span.game-started + Started on + %time= game.started_on + - unless game.finished_on.blank? + %span.game-finished + Finished on + %time= game.finished_on + %td= game.status + %td= game.score + %td.game-progress= simple_format game.progress -- cgit 1.4.1