Skip to content

Commit e89ebec

Browse files
authored
Merge pull request #959 from amatsuda/more_nav_helpers
Move helper methods for nav to the dedicated place
2 parents b074c3c + d0e57a8 commit e89ebec

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

app/controllers/application_controller.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ class ApplicationController < ActionController::Base
88

99
helper_method :current_event
1010
helper_method :current_website
11-
helper_method :display_staff_event_subnav?
12-
helper_method :display_staff_selection_subnav?
13-
helper_method :display_staff_program_subnav?
14-
helper_method :display_website_subnav?
1511
helper_method :program_mode?
1612
helper_method :schedule_mode?
1713
helper_method :program_tracks
@@ -150,34 +146,18 @@ def enable_staff_event_subnav
150146
@display_staff_subnav = true
151147
end
152148

153-
def display_staff_event_subnav?
154-
@display_staff_subnav
155-
end
156-
157149
def enable_staff_selection_subnav
158150
@display_selection_subnav = true
159151
end
160152

161-
def display_staff_selection_subnav?
162-
@display_selection_subnav
163-
end
164-
165153
def enable_staff_program_subnav
166154
@display_program_subnav = true
167155
end
168156

169-
def display_staff_program_subnav?
170-
@display_program_subnav
171-
end
172-
173157
def enable_staff_schedule_subnav
174158
@display_schedule_subnav = true
175159
end
176160

177-
def display_website_subnav?
178-
@display_website_subnav
179-
end
180-
181161
def enable_website_subnav
182162
@display_website_subnav = true
183163
end

app/helpers/navbar_helper.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,20 @@ def nav_item_class(key)
7070
def subnav_item_class(key)
7171
'active' if @active_subnav_key == key
7272
end
73+
74+
def display_staff_event_subnav?
75+
@display_staff_subnav
76+
end
77+
78+
def display_staff_selection_subnav?
79+
@display_selection_subnav
80+
end
81+
82+
def display_staff_program_subnav?
83+
@display_program_subnav
84+
end
85+
86+
def display_website_subnav?
87+
@display_website_subnav
88+
end
7389
end

0 commit comments

Comments
 (0)