2011-07-26 17:27:23 -07:00
|
|
|
module ClosetListsHelper
|
2011-07-29 07:52:04 -07:00
|
|
|
def closet_list_description_format(list)
|
|
|
|
md = RDiscount.new(list.description)
|
|
|
|
Sanitize.clean(md.to_html, Sanitize::Config::BASIC).html_safe
|
|
|
|
end
|
|
|
|
|
2011-07-26 17:27:23 -07:00
|
|
|
def hangers_owned_options
|
2013-01-01 18:42:58 -08:00
|
|
|
[
|
2013-01-09 15:38:03 -08:00
|
|
|
[closet_lists_group_name(:you, true), true],
|
|
|
|
[closet_lists_group_name(:you, false), false]
|
2013-01-01 18:42:58 -08:00
|
|
|
]
|
2011-07-26 17:27:23 -07:00
|
|
|
end
|
2011-07-29 07:52:04 -07:00
|
|
|
|
2013-06-22 15:45:59 -07:00
|
|
|
def render_sorted_hangers(list)
|
|
|
|
# TODO: do we still *need* the sort, now that 99% of items are translated?
|
|
|
|
render partial: 'closet_hanger',
|
|
|
|
collection: list.hangers.sort_by(&:item_name)
|
2011-07-29 07:52:04 -07:00
|
|
|
end
|
2011-07-26 17:27:23 -07:00
|
|
|
end
|
|
|
|
|