/
temp
84 lines (84 loc) · 2.13 KB
/
temp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb (revision 37)
+++ app/helpers/application_helper.rb (working copy)
@@ -1,6 +1,6 @@
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
- def breadcrumbs_for(crumbs)
+ def old_breadcrumbs_for(crumbs)
result = "<ul>\r"
last_crumb = crumbs.pop
for crumb in crumbs
@@ -10,4 +10,71 @@
result += "<ul>"
result
end
+
+ def breadcrumbs_for(*crumbs)
+ content_for :breadcrumbs do
+ render(:partial => 'shared/breadcrumbs', :object => crumbs)
+ end
+ end
+
+ def home_url
+ "http://www.badbeatbratz.com"
+ end
+
+ def home_crumb
+ {:name => "Home", :url => home_link}
+ end
+
+ def entries_crumb
+ {:name => "Entries", :url => entries_link}
+ end
+
+ def layouts_crumb
+ {:name => "Layouts", :url => layouts_link}
+ end
+
+ def league_tournaments_crumb(league)
+ {:name => "Tournaments", :url => league_tournaments_link(league)}
+ end
+
+ def league_tournament_crumb(league, tournament)
+ {:name => tournament.formatted_start, :url => league_tournament_link(league, tournament)}
+ end
+
+ def leagues_crumb
+ {:name => "Leagues", :url => leagues_link}
+ end
+
+ def league_crumb (league)
+ {:name => league.name, :url => league_link(league) }
+ end
+
+ def players_crumb
+ {:name => "Players", :url => players_link}
+ end
+
+ def player_crumb(player)
+ {:name => "Players", :url => player_link(player)}
+ end
+
+ def session_crumb
+ {:name => "Log In", :url => ""}
+ end
+
+ def tournaments_crumb
+ {:name => "Tournaments", :url => tournaments_link}
+ end
+
+ def tournament_crumb(tournament)
+ {:name => "#{tournament.league.name} @ #{tournament.formatted_start}"}
+ end
+
+ def tournament_entries_crumb(entry)
+ {:name => "Tournament Entries", :url => tournament_entries_link(entry)}
+ end
+
+ def tournament_entry_crumb(tournament, entry)
+ {:name => "Entry", :url => tournament_entries_link(@tournament)}
+ end
+
end