better handle edge cases in petpages

This commit is contained in:
Emi Matchu 2011-07-31 03:03:26 -04:00
parent 1ac399cc7a
commit 359356bcf3

View file

@ -77,20 +77,22 @@
- if lists || unlisted_hangers_by_owned[owned] - if lists || unlisted_hangers_by_owned[owned]
%h2.dti-item-group-header Items #OWNER #{ClosetHanger.verb(:someone, owned)} %h2.dti-item-group-header Items #OWNER #{ClosetHanger.verb(:someone, owned)}
%ul.dti-item-group %ul.dti-item-group
- lists.each do |list| - if lists
- unless list.hangers.empty? - lists.each do |list|
%li.dti-item-list - unless list.hangers.empty?
%h3= list.name %li.dti-item-list
- if list.description? %h3= list.name
.dti-item-list-desc - if list.description?
= closet_list_description_format list .dti-item-list-desc
%div.dti-items = closet_list_description_format list
= render_batched_petpage_hangers(list.hangers.sort { |a,b| a.item.name <=> b.item.name }) %div.dti-items
%li.dti-unlisted-items = render_batched_petpage_hangers(list.hangers.sort { |a,b| a.item.name <=> b.item.name })
- unless lists.empty? - if unlisted_hangers_by_owned[owned]
%h3 (Not in a list) %li.dti-unlisted-items
%div - unless lists.blank?
= render_batched_petpage_hangers(unlisted_hangers_by_owned[owned]) %h3 (Not in a list)
%div
= render_batched_petpage_hangers(unlisted_hangers_by_owned[owned])
#dti-item-footer #dti-item-footer
I made this list on Dress to Impress. You can, too! I made this list on Dress to Impress. You can, too!