diff --git a/app/helpers/aspect_global_helper.rb b/app/helpers/aspect_global_helper.rb index 4398183f5..dac264005 100644 --- a/app/helpers/aspect_global_helper.rb +++ b/app/helpers/aspect_global_helper.rb @@ -9,6 +9,35 @@ module AspectGlobalHelper 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 = "" + 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 << "" + end + + def aspect_links(aspects, opts={}) + str = "" + aspects.each do |aspect| + str << '
  • ' + str << link_for_aspect(aspect, :params => opts, 'data-guid' => aspect.id, :class => 'hard_aspect_link').html_safe + str << '
  • ' + end + str.html_safe + end + def link_for_aspect(aspect, opts={}) opts[:params] ||= {} params ||= {}