radiant-race_results-extension 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.3.2
@@ -75,6 +75,10 @@ class RaceInstance < ActiveRecord::Base
75
75
  race.checkpoints
76
76
  end
77
77
 
78
+ def splits_available?
79
+ RaceCheckpointTime.in(self).any?
80
+ end
81
+
78
82
  def assembled_checkpoint_times
79
83
  checkpoint_times = {}
80
84
  RaceCheckpointTime.in(self).with_context.each do |cpt|
@@ -23,9 +23,10 @@
23
23
  - else
24
24
  Click on a club or category to see only those results.
25
25
 
26
- %br
27
- View as
28
- - if splitting
29
- = link_to_unless_current "simple results", results_url
30
- - else
31
- = link_to_unless_current "splits", splits_url
26
+ - if @instance.splits_available?
27
+ %br
28
+ View as
29
+ - if splitting
30
+ = link_to_unless_current "simple results", results_url
31
+ - else
32
+ = link_to_unless_current "splits", splits_url
@@ -40,6 +40,9 @@
40
40
  - content_for :see_also do
41
41
  .see_also
42
42
  %p
43
+ - if @instance.splits_available?
44
+ = link_to "#{@instance.full_name} Split times", race_splits_url(@race, @instance)
45
+ %br
43
46
  - if others = @race.instances.with_results.select{|i| i != @instance}
44
47
  More
45
48
  = @race.name
@@ -46,6 +46,8 @@
46
46
  - content_for :see_also do
47
47
  .see_also
48
48
  %p
49
+ = link_to "#{@instance.full_name} results", race_instance_url(@race, @instance)
50
+ %br
49
51
  - if others = @race.instances.with_results.select{|i| i != @instance}
50
52
  More
51
53
  = @race.name
@@ -95,11 +95,10 @@
95
95
  - if @performance.category
96
96
  = link_to "More #{@performance.category.name} results", race_category_url(@race, @instance, @performance.category)
97
97
  %br
98
- All
99
- = @instance.full_name
100
- = link_to "results", race_instance_url(@race, @instance)
101
- or
102
- = link_to "splits", race_splits_url(@race, @instance)
98
+ = link_to "All #{@instance.full_name} results", race_instance_url(@race, @instance)
99
+ - if @instance.splits_available?
100
+ or
101
+ = link_to "splits", race_splits_url(@race, @instance)
103
102
 
104
103
  = yield :performance
105
104
  = yield :see_also
@@ -2,7 +2,7 @@
2
2
  # require_dependency 'application_controller'
3
3
 
4
4
  class RaceResultsExtension < Radiant::Extension
5
- version "1.3.1"
5
+ version "1.3.2"
6
6
  description "Makes easy the uploading, analysis and display of race results. Built for fell races but should work for most timed or score events."
7
7
  url "http://spanner.org/radiant/race_results"
8
8
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{radiant-race_results-extension}
8
- s.version = "1.3.1"
8
+ s.version = "1.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["spanner"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: radiant-race_results-extension
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 1
10
- version: 1.3.1
9
+ - 2
10
+ version: 1.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - spanner