Permalink
Browse files

more part helper reuse

  • Loading branch information...
1 parent ea3d6ed commit c734d4401c650d706989f852de76e81a19f9b812 @geraldb geraldb committed Oct 3, 2012
View
@@ -59,9 +59,19 @@ def render_game_team1( game, opts={} )
render :partial => 'shared/td_game_team1', :locals => { :game => game }
end
+ def render_game_team1_v2( game, opts={} )
+ ### fix/todo: add check for :link opt
+ render :partial => 'shared/td_game_team1_v2', :locals => { :game => game }
+ end
+
def render_game_team2( game, opts={} )
render :partial => 'shared/td_game_team2', :locals => { :game => game }
end
+
+ def render_game_team2_v2( game, opts={} )
+ ### fix/todo: add check for :link opt
+ render :partial => 'shared/td_game_team2_v2', :locals => { :game => game }
+ end
def render_game_quotes( game, opts={} )
render :partial => 'shared/table_game_quotes', :locals => { :game => game }
@@ -18,7 +18,7 @@
<% @event.rounds.each do |round| %>
<tr class='game-round'>
- <td colspan='6' class='game-round-title'>
+ <td colspan='7' class='game-round-title'>
<%= round.title %>
<%= "/ #{round.title2}" if round.title2.present? %>
</td>
@@ -29,32 +29,13 @@
<% round.games.each do |game| %>
<tr>
-<td class='game-date'>
- <%= game.play_at_str %>
-</td>
-
-<td class='game-team1'>
- <span class='<%= game.team1_style_class %>'>
- <%= link_to game.team1.title, db_team_path( game.team1 ) %>
- </span>
- <%= "(#{game.team1.title2})" if game.team1.title2.present? %>
-</td>
-<td>
- <%= image_tag( game.team1.img ) if game.team1.img.present? %>
-</td>
-
-<td class='game-score'>
- ( <%= game.score_str %> )
-</td>
+<%= render_game_date( game ) %>
+<%= render_game_team1_v2( game, :link => :db ) %>
+<%= render_game_score( game ) %>
+<%= render_game_team2_v2( game, :link => :db ) %>
<td>
- <%= image_tag( game.team2.img ) if game.team2.img.present? %>
-</td>
-<td class='game-team2'>
- <span class='<%= game.team2_style_class %>'>
- <%= link_to game.team2.title, db_team_path( game.team2 ) %>
- </span>
- <%= "(#{game.team2.title2})" if game.team2.title2.present? %>
+ <%= render_game_quotes( game ) %>
</td>
</tr>
@@ -18,25 +18,17 @@
<td>
<%= game.play_at.strftime('%H:%M') %>
</td>
- <td style='text-align: right;'>
- <%= link_to game.team1.title, db_team_path( game.team1 ) %>
- <%= "(#{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>
+
+ <%= render_game_team1_v2( game, :link => :db ) %>
+ <%= render_game_score( game ) %>
+ <%= render_game_team2_v2( game, :link => :db ) %>
+
<td>
- <%= link_to game.team2.title, db_team_path( game.team2 ) %>
- <%= "(#{game.team2.title2})" if game.team2.title2.present? %>
+ (<%= link_to game.round.event.title, db_event_path( game.round.event ) %> / <%= game.round.title %>)
</td>
+
<td>
- (<%= link_to game.round.event.title, db_event_path( game.round.event ) %> / <%= game.round.title %>)
+ <%= render_game_quotes( game ) %>
</td>
</tr>
@@ -0,0 +1,18 @@
+<!-- paras: game
+ NB: v2 uses two tds (table cells)
+ -->
+
+<!-- todo/fix:
+ check for :link options (:db|:live)
+ -->
+
+
+<td class='game-team1' style='text-align: right;'>
+ <span class='<%= game.team1_style_class %>'>
+ <%= link_to game.team1.title, db_team_path( game.team1 ) %>
+ </span>
+ <%= "(#{game.team1.title2})" if game.team1.title2.present? %>
+</td>
+<td>
+ <%= image_tag( game.team1.img ) if game.team1.img.present? %>
+</td>
@@ -0,0 +1,17 @@
+<!-- paras: game
+ NB: v2 uses two tds (table cells)
+ -->
+
+<!-- todo/fix:
+ check for :link options (:db|:live)
+ -->
+
+<td>
+ <%= image_tag( game.team2.img ) if game.team2.img.present? %>
+</td>
+<td class='game-team2'>
+ <span class='<%= game.team2_style_class %>'>
+ <%= link_to game.team2.title, db_team_path( game.team2 ) %>
+ </span>
+ <%= "(#{game.team2.title2})" if game.team2.title2.present? %>
+</td>

0 comments on commit c734d44

Please sign in to comment.