Browse files

polish admin quotes

  • Loading branch information...
1 parent 595e53b commit c9237a4dc8589e2a7676c9af5d905359d435f070 @geraldb geraldb committed Sep 23, 2012
View
10 app/controllers/admin/games_controller.rb
@@ -68,14 +68,8 @@ def batch_update
end
end
-
- limit = params[:limit] || '20'
-
- # find next upcoming games
-
- @upcoming_games = Game.where( 'play_at > ?', Time.now ).order( 'play_at').limit(limit)
-
- render :index
+ flash[:success] = 'Spiele erfolgreich gespeichert.'
+ redirect_to admin_games_path()
end
View
7 app/views/admin/games/_game_upcoming.html.erb
@@ -35,7 +35,8 @@
<td><%= ff.text_field :odds1, :size => 3 %></td>
<td><%= ff.text_field :oddsx, :size => 3 %></td>
<td><%= ff.text_field :odds2, :size => 3 %></td>
- <td><%= ff.text_field :service_id, :size => 2 %> (<%= quote.service.title %>)</td>
+ <!-- fix: use lookup -- add to service model? or lookup module?? -->
+ <td><%= ff.select :service_id, ([[ '- Quote Service -', nil ]] + Service.all.map { |rec| [ rec.title, rec.id ] }) %></td>
<!-- add last updated? -->
</tr>
<% end %><!-- fields_for quotes -->
@@ -48,7 +49,9 @@
<td><%= ff.text_field :odds1, :size => 3 %></td>
<td><%= ff.text_field :oddsx, :size => 3 %></td>
<td><%= ff.text_field :odds2, :size => 3 %></td>
- <td><%= ff.text_field :service_id, :size => 2 %></td>
+ <!-- fix: use lookup -- add to service model? or lookup module?? -->
+ <td><%= ff.select :service_id, ([[ '- Quote Service -', nil ]] + Service.all.map { |rec| [ rec.title, rec.id ] }) %></td>
+
<td></td>
</tr>
<% end %><!-- fields_for quotes -->
View
73 db/seeds/cl/cl_2012_13_2.rb
@@ -45,9 +45,48 @@
cl = Event.find_by_key!( 'cl.2012/13' )
clr1 = Round.find_by_event_id_and_pos!( cl.id, 1 )
+clr2 = Round.find_by_event_id_and_pos!( cl.id, 2 )
tipp3 = Service.find_by_key!( 'tipp3' )
+betathome = Service.find_by_key!( 'betathome' )
+=begin
+betathome_winner_odds = [
+ [ barcelona, 3.4 ],
+ [ madrid, 4.2 ],
+ [ bayern, 8 ],
+ [ manunited, 10 ],
+ [ mancity, 12 ],
+ [ chelsea, 15 ],
+ [ paris, 15 ],
+ [ juventus, 15 ],
+ [ arsenal, 18 ],
+ [ dortmund, 20 ],
+ [ milan, 50 ],
+ [ porto, 80 ],
+ [ schalke, 80 ],
+ [ zenit, 80 ],
+ [ valencia, 100 ],
+ [ malaga, 100 ],
+ [ donezk, 150 ],
+ [ galatasaray, 150 ],
+ [ benfica, 200 ],
+ [ kiew, 500 ],
+ [ celtic, 500 ],
+ [ spartak, 500 ],
+ [ montpellier, 500 ],
+ [ olympiacos, 500 ],
+ [ anderlecht, 750 ],
+ [ cluj, 750 ],
+ [ braga, 750 ],
+ [ lille, 750 ],
+ [ borissow, 750 ],
+ [ ajax, 750 ],
+ [ zagreb, 1000 ],
+ [ nordsjalland, 1000 ]]
+
+EventQuote.create_from_ary!( betathome_winner_odds, betathome, cl )
+=end
clr1_tipp3_odds = [
[ paris, kiew, 1.55, 3.3, 4.5 ],
@@ -68,20 +107,32 @@
[ braga, cluj, 1.45, 3.4, 4.6 ],
[ manunited, galatasaray, 1.25, 4.5, 7.0 ]]
-Quote.create_from_ary_for_round!( clr1_tipp3_odds, tipp3, clr1 )
+clr2_betathome_odds = [
+ [ spartak, celtic, 1.65, 3.5, 5.5 ],
+ [ nordsjalland, chelsea, 8.2, 4.75, 1.35 ],
+ [ juventus, donezk, 1.6, 3.75, 5.5 ],
+ [ borissow, bayern, 8.5, 5.4, 1.3 ],
+ [ valencia, lille, 1.5, 3.9, 6.6 ],
+ [ benfica, barcelona, 6.1, 3.8, 1.55 ],
+ [ cluj, manunited, 5.5, 3.75, 1.6 ],
+ [ galatasaray, braga, 1.85, 3.5, 4 ],
+ [ zenit, milan, 2.25, 3.3, 3.1 ],
+ [ kiew, zagreb, 1.4, 4.15, 8.5 ],
+ [ porto, paris, 2.35, 3.1, 3.1 ],
+ [ arsenal, olympiacos, 1.3, 4.95, 10 ],
+ [ schalke, montpellier, 1.65, 3.75, 5 ],
+ [ anderlecht, malaga, 3.05, 3.25, 2.3 ],
+ [ ajax, madrid, 7, 4.6, 1.4 ],
+ [ mancity, dortmund, 1.7, 3.85, 4.45 ]]
+
+
+clr2_tipp3_odds = []
-=begin
-clr2 = Round.find_by_event_id_and_pos!( cl.id, 2 )
+Quote.create_from_ary_for_round!( clr1_tipp3_odds, tipp3, clr1 )
+## Quote.create_from_ary_for_round!( clr2_tipp3_odds, tipp3, clr2 )
-clr2_tipp3_odds = [
- [ spartak, celtic, 1, 0, 2 ],
- [ juventus, donezk, 1.2, 0.2, 2.2 ],
- [ valencia, lille, 1.3, 0.3, 2.3 ],
- [ benfica, barcelona, 1.4, 0.4, 2.4 ]
-]
+Quote.create_from_ary_for_round!( clr2_betathome_odds, betathome, clr2 )
-Quote.create_from_ary_for_round!( clr2_tipp3_odds, tipp3, clr2 )
-=end
## todo: use new version constant for app module e.g. Wettpool::VERSION ??
Prop.create!( :key => 'db.seeds.cl.2012/13.2.version', :value => '1' )

0 comments on commit c9237a4

Please sign in to comment.