fixed the specs.
This commit is contained in:
parent
5f592f9616
commit
f5e3c4c0d7
1 changed files with 29 additions and 0 deletions
|
|
@ -9,6 +9,35 @@ module AspectGlobalHelper
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def aspect_badges(aspects, opts={})
|
||||||
|
str = ''
|
||||||
|
aspects.each do |aspect|
|
||||||
|
str << aspect_badge(aspect, opts)
|
||||||
|
end
|
||||||
|
str.html_safe
|
||||||
|
end
|
||||||
|
|
||||||
|
def aspect_badge(aspect, opts={})
|
||||||
|
str = "<span class='aspect_badge single'>"
|
||||||
|
link = opts.delete(:link)
|
||||||
|
if !link
|
||||||
|
str << link_to(aspect.name, "#", 'data-guid' => aspect.id, :class => 'hard_aspect_link').html_safe
|
||||||
|
else
|
||||||
|
str << link_for_aspect(aspect).html_safe
|
||||||
|
end
|
||||||
|
str << "</span>"
|
||||||
|
end
|
||||||
|
|
||||||
|
def aspect_links(aspects, opts={})
|
||||||
|
str = ""
|
||||||
|
aspects.each do |aspect|
|
||||||
|
str << '<li>'
|
||||||
|
str << link_for_aspect(aspect, :params => opts, 'data-guid' => aspect.id, :class => 'hard_aspect_link').html_safe
|
||||||
|
str << '</li>'
|
||||||
|
end
|
||||||
|
str.html_safe
|
||||||
|
end
|
||||||
|
|
||||||
def link_for_aspect(aspect, opts={})
|
def link_for_aspect(aspect, opts={})
|
||||||
opts[:params] ||= {}
|
opts[:params] ||= {}
|
||||||
params ||= {}
|
params ||= {}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue