-
Notifications
You must be signed in to change notification settings - Fork 49
/
_games_upcoming.html.erb
54 lines (45 loc) · 1.26 KB
/
_games_upcoming.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<h3>Nächsten Spiele</h3>
<table>
<% last_play_at = Time.local( 1999, 1, 1 )
games.each do |game| %>
<% unless last_play_at.year == game.play_at.year &&
last_play_at.month == game.play_at.month &&
last_play_at.day == game.play_at.day %>
<tr style='background-color: silver;'>
<td colspan='10'><%= game.play_at.strftime('%A, %d. %B %Y') %></td>
</tr>
<% end %>
<tr style='vertical-align: middle;'>
<td>
<%= game.play_at.strftime('%H:%M') %>
</td>
<td style='text-align: right;'>
<%= game.team1.title %>
<%= "(#{game.team1.title2})" if game.team1.title2.present? %>
</td>
<td>
<%= image_tag( game.team1.img ) if game.team1.img.present? %>
</td>
<td> - <%#= game.score_str %>
</td>
<td>
<%= image_tag( game.team2.img ) if game.team2.img.present? %>
</td>
<td>
<%= game.team2.title %>
<%= "(#{game.team2.title2})" if game.team2.title2.present? %>
</td>
<td>
(<%= game.round.event.title %> / <%= game.round.title %>)
</td>
</tr>
<% last_play_at = game.play_at
end %><!-- each game -->
</table>
<% if games.count > 0 %>
<p><%= link_to 'Mehr Spiele »', db_games_path(:limit => 100) %>
</p>
<% else %>
<p>Noch keine Spiele bekannt.
</p>
<% end %>