Class: Viewable::LinkListPresenter
Instance Attribute Summary
#context, #list
Instance Method Summary
collapse
#add_link, #edit_links, #initialize, #sortable, #sortable_html, #ul_sortable_tag
#initialize
Instance Method Details
#active_link ⇒ Object
23
24
25
26
27
28
|
# File 'app/presenters/viewable/link_list_presenter.rb', line 23
def active_link
@active_link ||= begin
breadcrumbs
@active_link
end
end
|
19
20
21
|
# File 'app/presenters/viewable/link_list_presenter.rb', line 19
def
!!active_link
end
|
#breadcrumbs ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'app/presenters/viewable/link_list_presenter.rb', line 30
def breadcrumbs
@breadcrumbs ||= begin
@active_link = nil
take_while do |link|
if link.active?
@active_link = link
false
else
true
end
end
end
end
|
12
13
14
15
16
17
|
# File 'app/presenters/viewable/link_list_presenter.rb', line 12
def
each do |link|
h.concat link.li_link_to_with_edit
end
h.concat(add_link) if h.cms_edit_mode?
end
|
3
4
5
6
7
8
9
10
|
# File 'app/presenters/viewable/link_list_presenter.rb', line 3
def (name)
h.content_tag :li do
h.concat h.active_link_to(name, '#', active: )
h.concat(h.content_tag(:ul, sortable) do
end)
end
end
|