Skip to content

Commit 0a2d71e

Browse files
committed
Merge pull request #36 from DefactoSoftware/marcel/game-page
better show page with checkings
2 parents c7075e6 + ea205be commit 0a2d71e

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

app/views/games/show.html.erb

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
<h1><%= @game.name %></h1>
22

33
<dl class="cloud arrow">
4-
<dt>Start Time:</dt>
5-
<dd>t<%= @game.start_time %></dd>
4+
<% if @game.start_time && @game.start_time.to_date == Date.today %>
5+
<dt>Start Time:</dt>
6+
<dd><%= l @game.start_time, format: :short_time %></dd>
7+
<% elsif @game.start_time %>
8+
<dt>Starting at:</dt>
9+
<dd><%= l @game.start_time, format: :short %>, <%= l @game.start_time, format: :short_time %></dd>
10+
<% end %>
611

712
<dt>Players:</dt>
8-
<dd><%= @game.attendances.count %> / <%= @game.required_players %></dd>
13+
<dd>
14+
<%= @game.attendances.count || 0 %>
15+
<%= "/ #{@game.required_players}" if @game.required_players %>
16+
</dd>
917

10-
<dt>Game Type:</dt>
11-
<dd><%= @game.game %></dd>
18+
<% if @game.game %>
19+
<dt>Game Type:</dt>
20+
<dd><%= @game.game %></dd>
21+
<% end %>
1222
</dl>
1323

1424
<%= image_tag "bot.svg", alt: "Robot", class: "bot" %>

config/locales/en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ en:
1414
"%b %-d, %Y"
1515
short:
1616
"%B %d"
17+
short_time:
18+
"%H:%M"
1719

1820
time_ago: "%{time} ago"
1921

0 commit comments

Comments
 (0)