radiant-race_results-extension 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. data/README.md +8 -0
  2. data/Rakefile +137 -0
  3. data/app/controllers/admin/race_clubs_controller.rb +15 -0
  4. data/app/controllers/admin/race_competitors_controller.rb +15 -0
  5. data/app/controllers/admin/race_instances_controller.rb +17 -0
  6. data/app/controllers/admin/races_controller.rb +35 -0
  7. data/app/controllers/race_instances_controller.rb +23 -0
  8. data/app/controllers/race_performances_controller.rb +16 -0
  9. data/app/controllers/races_controller.rb +13 -0
  10. data/app/helpers/races_helper.rb +38 -0
  11. data/app/models/race.rb +64 -0
  12. data/app/models/race_category.rb +114 -0
  13. data/app/models/race_checkpoint.rb +31 -0
  14. data/app/models/race_checkpoint_time.rb +64 -0
  15. data/app/models/race_club.rb +48 -0
  16. data/app/models/race_club_alias.rb +9 -0
  17. data/app/models/race_competitor.rb +20 -0
  18. data/app/models/race_instance.rb +178 -0
  19. data/app/models/race_page.rb +69 -0
  20. data/app/models/race_performance.rb +175 -0
  21. data/app/models/race_performance_status.rb +58 -0
  22. data/app/models/race_record.rb +27 -0
  23. data/app/views/admin/race_checkpoints/_checkpoint.html.haml +19 -0
  24. data/app/views/admin/race_club_aliases/_race_club_alias.html.haml +10 -0
  25. data/app/views/admin/race_clubs/_club.html.haml +19 -0
  26. data/app/views/admin/race_clubs/_form.html.haml +21 -0
  27. data/app/views/admin/race_clubs/edit.html.haml +20 -0
  28. data/app/views/admin/race_clubs/index.html.haml +27 -0
  29. data/app/views/admin/race_competitors/_competitor.html.haml +14 -0
  30. data/app/views/admin/race_competitors/_form.html.haml +21 -0
  31. data/app/views/admin/race_competitors/edit.html.haml +20 -0
  32. data/app/views/admin/race_competitors/index.html.haml +27 -0
  33. data/app/views/admin/race_instances/_form.html.haml +98 -0
  34. data/app/views/admin/race_instances/edit.html.haml +17 -0
  35. data/app/views/admin/race_instances/new.html.haml +18 -0
  36. data/app/views/admin/race_records/_record.html.haml +20 -0
  37. data/app/views/admin/races/_form.html.haml +82 -0
  38. data/app/views/admin/races/_race.html.haml +36 -0
  39. data/app/views/admin/races/edit.html.haml +19 -0
  40. data/app/views/admin/races/index.html.haml +26 -0
  41. data/app/views/admin/races/new.html.haml +19 -0
  42. data/app/views/race_categories/show.html.haml +36 -0
  43. data/app/views/race_clubs/show.html.haml +25 -0
  44. data/app/views/race_instances/index.html.haml +14 -0
  45. data/app/views/race_instances/show.html.haml +52 -0
  46. data/app/views/race_performances/_headings.html.haml +4 -0
  47. data/app/views/race_performances/_performance.html.haml +21 -0
  48. data/app/views/races/index.html.haml +38 -0
  49. data/app/views/races/show.html.haml +81 -0
  50. data/cucumber.yml +1 -0
  51. data/db/migrate/20091116130836_race_data.rb +128 -0
  52. data/db/migrate/20091124095157_competitor_details.rb +9 -0
  53. data/db/migrate/20091126110634_club_aliases.rb +17 -0
  54. data/db/migrate/20091223094002_instance_details.rb +11 -0
  55. data/db/migrate/20091224100524_race_distance.rb +11 -0
  56. data/db/migrate/20091224100734_race_records.rb +19 -0
  57. data/db/migrate/20091224105637_category_details.rb +13 -0
  58. data/db/migrate/20091224115909_filters.rb +11 -0
  59. data/db/migrate/20091228122837_record_holder.rb +11 -0
  60. data/db/migrate/20100106104850_remember_calculations.rb +9 -0
  61. data/db/migrate/20100426104801_race_attachments.rb +11 -0
  62. data/features/support/env.rb +16 -0
  63. data/features/support/paths.rb +14 -0
  64. data/lib/duration_extensions.rb +61 -0
  65. data/lib/race_results/admin_ui.rb +76 -0
  66. data/lib/race_results/race_tags.rb +722 -0
  67. data/lib/tasks/race_results_extension_tasks.rake +28 -0
  68. data/public/images/admin/calendar_down.png +0 -0
  69. data/public/images/admin/new-race.png +0 -0
  70. data/public/javascripts/admin/races.js +29 -0
  71. data/public/stylesheets/sass/admin/races.sass +131 -0
  72. data/race_results_extension.rb +38 -0
  73. data/spec/datasets/competitors_dataset.rb +81 -0
  74. data/spec/datasets/race_sites_dataset.rb +8 -0
  75. data/spec/datasets/races_dataset.rb +179 -0
  76. data/spec/files/dunnerdale_2009.csv +277 -0
  77. data/spec/files/long_duddon_2008.csv +230 -0
  78. data/spec/lib/duration_spec.rb +50 -0
  79. data/spec/models/race_category_spec.rb +65 -0
  80. data/spec/models/race_club_spec.rb +32 -0
  81. data/spec/models/race_instance_spec.rb +104 -0
  82. data/spec/models/race_performance_spec.rb +7 -0
  83. data/spec/models/race_performance_status_spec.rb +31 -0
  84. data/spec/models/race_spec.rb +39 -0
  85. data/spec/spec.opts +6 -0
  86. data/spec/spec_helper.rb +36 -0
  87. data/vendor/plugins/acts_as_list/README +23 -0
  88. data/vendor/plugins/acts_as_list/init.rb +3 -0
  89. data/vendor/plugins/acts_as_list/lib/active_record/acts/list.rb +256 -0
  90. data/vendor/plugins/acts_as_list/test/list_test.rb +332 -0
  91. metadata +195 -0
@@ -0,0 +1,27 @@
1
+ - include_stylesheet 'admin/races'
2
+
3
+ #competitors_table.outset
4
+ %table#race_competitors.index{:cellspacing=>"0", :border=>"0", :cellpadding=>"0"}
5
+ %thead
6
+ %tr
7
+ - render_region :thead do |thead|
8
+ - thead.title_header do
9
+ %th.competitor
10
+ Name
11
+ - thead.club_header do
12
+ %th.club
13
+ Club
14
+ - thead.races_header do
15
+ %th.races
16
+ Races
17
+
18
+ %tbody
19
+ - @race_competitors.each do |comp|
20
+ = render :partial => 'competitor', :object => comp
21
+
22
+ - render_region :bottom do |bottom|
23
+ - bottom.buttons do
24
+ #actions
25
+ = will_paginate @race_competitors
26
+ %ul
27
+ %li= link_to image('plus') + " " + "new competitor", new_admin_race_competitor_url
@@ -0,0 +1,98 @@
1
+ - include_stylesheet "admin/event_calendar"
2
+ - include_javascript "admin/event_calendar"
3
+ - if defined? TinyMceFilter
4
+ - include_javascript "tiny_mce/tiny_mce"
5
+ - include_javascript "tiny_mce/tiny_mce_settings"
6
+ - include_javascript "tiny_mce/application"
7
+
8
+ = render_region :form_top
9
+
10
+ - if @race_instance.errors.any?
11
+ %p.haserror
12
+ Sorry: there were problems:
13
+ %br
14
+ = @race_instance.errors.full_messages
15
+
16
+ - render_region :form do |form|
17
+
18
+
19
+ - form.edit_name do
20
+ %h2 Before the race
21
+ %p.title
22
+ = f.label :name, "Title"
23
+ %span.formnote
24
+ to identify this results set (eg '2010' will show as
25
+ %strong
26
+ = @race.name
27
+ 2010)
28
+ = f.text_field :name, :class => 'textbox', :maxlength => 100
29
+
30
+ - form.edit_metadata do
31
+ #extended-metadata{ :class => "row", :style => "display: none" }
32
+ %table.fieldset{ :cellpadding => "0", :cellspacing => "0", :border => "0" }
33
+ %tr
34
+ %td.label
35
+ = f.label :slug, 'Slug'
36
+ %td.field
37
+ = f.text_field :slug, :class => 'textbox slug', :maxlength => 255
38
+ = render_region :extended_metadata
39
+ %p
40
+ %small
41
+ %a{ :id => "more-extended-metadata", :href => "#", :onclick => "#{toggle_javascript_for('extended-metadata')}; return false;" } More
42
+ %a{ :id => "less-extended-metadata", :href => "#", :onclick => "#{toggle_javascript_for('extended-metadata')}; return false;", :style => "display: none" } Less
43
+
44
+ - form.edit_start do
45
+ %p.start
46
+ = f.label :started_at, "Start time and date"
47
+ %br
48
+ = f.text_field :started_at, :class => 'textbox date time'
49
+
50
+ - form.edit_notes do
51
+ %p.start
52
+ = f.label :notes, "Notes for competitors"
53
+ %span.formnote
54
+ if anything is different on this occasion
55
+ %br
56
+ = f.text_area "notes", :size => '40x6', :class => "textarea"
57
+
58
+ - form.edit_file do
59
+ %h2 After the race
60
+ %p.upload
61
+ %label.upload
62
+ Upload results file
63
+ %br
64
+ = f.file_field :results, :class => "upload"
65
+ %ul.help
66
+ %li
67
+ Results should be uploaded as a CSV file with a header row.
68
+ %li
69
+ These headings are understood:
70
+ %code name, pos, position, time, start, finish, club, cat, category
71
+ %li
72
+ Checkpoint times will be recorded if the column heading matches a checkpoint name.
73
+ - if @race.checkpoints.any?
74
+ For
75
+ = @race.name
76
+ we have these checkpoints:
77
+ %br
78
+ = @race.checkpoints.map { |cp| "<code>#{cp.name}</code>" }.join(", ")
79
+ - else
80
+ = @race.name
81
+ has no checkpoints.
82
+ %li
83
+ Categories will be turned into the standard
84
+ %code LVxx
85
+ and
86
+ %code MVxx
87
+ format.
88
+ %code Uxx
89
+ is also understood.
90
+ %li
91
+ All times should be recorded as
92
+ %code hh:mm:ss.
93
+
94
+ - form.edit_report do
95
+ %p.start
96
+ = f.label :report, "Race Report"
97
+ %br
98
+ = f.text_area "report", :size => '40x12', :class => "textarea"
@@ -0,0 +1,17 @@
1
+ = render_region :top
2
+
3
+ - render_region :main do |main|
4
+ - main.edit_header do
5
+ %h1= "Update Race Results"
6
+ %p
7
+ Uploading a new results file will completely replace the current list of competitors, categories and times.
8
+
9
+ - main.edit_form do
10
+ - form_for :race_instance, :url => admin_race_race_instance_path(@race, @race_instance), :html => { :method => "put", :multipart => true } do |f|
11
+ .form-area
12
+ = render :partial => "form", :locals => { :f => f }
13
+
14
+ %p.buttons
15
+ %input{:type => "submit", :class => 'button', :value => "save race details"}
16
+ or
17
+ = link_to "Cancel", admin_races_path
@@ -0,0 +1,18 @@
1
+ = render_region :top
2
+
3
+ - render_region :main do |main|
4
+ - main.edit_header do
5
+ %h1= "Upload Race Results"
6
+
7
+ %p
8
+ For a simple race, all you need to do here is give it a short name and upload a results file: we'll work out the competitors and categories from the results.
9
+
10
+ - main.edit_form do
11
+ - form_for :race_instance, :url => admin_race_race_instances_path, :html => { :method => "post", :multipart => true } do |f|
12
+ .form-area
13
+ = render :partial => "form", :locals => { :f => f }
14
+
15
+ %p.buttons
16
+ %input{:type => "submit", :class => 'button', :value => "save race details"}
17
+ or
18
+ = link_to "Cancel", admin_races_path
@@ -0,0 +1,20 @@
1
+ - cssclass = f.object.new_record? ? 'adding subform' : 'subform'
2
+ %div{:class => cssclass}
3
+ .category
4
+ = f.label :race_category, "Cat"
5
+ = f.select("race_category_id", RaceCategory.all.collect {|rc| [ rc.name, rc.id ] }, {}, {:class => 'textbox'})
6
+ .time
7
+ = f.label :elapsed_time, "Time"
8
+ = f.text_field :elapsed_time, :class => 'textbox'
9
+ .holder
10
+ = f.label :holder, "Holder"
11
+ = f.text_field :holder, :class => 'textbox'
12
+ .year
13
+ = f.label :year, "Year"
14
+ = f.text_field :year, :class => 'textbox'
15
+ .options
16
+ - if f.object.new_record?
17
+ = link_to_function "cancel", "this.up('.subform').remove()"
18
+ - else
19
+ = f.check_box '_delete', { :onclick=>"this.checked ? this.up('.subform').addClassName('deleting') : this.up('.subform').removeClassName('deleting')" , :class => 'record_delete'}
20
+ = f.label '_delete', 'delete', :class => 'quiet'
@@ -0,0 +1,82 @@
1
+ - include_stylesheet 'admin/races'
2
+ - if defined? TinyMceFilter
3
+ - include_javascript "tiny_mce/tiny_mce"
4
+ - include_javascript "tiny_mce/tiny_mce_settings"
5
+ - include_javascript "tiny_mce/application"
6
+
7
+ = render_region :form_top
8
+
9
+ - if @race.errors.any?
10
+ %p.haserror
11
+ Sorry: there were problems:
12
+ %br
13
+ = @race.errors.full_messages
14
+
15
+ .container_12
16
+
17
+ - render_region :form do |form|
18
+ - form.edit_name do
19
+ %p.title
20
+ = f.label :name, "Race Name"
21
+ = f.text_field :name, :class => 'textbox', :maxlength => 100
22
+
23
+ - form.edit_metadata do
24
+ %p.slug
25
+ = f.label :name, "slug"
26
+ = f.text_field :slug, :class => 'textbox', :maxlength => 100
27
+
28
+ - form.edit_distance do
29
+ %p.distance
30
+ = f.label :distance, "Distance (in miles)"
31
+ = f.text_field :distance, :class => 'textbox'
32
+ %p.climb
33
+ = f.label :climb, "Climb (in feet)"
34
+ = f.text_field :climb, :class => 'textbox'
35
+
36
+ - form.edit_description do
37
+ %p.description
38
+ - if defined? TinyMceFilter
39
+ = link_to image('mce', :alt=> 'toolbar icon'), '#', :class => 'toggleMCE', :rel => 'toggle[race_description]'
40
+ = f.label :name, "Race Description"
41
+ = f.text_area "description", :size => '40x8', :class => "textarea"
42
+
43
+ - form.edit_attachments do
44
+ #attachments
45
+ %p.map
46
+ - @race.build_map_asset unless @race.map_asset
47
+ - f.fields_for :map_asset do |mf|
48
+ = mf.label :asset, "Map"
49
+ = mf.file_field :asset, :class => ''
50
+ - unless @race.map_asset.new_record?
51
+ %br
52
+ = image_tag @race.map_asset.thumbnail(:icon)
53
+ to replace the file
54
+ %br
55
+ = @race.map_asset.asset_file_name
56
+ %p.illustration
57
+ - @race.build_picture_asset unless @race.picture_asset
58
+ - f.fields_for :picture_asset do |pf|
59
+ = pf.label :asset, "Picture"
60
+ = pf.file_field :asset, :class => ''
61
+ - unless @race.picture_asset.new_record?
62
+ %br
63
+ = image_tag @race.picture_asset.thumbnail(:icon)
64
+ to replace the file
65
+ %br
66
+ = @race.picture_asset.asset_file_name
67
+
68
+ - form.edit_records do
69
+ %div#records
70
+ %h2 Records
71
+ %p
72
+ = link_to_new_nested_form "Add a record", f, :records, :partial => 'admin/race_records/record'
73
+ - f.fields_for :records do |rf|
74
+ = render :partial => 'admin/race_records/record', :locals => {:f => rf}
75
+
76
+ - form.edit_checkpoints do
77
+ %div#checkpoints
78
+ %h2 Checkpoints
79
+ %p
80
+ = link_to_new_nested_form "Add a checkpoint", f, :checkpoints, :partial => 'admin/race_checkpoints/checkpoint'
81
+ - f.fields_for :checkpoints do |cf|
82
+ = render :partial => 'admin/race_checkpoints/checkpoint', :locals => {:f => cf}
@@ -0,0 +1,36 @@
1
+ %tr.node.level-1
2
+ - render_region :tbody do |tbody|
3
+ - tbody.title_cell do
4
+ %td.race_name
5
+ %p
6
+ = link_to race.name, edit_admin_race_url(race)
7
+ = link_to(image('minus'), admin_race_url(race), :class => 'remove', :method => :delete, :title => "Delete #{race.name} and all results", :confirm => "Do you really want to delete the race #{race.name} and all its results?")
8
+ %br
9
+ %span.info
10
+ = race.distance
11
+ miles,
12
+ = "#{race.climb}'"
13
+ climb
14
+ - if race.records.any?
15
+ %br
16
+ Records:
17
+ = race.records.map{ |record| "#{record.race_category.name}: #{record.elapsed_time}"}.join(', ')
18
+
19
+ - tbody.instances_cell do
20
+ %td.race_instances
21
+ %ul.instances
22
+ - column = 0
23
+ - race.instances.each do |ri|
24
+ %li
25
+ = link_to "#{ri.name}", edit_admin_race_race_instance_url(race, ri)
26
+ = link_to("#{image('minus')}", admin_race_race_instance_url(race, ri), :class => 'remove', :method => :delete, :confirm => "really delete #{ri.full_name}?")
27
+ %br
28
+ %span.info
29
+ - if ri.performances.any?
30
+ = ri.performances.count
31
+ competitors
32
+ - else
33
+ no results yet
34
+ - column = column + 1
35
+ %p.new_instance
36
+ = link_to("#{image('plus', :alt => 'add results')} add an occasion", new_admin_race_race_instance_url(race))
@@ -0,0 +1,19 @@
1
+ = render_region :top
2
+
3
+ - render_region :main do |main|
4
+ - main.edit_header do
5
+ %h1
6
+ Edit Race
7
+ %p
8
+ This is where you put in the basic information about the race, including general instructions for the competitor. The information you enter here should apply every time the race is run.
9
+
10
+ - main.edit_form do
11
+ - form_for :race, @race, :url => admin_race_path(@race), :html => { :method => "put", :multipart => true } do |f|
12
+ .form-area
13
+ = render :partial => "form", :locals => { :f => f }
14
+
15
+ %p.buttons
16
+ = save_model_button(@race)
17
+ = save_model_and_continue_editing_button(@race)
18
+ or
19
+ = link_to "Cancel", admin_races_path
@@ -0,0 +1,26 @@
1
+ - include_stylesheet 'admin/races'
2
+
3
+ #races_table.outset
4
+ %table#races.index{:cellspacing=>"0", :border=>"0", :cellpadding=>"0"}
5
+ %thead
6
+ %tr
7
+ - render_region :thead do |thead|
8
+ - thead.title_header do
9
+ %th.race
10
+ Race Name
11
+ - thead.instances_header do
12
+ %th.instances
13
+ Occasions
14
+ - thead.modify_header do
15
+ %th.modify
16
+
17
+ %tbody
18
+ - @races.each do |race|
19
+ = render :partial => 'race', :object => race
20
+
21
+ - render_region :bottom do |bottom|
22
+ - bottom.buttons do
23
+ #actions
24
+ = will_paginate @races
25
+ %ul
26
+ %li= link_to image('plus') + " " + "new race", new_admin_race_url
@@ -0,0 +1,19 @@
1
+ = render_region :top
2
+
3
+ - render_region :main do |main|
4
+ - main.edit_header do
5
+ %h1
6
+ New Race
7
+ %p
8
+ This is where you put in the basic information about the race, including general instructions for the competitor. The information you enter here should apply every time the race is run. You can put in more specific information each time the race is run.
9
+
10
+ - main.edit_form do
11
+ - form_for :race, @race, :url => admin_races_path, :html => { :method => "post", :multipart => true } do |f|
12
+ .form-area
13
+ = render :partial => "form", :locals => { :f => f }
14
+
15
+ %p.buttons
16
+ = save_model_button(@race)
17
+ = save_model_and_continue_editing_button(@race)
18
+ or
19
+ = link_to "Cancel", admin_races_path
@@ -0,0 +1,36 @@
1
+ - if @instance.has_results?
2
+ %table.results
3
+ %thead
4
+ = render :partial => 'race_performances/headings'
5
+ %tbody
6
+ = render :partial => 'race_performances/performance', :collection => @performances.completed
7
+ = render :partial => 'race_performances/performance', :collection => @performances.incomplete
8
+
9
+ - else
10
+ %p.noresults
11
+ Not available yet.
12
+
13
+ - content_for :breadhead do
14
+ = link_to "Race results", races_url, :class => 'breadhead'
15
+
16
+ - content_for :title do
17
+ = @instance.full_name
18
+ = @category.name
19
+
20
+ - content_for :introduction do
21
+ %p
22
+ There were
23
+ = @performances.count
24
+ people eligible for the
25
+ = @category.name
26
+ category:
27
+
28
+ - content_for :see_also do
29
+ %h3
30
+ More results from
31
+ = @instance.full_name
32
+ %p
33
+ = link_to("Combined", race_instance_url(@race, @instance)) + ', '
34
+ = @instance.categories.map { |category| link_to category.name, race_category_url(@race, @instance, category) }.join(', ')
35
+
36
+
@@ -0,0 +1,25 @@
1
+ - if @instance.has_results?
2
+ %table.results
3
+ %thead
4
+ = render :partial => 'race_performances/headings'
5
+ %tbody
6
+ = render :partial => 'race_performances/performance', :collection => @performances.completed
7
+ = render :partial => 'race_performances/performance', :collection => @performances.incomplete
8
+
9
+ - else
10
+ %p.noresults
11
+ Not available yet.
12
+
13
+ - content_for :breadhead do
14
+ = link_to "Race results", races_url, :class => 'breadhead'
15
+
16
+ - content_for :title do
17
+ = @instance.full_name
18
+ = @club.name
19
+
20
+ - content_for :introduction do
21
+ %p
22
+ There were
23
+ = @performances.count
24
+ competitors from
25
+ = @club.name + ':'
@@ -0,0 +1,14 @@
1
+ %h1
2
+ = yield :title
3
+
4
+ %div.race_list
5
+ = yield :list
6
+
7
+ - content_for :title do
8
+ Results
9
+
10
+ - content_for :list do
11
+ %ul.race_list
12
+ - @race_instances.each do |instance|
13
+ %li
14
+ = link_to instance.full_name, race_race_instance_url(instance.race, instance) }
@@ -0,0 +1,52 @@
1
+ - if @instance.has_results?
2
+ - if @club || @category
3
+ %p.subset
4
+ Showing only
5
+ - if @club
6
+ %strong
7
+ = @club.name
8
+ - if @category
9
+ %strong
10
+ = @category.name
11
+ %br
12
+ = link_to "Show all results.", race_instance_url(@race, @instance)
13
+
14
+ %table.results
15
+ %thead
16
+ = render :partial => 'race_performances/headings'
17
+ %tbody
18
+ = render :partial => 'race_performances/performance', :collection => @performances.completed
19
+ = render :partial => 'race_performances/performance', :collection => @performances.incomplete, :locals => {:trclass => 'unfinished'}
20
+
21
+ - else
22
+ %p.noresults
23
+ Not available yet.
24
+
25
+ - content_for :breadhead do
26
+ = link_to "Race results", races_url, :class => 'breadhead'
27
+
28
+ - content_for :title do
29
+ = @instance.full_name
30
+
31
+ - content_for :subtitle do
32
+ = @race.distance
33
+ miles,
34
+ = @race.climb
35
+ climb
36
+
37
+ - content_for :introduction do
38
+ - if @instance.past?
39
+ = @instance.filter.filter(@instance.report)
40
+ - else
41
+ = @instance.filter.filter(@instance.notes)
42
+
43
+ - content_for :see_also do
44
+ - if others = @race.instances.with_results.select{|i| i != @instance}
45
+ .see_also
46
+ %p
47
+ More
48
+ = @race.name
49
+ results:
50
+ = others.map { |instance| link_to instance.name, race_instance_url(@race, instance) }.join(', ')
51
+
52
+
@@ -0,0 +1,4 @@
1
+ %tr
2
+ - %w{Pos Name Club Cat Time}.each do |h|
3
+ %th
4
+ =h
@@ -0,0 +1,21 @@
1
+ - trclass ||= performance.prized? ? 'prized' : 'finisher'
2
+
3
+ %tr{:class => trclass}
4
+ %td
5
+ - if performance.finished?
6
+ = performance.position
7
+ - else
8
+ = performance.status
9
+ %td
10
+ = performance.name
11
+ %td
12
+ - if performance.club
13
+ = link_to_unless_current performance.club.name, race_club_url(@instance.race, @instance, performance.club)
14
+ %td
15
+ = link_to_unless_current performance.race_category.name, race_category_url(@instance.race, @instance, performance.race_category)
16
+ %td
17
+ - if performance.finished?
18
+ = performance.elapsed_time
19
+ %td
20
+ - if performance.finished?
21
+ = performance.prizes
@@ -0,0 +1,38 @@
1
+ - @races.each do |race|
2
+ .race
3
+ - if race.picture_asset
4
+ .race_illustration
5
+ = link_to image_tag(race.picture_asset.thumbnail(Radiant::Config['race_results.race_illustration_size'] || :grid_3)), race_url(race)
6
+
7
+ .race_description
8
+ %h2
9
+ = link_to race.name, race_url(race)
10
+ %span.headernote
11
+ = race.distance
12
+ miles,
13
+ = race.climb.to_s + "'"
14
+
15
+ %p.race_instances
16
+ - if next_instance = race.next
17
+ Next:
18
+ = link_to next_instance.nice_start_date, race_url(race)
19
+ %br
20
+ - if race.instances.with_results.any?
21
+ Results:
22
+ = race.instances.with_results.map { |instance| link_to instance.name, race_instance_url(race, instance) }.join(', ')
23
+ %br
24
+ - if race.map_asset
25
+ = link_to "Download map", race.map_asset.thumbnail('original'), :class => 'racemap'
26
+
27
+ %p
28
+ = truncate_words(race.description, 36)
29
+
30
+ - content_for :title do
31
+ Races
32
+
33
+ - content_for :introduction do
34
+ - if next_instance = RaceInstance.future.first
35
+ %p.next_race
36
+ Next race:
37
+ %strong
38
+ = link_to "#{next_instance.race.name} on #{next_instance.nice_start_date}", race_instance_url(next_instance.race, next_instance)
@@ -0,0 +1,81 @@
1
+ - if @race.picture_asset
2
+ .illustration
3
+ = image_tag @race.picture_asset.thumbnail(:grid_4)
4
+ %p.caption
5
+ = @race.picture_asset.caption
6
+
7
+ = @race.description
8
+
9
+ %div.checkpoints
10
+ %h2
11
+ Checkpoints
12
+
13
+ - if @race.checkpoints.any?
14
+ %ul.checkpoints
15
+ - @race.checkpoints.each do |cp|
16
+ %li
17
+ = cp.name
18
+ %span.info
19
+ = cp.location
20
+ - else
21
+ %p No checkpoints defined.
22
+
23
+ - if @race.map_asset
24
+ %p
25
+ = link_to "Download map", @race.map_asset.thumbnail('original'), :class => 'racemap'
26
+
27
+ %div.results
28
+ %h2
29
+ Records
30
+ - if @race.records.any?
31
+ %ul.race_records
32
+ - @race.records.each do |record|
33
+ %li
34
+ %strong
35
+ = record.race_category.name + ':'
36
+ = record.elapsed_time
37
+ by
38
+ = record.holder
39
+ in
40
+ = record.year
41
+
42
+ - else
43
+ %p.noresults
44
+ None yet
45
+
46
+ %div.results
47
+ %h2
48
+ Results
49
+ - if @race.instances.with_results.any?
50
+ %ul.race_instances
51
+ - @race.instances.with_results.each do |instance|
52
+ %li
53
+ = link_to instance.name, race_instance_url(@race, instance)
54
+ - else
55
+ %p.noresults
56
+ None yet
57
+
58
+
59
+ - content_for :breadhead do
60
+ = link_to "Races", races_url, :class => 'breadhead'
61
+
62
+ - content_for :title do
63
+ = @race.name
64
+
65
+ - content_for :subtitle do
66
+ = @race.distance
67
+ miles,
68
+ = @race.climb
69
+ climb
70
+
71
+ - content_for :introduction do
72
+ - if next_instance = @race.next
73
+ %div.future_race
74
+ %p
75
+ Next race:
76
+ %strong
77
+ = next_instance.nice_start_date + ','
78
+ at
79
+ = next_instance.nice_start_time + "."
80
+
81
+ = next_instance.filter.filter(next_instance.notes)
data/cucumber.yml ADDED
@@ -0,0 +1 @@
1
+ default: --format progress features --tags ~@proposed,~@in_progress