sportdb-admin 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b08195543899f136e95b1d819fecf61889a37d5c
4
+ data.tar.gz: 3b7bc1596bf4568f378f9721b7c4e45706471c24
5
+ SHA512:
6
+ metadata.gz: c4e5988a5c7979857ed8a4e63f571486f180e9f846eedc553f30a2d3daa420391b783d5f6513de78a2fe95aa918cbf969b4fb684a1ab1df4647b9aef27ce8d44
7
+ data.tar.gz: 0603064aa0cc4ffd3d7dcb78f9d8916e9a2e50ea56563d0737117f3ed425e3ac8db3c8effc449430514554a2d93ea5f6b94aa2c4afd62fd423b0b8a75708c7f6
@@ -1,61 +1,62 @@
1
- History.md
2
- Manifest.txt
3
- README.md
4
- Rakefile
5
- app/assets/javascripts/sport_db_admin/application.js
6
- app/assets/stylesheets/sport_db_admin/application.css.scss
7
- app/controllers/sport_db_admin/countries_controller.rb
8
- app/controllers/sport_db_admin/event_quotes_controller.rb
9
- app/controllers/sport_db_admin/events_controller.rb
10
- app/controllers/sport_db_admin/games_controller.rb
11
- app/controllers/sport_db_admin/group_quotes_controller.rb
12
- app/controllers/sport_db_admin/pages_controller.rb
13
- app/controllers/sport_db_admin/quotes_controller.rb
14
- app/controllers/sport_db_admin/regions_controller.rb
15
- app/controllers/sport_db_admin/rounds_controller.rb
16
- app/controllers/sport_db_admin/services_controller.rb
17
- app/controllers/sport_db_admin/sources_controller.rb
18
- app/controllers/sport_db_admin/sport_db_admin_controller.rb
19
- app/controllers/sport_db_admin/teams_controller.rb
20
- app/helpers/sport_db_admin/api_helper.rb
21
- app/helpers/sport_db_admin/application_helper.rb
22
- app/helpers/sport_db_admin/format_helper.rb
23
- app/helpers/sport_db_admin/image_helper.rb
24
- app/helpers/sport_db_admin/link_helper.rb
25
- app/helpers/sport_db_admin/part_helper.rb
26
- app/helpers/sport_db_admin/routes_helper.rb
27
- app/views/layouts/sport_db_admin/sport_db_admin.html.erb
28
- app/views/sport_db_admin/countries/index.html.erb
29
- app/views/sport_db_admin/countries/show.html.erb
30
- app/views/sport_db_admin/event_quotes/index.html.erb
31
- app/views/sport_db_admin/events/index.html.erb
32
- app/views/sport_db_admin/events/show.html.erb
33
- app/views/sport_db_admin/games/_games.html.erb
34
- app/views/sport_db_admin/games/index.html.erb
35
- app/views/sport_db_admin/group_quotes/index.html.erb
36
- app/views/sport_db_admin/pages/about.html.erb
37
- app/views/sport_db_admin/pages/index.html.erb
38
- app/views/sport_db_admin/quotes/index.html.erb
39
- app/views/sport_db_admin/regions/index.html.erb
40
- app/views/sport_db_admin/rounds/index.html.erb
41
- app/views/sport_db_admin/services/index.html.erb
42
- app/views/sport_db_admin/shared/_table_event_quotes.html.erb
43
- app/views/sport_db_admin/shared/_table_game_quotes.html.erb
44
- app/views/sport_db_admin/shared/_td_game_date.html.erb
45
- app/views/sport_db_admin/shared/_td_game_debug.html.erb
46
- app/views/sport_db_admin/shared/_td_game_flags.html.erb
47
- app/views/sport_db_admin/shared/_td_game_round.html.erb
48
- app/views/sport_db_admin/shared/_td_game_score.html.erb
49
- app/views/sport_db_admin/shared/_td_game_team1.html.erb
50
- app/views/sport_db_admin/shared/_td_game_team2.html.erb
51
- app/views/sport_db_admin/shared/_team_world_tree.html.erb
52
- app/views/sport_db_admin/sources/index.html.erb
53
- app/views/sport_db_admin/teams/_teams.html.erb
54
- app/views/sport_db_admin/teams/index.html.erb
55
- app/views/sport_db_admin/teams/index_clubs.html.erb
56
- app/views/sport_db_admin/teams/index_national_teams.html.erb
57
- app/views/sport_db_admin/teams/show.html.erb
58
- config/routes.rb
59
- lib/sportdb/admin.rb
60
- lib/sportdb/admin/engine.rb
61
- lib/sportdb/admin/version.rb
1
+ History.md
2
+ Manifest.txt
3
+ README.md
4
+ Rakefile
5
+ app/assets/javascripts/sport_db_admin/application.js
6
+ app/assets/javascripts/sport_db_admin/jquery.tabs.js
7
+ app/assets/stylesheets/sport_db_admin/application.css.scss
8
+ app/controllers/sport_db_admin/countries_controller.rb
9
+ app/controllers/sport_db_admin/event_quotes_controller.rb
10
+ app/controllers/sport_db_admin/events_controller.rb
11
+ app/controllers/sport_db_admin/games_controller.rb
12
+ app/controllers/sport_db_admin/group_quotes_controller.rb
13
+ app/controllers/sport_db_admin/pages_controller.rb
14
+ app/controllers/sport_db_admin/quotes_controller.rb
15
+ app/controllers/sport_db_admin/regions_controller.rb
16
+ app/controllers/sport_db_admin/rounds_controller.rb
17
+ app/controllers/sport_db_admin/services_controller.rb
18
+ app/controllers/sport_db_admin/sources_controller.rb
19
+ app/controllers/sport_db_admin/sport_db_admin_controller.rb
20
+ app/controllers/sport_db_admin/teams_controller.rb
21
+ app/helpers/sport_db_admin/api_helper.rb
22
+ app/helpers/sport_db_admin/application_helper.rb
23
+ app/helpers/sport_db_admin/format_helper.rb
24
+ app/helpers/sport_db_admin/image_helper.rb
25
+ app/helpers/sport_db_admin/link_helper.rb
26
+ app/helpers/sport_db_admin/part_helper.rb
27
+ app/helpers/sport_db_admin/routes_helper.rb
28
+ app/views/layouts/sport_db_admin/sport_db_admin.html.erb
29
+ app/views/sport_db_admin/countries/index.html.erb
30
+ app/views/sport_db_admin/countries/show.html.erb
31
+ app/views/sport_db_admin/event_quotes/index.html.erb
32
+ app/views/sport_db_admin/events/index.html.erb
33
+ app/views/sport_db_admin/events/show.html.erb
34
+ app/views/sport_db_admin/games/index.html.erb
35
+ app/views/sport_db_admin/group_quotes/index.html.erb
36
+ app/views/sport_db_admin/pages/about.html.erb
37
+ app/views/sport_db_admin/pages/index.html.erb
38
+ app/views/sport_db_admin/quotes/index.html.erb
39
+ app/views/sport_db_admin/regions/index.html.erb
40
+ app/views/sport_db_admin/rounds/index.html.erb
41
+ app/views/sport_db_admin/services/index.html.erb
42
+ app/views/sport_db_admin/shared/_table_event_quotes.html.erb
43
+ app/views/sport_db_admin/shared/_table_game_quotes.html.erb
44
+ app/views/sport_db_admin/shared/_table_games.html.erb
45
+ app/views/sport_db_admin/shared/_td_game_date.html.erb
46
+ app/views/sport_db_admin/shared/_td_game_debug.html.erb
47
+ app/views/sport_db_admin/shared/_td_game_flags.html.erb
48
+ app/views/sport_db_admin/shared/_td_game_round.html.erb
49
+ app/views/sport_db_admin/shared/_td_game_score.html.erb
50
+ app/views/sport_db_admin/shared/_td_game_team1.html.erb
51
+ app/views/sport_db_admin/shared/_td_game_team2.html.erb
52
+ app/views/sport_db_admin/shared/_team_world_tree.html.erb
53
+ app/views/sport_db_admin/sources/index.html.erb
54
+ app/views/sport_db_admin/teams/_teams.html.erb
55
+ app/views/sport_db_admin/teams/index.html.erb
56
+ app/views/sport_db_admin/teams/index_clubs.html.erb
57
+ app/views/sport_db_admin/teams/index_national_teams.html.erb
58
+ app/views/sport_db_admin/teams/show.html.erb
59
+ config/routes.rb
60
+ lib/sportdb/admin.rb
61
+ lib/sportdb/admin/engine.rb
62
+ lib/sportdb/admin/version.rb
data/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Open sports web admin addon / rails engine
4
4
 
5
- * home :: [github.com/geraldb/sport.db.admin](https://github.com/geraldb/sport.db.admin)
6
- * bugs :: [github.com/geraldb/sport.db.admin/issues](https://github.com/geraldb/sport.db.admin/issues)
5
+ * home :: [github.com/sportdb/sport.db.admin](https://github.com/sportdb/sport.db.admin)
6
+ * bugs :: [github.com/sportdb/sport.db.admin/issues](https://github.com/sportdb/sport.db.admin/issues)
7
7
  * gem :: [rubygems.org/gems/sportdb-admin](https://rubygems.org/gems/sportdb-admin)
8
8
  * rdoc :: [rubydoc.info/gems/sportdb-admin](http://rubydoc.info/gems/sportdb-admin)
9
9
  * forum :: [groups.google.com/group/opensport](https://groups.google.com/group/opensport)
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ Hoe.spec 'sportdb-admin' do
9
9
  self.summary = 'sportdb admin addon - rails engine'
10
10
  self.description = summary
11
11
 
12
- self.urls = ['https://github.com/geraldb/sport.db.admin']
12
+ self.urls = ['https://github.com/sportdb/sport.db.admin']
13
13
 
14
14
  self.author = 'Gerald Bauer'
15
15
  self.email = 'opensport@googlegroups.com'
@@ -24,4 +24,3 @@ Hoe.spec 'sportdb-admin' do
24
24
  }
25
25
 
26
26
  end
27
-
@@ -0,0 +1,155 @@
1
+
2
+ // jquery.tabs.js
3
+
4
+ var tabs_new = function( tabs_id, opts ) {
5
+
6
+ // use module pattern (see JavaScript - The Good Parts)
7
+
8
+ function _debug( msg )
9
+ {
10
+ if( window.console && window.console.log )
11
+ console.log( "[debug] " + msg );
12
+ }
13
+
14
+ var $tabs,
15
+ $tabsNav,
16
+ $tabsNavItems,
17
+ $tabsPanels;
18
+
19
+ var defaults = { };
20
+ var settings;
21
+
22
+ function _init( tabs_id, opts )
23
+ {
24
+ settings = $.extend( {}, defaults, opts );
25
+
26
+ // add default style only once to head
27
+ if( $( 'head #tabs-styles-default').length == 0 ) {
28
+
29
+ // little hack: by default - use background-color of body
30
+ var bodyBackgroundColor = $('body').css('backgroundColor');
31
+
32
+ // _debug( 'body backgroundColor:' + bodyBackgroundColor + " : " + typeof( bodyBackgroundColor ));
33
+ if( bodyBackgroundColor === 'rgba(0, 0, 0, 0)' )
34
+ bodyBackgroundColor = 'white'; // standard white transparent background? use just white
35
+
36
+ // todo/fix: possible in css - non transparent background-color using default ??
37
+ // -- setting opacity: 1.0 tried but was NOT working; anything else to try?
38
+
39
+ $( 'head' ).append( "<style id='tabs-styles-default'>\n"+
40
+ ".tabs-nav { \n"+
41
+ " margin: 0; \n"+
42
+ " padding: 0; \n"+
43
+ " list-style-type: none; \n"+
44
+ " border-bottom: 1px solid #999; \n"+
45
+ "} \n"+
46
+ ".tabs-nav li { \n"+
47
+ " display: inline-block; \n"+
48
+ " margin: 0 0 0 5px; \n"+ // top right bottom left
49
+ " padding: 5px 15px 3px 15px; \n"+ // top right bottom left
50
+ " border: 1px solid transparent; \n"+
51
+ " border-bottom: none; \n"+
52
+ " cursor: pointer; \n"+
53
+ " background-color: "+ bodyBackgroundColor +"; \n"+
54
+ "} \n"+
55
+ ".tabs-nav li.selected { \n"+
56
+ " padding-bottom: 4px; \n"+ // note: for bottom use +1px (3px+1px=4px) to overwrite border for "tab" selected effect (1/2)
57
+ " margin-bottom: -1px; \n"+ // note: for bottom use -1px (0px-1px=-1px) to overwrite border for "tab" selected effect (2/2)
58
+ " border: 1px solid #999; \n"+
59
+ " border-bottom: none; \n"+
60
+ "} \n"+
61
+ ".tabs-panel { \n"+
62
+ " padding: 10px; \n"+
63
+ "} \n"+
64
+ "</style>" );
65
+ }
66
+
67
+ $tabs = $( tabs_id );
68
+ $tabsNav = $tabs.children( 'ul' ); // note: ul must be child of tabs div
69
+ $tabsNavItems = $tabsNav.children( 'li' ); // note: li must be child of tabs div > ul
70
+ $tabsPanels = $tabs.children( 'div' ); // all div children - note: divs must be child of tabs div
71
+
72
+ $tabsNav.addClass( 'tabs-nav' );
73
+ $tabsPanels.addClass( 'tabs-panel' );
74
+ $tabsPanels.hide();
75
+
76
+ // when a tab gets clicked; add handler
77
+ $tabsNavItems.each( function( itemIndex, item ) {
78
+ $(item).click( function() {
79
+ // _debug( "itemIndex:" + itemIndex );
80
+ _select( itemIndex );
81
+ });
82
+ });
83
+
84
+ // auto-select first tab on init/startup
85
+ _select( 0 );
86
+
87
+
88
+ } // function _init
89
+
90
+ _init( tabs_id, opts );
91
+
92
+
93
+ function _select( index ) {
94
+ // step 1) reset selected tab (if present)
95
+ $tabsNavItems.filter( '.selected' ).removeClass( 'selected' );
96
+ $tabsPanels.filter( '.selected' ).removeClass( 'selected' ).hide();
97
+
98
+ // step 2) set new selected tab
99
+ $tabsNavItems.eq( index ).addClass( 'selected' );
100
+ $tabsPanels.eq( index ).addClass( 'selected' ).show();
101
+ }
102
+
103
+ return {
104
+ select: function( index ) {
105
+ _select( index );
106
+ return this;
107
+ }
108
+ };
109
+ };
110
+
111
+
112
+
113
+ function tabify( tabs_id, opts ) {
114
+ var tabs = tabs_new( tabs_id, opts );
115
+ return tabs;
116
+ }
117
+
118
+
119
+ ////////////////////
120
+ // wrapper for jquery plugin
121
+
122
+
123
+ (function( $ ) {
124
+
125
+ function debug( msg ) {
126
+ if( window.console && window.console.log ) {
127
+ window.console.log( "[debug] "+msg );
128
+ }
129
+ }
130
+
131
+ function setup_tabs( tabs_el, opts ) {
132
+ debug( "hello from setup_tabs" );
133
+ var tabs = tabs_new( tabs_el, opts );
134
+ var $tabs = $(tabs_el);
135
+
136
+ // NB: attach widget to dom element
137
+ // - use like $('#tabs').data( 'widget' ).select(2); etc.
138
+ $tabs.data( 'widget', tabs );
139
+ return tabs_el;
140
+ }
141
+
142
+ debug( 'add jquery fn tabify' );
143
+
144
+ $.fn.tabify = function( opts ) {
145
+ debug( "calling tabify" );
146
+ return this.each( function( index, tabs_el ) {
147
+ debug( "before setup_tabs["+ index +"]" );
148
+ setup_tabs( tabs_el, opts );
149
+ debug( "after setup_tabs["+ index +"]" );
150
+ });
151
+ };
152
+
153
+ }( jQuery ));
154
+
155
+
@@ -52,7 +52,7 @@ table {
52
52
  td.round-key,
53
53
  td.city-key,
54
54
  td.country-key,
55
- td.region-key,
55
+ td.state-key,
56
56
  td.league-key,
57
57
  td.service-key {
58
58
  color: $dark-gray;
@@ -60,7 +60,7 @@ table {
60
60
  * {
61
61
  color: $dark-gray;
62
62
  font-size: 12px; // ~80%
63
- }
63
+ }
64
64
  }
65
65
  }
66
66
 
@@ -68,14 +68,14 @@ table {
68
68
  table.play {
69
69
  tr.game-round,
70
70
  tr.round-week {
71
- background-color: $azure;
72
-
71
+ background-color: $azure;
72
+
73
73
  td {
74
74
  border-top: 1px solid black;
75
75
  border-bottom: 1px solid black;
76
76
  }
77
77
  }
78
-
78
+
79
79
  tr.game-day {
80
80
  td {
81
81
  border-top: 1px solid black;
@@ -88,17 +88,17 @@ table.play {
88
88
  tr.round-year {
89
89
  background-color: $azure; // todo: make it darker 20%?
90
90
  font-size: 22px; // ~10%
91
-
91
+
92
92
  td {
93
93
  border-top: 1px solid black;
94
94
  border-bottom: 1px solid black;
95
95
  }
96
96
  }
97
-
97
+
98
98
  td.game-score {
99
99
  text-align: center;
100
100
  }
101
-
101
+
102
102
  td.game-date,
103
103
  td.game-hour,
104
104
  td.game-round,
@@ -111,24 +111,24 @@ table.play {
111
111
  font-size: 12px; // ~80%
112
112
  }
113
113
  }
114
-
114
+
115
115
  td.game-team1,
116
116
  td.game-team2 {
117
117
  .game-knockout.game-team-loser
118
118
  {
119
119
  // color: red; // not working - only changes line-through color
120
120
  text-decoration: line-through;
121
-
121
+
122
122
  // -moz-text-decoration-color: grey;
123
123
  // text-decoration-color: grey;
124
124
  }
125
-
125
+
126
126
  .game-team-winner
127
127
  {
128
128
  font-weight: bold;
129
129
  }
130
130
  }
131
-
131
+
132
132
  td {
133
133
  white-space: nowrap;
134
134
  }
@@ -144,9 +144,9 @@ table.play {
144
144
  text-align: center;
145
145
  margin-top: 10px;
146
146
  color: grey;
147
-
147
+
148
148
  a, span {
149
149
  font-size: 12px;
150
150
  color: grey
151
151
  }
152
- }
152
+ }
@@ -9,6 +9,8 @@ class GamesController < SportDbAdminController
9
9
  # find next upcoming games
10
10
  limit = params[:limit] || '50'
11
11
 
12
+ ## fix: use scope upcoming - add to game model!!!
13
+
12
14
  @games = Game.where( 'play_at > ?', Time.now ).order( 'play_at').limit(limit)
13
15
  @show_upcoming = true
14
16
  end
@@ -23,6 +25,9 @@ class GamesController < SportDbAdminController
23
25
  where( 'score1 is null or score2 is null').
24
26
  order( 'play_at desc').limit(limit)
25
27
  else
28
+
29
+ ## fix: use scope past - add to game model!!!
30
+
26
31
  @games = Game.where( 'play_at < ?', Time.now ).order( 'play_at desc').limit(limit)
27
32
  end
28
33
 
@@ -17,7 +17,7 @@ module LinkHelper
17
17
  opts[:fulltitle].present? )
18
18
  # show league title + season title (a.k.a full_title)
19
19
  # e.g. Primera División 2013/14
20
- link_to( event.full_title, short_event_path( event ))
20
+ link_to( event.title, short_event_path( event ))
21
21
  elsif opts[:league].present?
22
22
  # show only league (w/o season title)
23
23
  # e.g. Primera División
@@ -26,6 +26,11 @@ module PartHelper
26
26
  ###########
27
27
  # partial for core/regular code
28
28
 
29
+ def render_games( games, opts={} )
30
+ render partial: 'sport_db_admin/shared/table_games', locals: { games: games }
31
+ end
32
+
33
+
29
34
  def render_game_date( game, opts={} )
30
35
  render partial: 'sport_db_admin/shared/td_game_date', locals: { game: game }
31
36
  end
@@ -1,7 +1,7 @@
1
1
 
2
2
  <h3>
3
3
  <%= flag_for_country( @country ) %>
4
- <%= @country.title %>
4
+ <%= @country.title %>
5
5
  (<%= @country.code %>)
6
6
  </h3>
7
7
 
@@ -52,32 +52,32 @@
52
52
  </table>
53
53
 
54
54
 
55
- <h4><%= @country.regions.count %> Regions</h4>
55
+ <h4><%= @country.states.count %> States</h4>
56
56
 
57
57
  <table>
58
- <% @country.regions.each do |region| %>
58
+ <% @country.states.each do |state| %>
59
59
  <tr>
60
- <td class='region-key'>
61
- <%= region.key %>
60
+ <td class='state-key'>
61
+ <%= state.key %>
62
62
  </td>
63
63
  <td>
64
- <%= region.title %>
64
+ <%= state.title %>
65
65
  </td>
66
66
  <td>
67
67
  <span class='city-count'>
68
- (<%= region.cities.count %>)
68
+ (<%= state.cities.count %>)
69
69
  </span>
70
70
  </td>
71
71
  <td>
72
- <% region.cities.each_with_index do |city,index| %>
72
+ <% state.cities.each_with_index do |city,index| %>
73
73
  <%= '•' if index > 0 %>
74
74
  <%= city.title %>
75
75
  <% end %><!-- each city -->
76
76
  </td>
77
77
  </tr>
78
- <% end %> <!-- each region -->
78
+ <% end %> <!-- each state -->
79
79
  </table>
80
-
80
+
81
81
 
82
82
 
83
83
 
@@ -1,5 +1,5 @@
1
1
 
2
- <h3><%= @event.full_title %></h3>
2
+ <h3><%= @event.title %></h3>
3
3
 
4
4
 
5
5
  <h4><%= @event.teams.count %> Teams</h4>
@@ -47,7 +47,7 @@
47
47
  <% @event.groups.each do |group| %>
48
48
  <tr>
49
49
  <td>
50
- <%= group.title %> |
50
+ <%= group.title %> |
51
51
  </td>
52
52
  <% group.teams.each do |team| %>
53
53
 
@@ -62,7 +62,7 @@
62
62
 
63
63
  <% end %> <!-- if event.groups.count > 0 -->
64
64
 
65
- <!-- add games count -- how? -->
65
+ <!-- add games count -- how? -->
66
66
  <h4><%= @event.games.count %> Games</h4>
67
67
 
68
68
  <p>
@@ -78,7 +78,7 @@
78
78
 
79
79
  <!-- todo: use different css class e.g. db?? -->
80
80
  <table class='play'>
81
-
81
+
82
82
  <% @event.rounds.each do |round| %>
83
83
  <tr class='game-round'>
84
84
  <td colspan='6' class='game-round-title'>
@@ -91,7 +91,7 @@
91
91
 
92
92
  <% round.games.each do |game| %>
93
93
  <tr>
94
-
94
+
95
95
  <%= render_game_date( game ) %>
96
96
  <%= render_game_team1( game ) %>
97
97
  <%= render_game_score( game ) %>
@@ -109,9 +109,9 @@
109
109
  </td>
110
110
 
111
111
  <%= render_game_flags( game ) %>
112
-
112
+
113
113
  </tr>
114
114
  <% end %> <!-- games -->
115
115
  <% end %> <!-- rounds -->
116
116
 
117
- </table>
117
+ </table>
@@ -7,7 +7,9 @@
7
7
  <h3>Past Games</h3>
8
8
  <% end %>
9
9
 
10
- <%= render partial: 'games', locals: { :games => @games } %>
10
+
11
+ <%= render_games( @games ) %>
12
+
11
13
 
12
14
  <% if @games.count > 0 %>
13
15
  <p>
@@ -4,48 +4,5 @@
4
4
 
5
5
  <p>
6
6
  A free open sports database &amp; schema.
7
- <a href="https://github.com/geraldb/sport.db">More &raquo;</a>
7
+ <a href="https://github.com/opensport">More &raquo;</a>
8
8
  </p>
9
-
10
- <hr>
11
-
12
-
13
- <table>
14
- <tr><td style='text-align: right'><%= Badge.count %> </td><td>Badges</td></tr>
15
- <tr><td style='text-align: right'><%= Event.count %> </td><td>Events</td></tr>
16
- <tr><td style='text-align: right'><%= Game.count %> </td><td>Games</td></tr>
17
- <tr><td style='text-align: right'><%= Group.count %> </td><td>Groups</td></tr>
18
- <tr><td style='text-align: right'><%= League.count %> </td><td>Leagues</td></tr>
19
- <tr><td style='text-align: right'><%= Round.count %> </td><td>Rounds</td></tr>
20
- <tr><td style='text-align: right'><%= Season.count %> </td><td>Seasons</td></tr>
21
- <tr><td style='text-align: right'><%= Team.count %> </td><td>Teams</td></tr>
22
-
23
- <!-- todo: split in two sections, that is, world.db and sport.db -->
24
-
25
- <tr><td style='text-align: right'><%= Country.count %> </td><td>Countries</td></tr>
26
- <tr><td style='text-align: right'><%= Region.count %> </td><td>Regions</td></tr>
27
- <tr><td style='text-align: right'><%= City.count %> </td><td>Cities</td></tr>
28
- <tr><td style='text-align: right'><%= WorldDb::Models::Tag.count %> </td><td>Tags</td></tr>
29
- <tr><td style='text-align: right'><%= WorldDb::Models::Tagging.count %> </td><td>Taggings</td></tr>
30
-
31
- <!-- todo: add prop count -->
32
-
33
- <tr><td style='text-align: right'><%= LogDb::Models::Log.count %> </td><td>Logs</td></tr>
34
-
35
- <tr><td></td><td></td></tr>
36
- <tr><td style='text-align: right'><%= Badge.count+
37
- City.count+
38
- Country.count+
39
- Event.count+
40
- Game.count+
41
- Group.count+
42
- League.count+
43
- Region.count+
44
- Round.count+
45
- Season.count+
46
- Team.count+
47
- LogDb::Models::Log.count +
48
- WorldDb::Models::Tag.count+
49
- WorldDb::Models::Tagging.count %></td><td>Total</td></tr>
50
- </table>
51
-
@@ -1,47 +1,44 @@
1
-
2
- <table class='play'>
3
- <% last_play_at = Time.local( 1999, 1, 1 )
4
- games.each do |game| %>
5
-
6
- <% unless last_play_at.year == game.play_at.year &&
7
- last_play_at.month == game.play_at.month &&
8
- last_play_at.day == game.play_at.day %>
9
-
10
- <% unless last_play_at.year == game.play_at.year %>
11
- <tr class='game-year'>
12
- <td colspan='2'></td>
13
- <td colspan='7'> <%= game.play_at.strftime('%Y') %></td>
14
- </tr>
15
- <% end %>
16
-
17
- <!-- todo: find a method for week number; do NOT use strftime; there must be something easier -->
18
- <% unless last_play_at.strftime('%V') == game.play_at.strftime('%V') %>
19
- <tr class='game-week'>
20
- <td colspan='2'></td>
21
- <td colspan='7'>Week <%= game.play_at.strftime('%V') %></td>
22
- </tr>
23
- <% end %>
24
-
25
- <tr class='game-day'>
26
- <td></td>
27
- <td colspan='8'><%= game.play_at.strftime('%A, %d. %B') %></td>
28
- </tr>
29
-
30
- <% end %>
31
-
32
-
33
- <tr>
34
- <td class='game-hour'>
35
- <%= game.play_at.strftime('%H:%M') %>
36
- </td>
37
-
38
- <%= render_game_team1( game ) %>
39
- <%= render_game_score( game ) %>
40
- <%= render_game_team2( game ) %>
41
- <%= render_game_flags( game ) %>
42
- <%= render_game_round( game ) %>
43
-
44
- </tr>
45
- <% last_play_at = game.play_at
46
- end %><!-- each game -->
47
- </table>
1
+
2
+ <table class='play'>
3
+ <!-- fix: add GameCursor shortcut -->
4
+ <% SportDb::Models::GameCursor.new( games ).each do |game,gamep| %>
5
+
6
+ <% if gamep.new_date? %>
7
+
8
+ <% if gamep.new_year? %>
9
+ <tr class='game-year'>
10
+ <td colspan='2'></td>
11
+ <td colspan='7'> <%= game.play_at.strftime('%Y') %></td>
12
+ </tr>
13
+ <% end %>
14
+
15
+ <!-- todo: find a method for week number; do NOT use strftime; there must be something easier -->
16
+ <% if gamep.new_week? %>
17
+ <tr class='game-week'>
18
+ <td colspan='2'></td>
19
+ <td colspan='7'>Week <%= game.play_at.strftime('%V') %></td>
20
+ </tr>
21
+ <% end %>
22
+
23
+ <tr class='game-day'>
24
+ <td></td>
25
+ <td colspan='8'><%= game.play_at.strftime('%A, %d. %B') %></td>
26
+ </tr>
27
+
28
+ <% end %>
29
+
30
+
31
+ <tr>
32
+ <td class='game-hour'>
33
+ <%= game.play_at.strftime('%H:%M') %>
34
+ </td>
35
+
36
+ <%= render_game_team1( game ) %>
37
+ <%= render_game_score( game ) %>
38
+ <%= render_game_team2( game ) %>
39
+ <%= render_game_flags( game ) %>
40
+ <%= render_game_round( game ) %>
41
+
42
+ </tr>
43
+ <% end %><!-- each game -->
44
+ </table>
@@ -4,8 +4,8 @@
4
4
 
5
5
  <% if team.city.present? %>
6
6
  <%= team.city.title %> >
7
- <% if team.city.region.present? %>
8
- <%= team.city.region.title %> >
7
+ <% if team.city.state.present? %>
8
+ <%= team.city.state.title %> >
9
9
  <% end %>
10
10
  <% end %>
11
11
 
@@ -27,21 +27,16 @@
27
27
  </ul>
28
28
 
29
29
 
30
- <!-- todo: use different css class e.g. db?? -->
31
- <table class='play'>
32
- <% @team.games.each do |game| %>
33
- <tr>
34
-
35
- <%= render_game_date( game ) %>
36
-
37
- <%= render_game_team1( game ) %>
38
- <%= render_game_score( game ) %>
39
- <%= render_game_team2( game ) %>
40
- <%= render_game_flags( game ) %>
41
- <%= render_game_round( game ) %>
42
-
43
-
30
+ <div id='tabs-games'>
31
+ <ul>
32
+ <li>Upcoming</li>
33
+ <li>Past</li>
34
+ </ul>
35
+
36
+ <div><%= render_games( @team.upcoming_games ) %></div>
37
+ <div><%= render_games( @team.past_games ) %></div>
38
+ </div> <!-- div.tabs-games -->
44
39
 
45
- </tr>
46
- <% end %> <!-- games -->
47
- </table>
40
+ <script>
41
+ tabify( '#tabs-games' );
42
+ </script>
@@ -4,7 +4,7 @@ puts '[boot] routes.rb - before SportDbAdmin::Engine.routes.draw'
4
4
  SportDbAdmin::Engine.routes.draw do
5
5
 
6
6
  puts '[boot] routes.rb - enter SportDbAdmin::Engine.routes.draw'
7
-
7
+
8
8
  get 'about', :to => 'pages#about'
9
9
 
10
10
 
@@ -36,14 +36,14 @@ SportDbAdmin::Engine.routes.draw do
36
36
  # two letters (e.g. at,mx,us) assume country (fix!! az for Alkmaar in nl)
37
37
  # - do NOT allow two letter keys
38
38
  #
39
- #
39
+ #
40
40
  # short-cut [a-z]+[0-9.\]+ for event
41
41
  # - NOT team keys can NOT contain numbers
42
42
  #
43
43
  # more than three letters for now assume
44
44
  # team page
45
-
46
-
45
+
46
+
47
47
  ###################
48
48
  # - nb: event key must contain dots
49
49
  # todo/todo:
@@ -52,10 +52,15 @@ SportDbAdmin::Engine.routes.draw do
52
52
  # euro2012 or euro12 12->2012 de12 -> bundesliga 11/12
53
53
  #
54
54
  # shortcut -- 3+ letters (w/ digits w/ dots) - assume shortcut for event
55
- #
55
+ #
56
56
  # NB: for now -> must end with .2012 or .2012_13 etc.
57
57
  get '/:key', :to => 'events#shortcut', :as => :short_event_worker, :key => /.+\.[0-9_]+/
58
58
 
59
+ ####
60
+ # shortcut -- 2 lower case letters - assume shortcut for country
61
+ ## note: add eng, wal, sco, nir - three letter country codes
62
+ get '/:key', :to => 'countries#shortcut', :as => :short_country_worker, :key => /([a-z]{2})|eng|wal|sco|nir/
63
+
59
64
  ####
60
65
  # shortcut -- 3+ lower case letters (w/o digits) - assume shortcut for team
61
66
  # nb: do NOT use team keys like az with only two lower case letters; always use at least three minimum
@@ -63,14 +68,11 @@ SportDbAdmin::Engine.routes.draw do
63
68
  get '/:key', :to => 'teams#shortcut', :as => :short_team_worker, :key => /[a-z]{3,}/
64
69
 
65
70
 
66
- ####
67
- # shortcut -- 2 lower case letters - assume shortcut for country
68
- get '/:key', :to => 'countries#shortcut', :as => :short_country_worker, :key => /[a-z]{2}/
69
71
 
70
72
 
71
73
 
72
74
  root :to => 'games#index'
73
-
75
+
74
76
  puts '[boot] routes.rb - leave SportDbAdmin::Engine.routes.draw'
75
77
 
76
78
  end
@@ -1,4 +1,4 @@
1
1
 
2
2
  module SportDbAdmin
3
- VERSION = '0.3.0'
3
+ VERSION = '0.4.0'
4
4
  end
metadata CHANGED
@@ -1,50 +1,58 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sportdb-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Gerald Bauer
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-07 00:00:00.000000000 Z
11
+ date: 2016-10-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rdoc
16
- requirement: &80106050 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '3.10'
19
+ version: '4.0'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *80106050
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: hoe
27
- requirement: &80105480 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ~>
31
+ - - "~>"
31
32
  - !ruby/object:Gem::Version
32
- version: '3.3'
33
+ version: '3.15'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *80105480
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.15'
36
41
  description: sportdb admin addon - rails engine
37
42
  email: opensport@googlegroups.com
38
43
  executables: []
39
44
  extensions: []
40
45
  extra_rdoc_files:
46
+ - History.md
41
47
  - Manifest.txt
48
+ - README.md
42
49
  files:
43
50
  - History.md
44
51
  - Manifest.txt
45
52
  - README.md
46
53
  - Rakefile
47
54
  - app/assets/javascripts/sport_db_admin/application.js
55
+ - app/assets/javascripts/sport_db_admin/jquery.tabs.js
48
56
  - app/assets/stylesheets/sport_db_admin/application.css.scss
49
57
  - app/controllers/sport_db_admin/countries_controller.rb
50
58
  - app/controllers/sport_db_admin/event_quotes_controller.rb
@@ -72,7 +80,6 @@ files:
72
80
  - app/views/sport_db_admin/event_quotes/index.html.erb
73
81
  - app/views/sport_db_admin/events/index.html.erb
74
82
  - app/views/sport_db_admin/events/show.html.erb
75
- - app/views/sport_db_admin/games/_games.html.erb
76
83
  - app/views/sport_db_admin/games/index.html.erb
77
84
  - app/views/sport_db_admin/group_quotes/index.html.erb
78
85
  - app/views/sport_db_admin/pages/about.html.erb
@@ -83,6 +90,7 @@ files:
83
90
  - app/views/sport_db_admin/services/index.html.erb
84
91
  - app/views/sport_db_admin/shared/_table_event_quotes.html.erb
85
92
  - app/views/sport_db_admin/shared/_table_game_quotes.html.erb
93
+ - app/views/sport_db_admin/shared/_table_games.html.erb
86
94
  - app/views/sport_db_admin/shared/_td_game_date.html.erb
87
95
  - app/views/sport_db_admin/shared/_td_game_debug.html.erb
88
96
  - app/views/sport_db_admin/shared/_td_game_flags.html.erb
@@ -101,31 +109,30 @@ files:
101
109
  - lib/sportdb/admin.rb
102
110
  - lib/sportdb/admin/engine.rb
103
111
  - lib/sportdb/admin/version.rb
104
- homepage: https://github.com/geraldb/sport.db.admin
112
+ homepage: https://github.com/sportdb/sport.db.admin
105
113
  licenses:
106
114
  - Public Domain
115
+ metadata: {}
107
116
  post_install_message:
108
117
  rdoc_options:
109
- - --main
118
+ - "--main"
110
119
  - README.md
111
120
  require_paths:
112
121
  - lib
113
122
  required_ruby_version: !ruby/object:Gem::Requirement
114
- none: false
115
123
  requirements:
116
- - - ! '>='
124
+ - - ">="
117
125
  - !ruby/object:Gem::Version
118
126
  version: 1.9.2
119
127
  required_rubygems_version: !ruby/object:Gem::Requirement
120
- none: false
121
128
  requirements:
122
- - - ! '>='
129
+ - - ">="
123
130
  - !ruby/object:Gem::Version
124
131
  version: '0'
125
132
  requirements: []
126
- rubyforge_project: sportdb-admin
127
- rubygems_version: 1.8.17
133
+ rubyforge_project:
134
+ rubygems_version: 2.2.3
128
135
  signing_key:
129
- specification_version: 3
136
+ specification_version: 4
130
137
  summary: sportdb admin addon - rails engine
131
138
  test_files: []