Sha256: 867fdfb5e4ded49be75865a77f7b2ce464f6d4f5ef2b9aaa523f083d34893e64
Contents?: true
Size: 770 Bytes
Versions: 32
Compression:
Stored size: 770 Bytes
Contents
module TagFilter def link_to_tag(label, tag) "<a title=\"Show tag #{tag}\" href=\"/collections/#{@context['handle']}/#{tag}\">#{label}</a>" end def highlight_active_tag(tag, css_class='active') if @context['current_tags'].include?(tag) "<span class=\"#{css_class}\">#{tag}</span>" else tag end end def link_to_add_tag(label, tag) tags = (@context['current_tags'] + [tag]).uniq "<a title=\"Show tag #{tag}\" href=\"/collections/#{@context['handle']}/#{tags.join("+")}\">#{label}</a>" end def link_to_remove_tag(label, tag) tags = (@context['current_tags'] - [tag]).uniq "<a title=\"Show tag #{tag}\" href=\"/collections/#{@context['handle']}/#{tags.join("+")}\">#{label}</a>" end end
Version data entries
32 entries across 32 versions & 3 rubygems