diff --git a/app/views/outfits/edit.html.haml b/app/views/outfits/edit.html.haml index 7a832842..acbfaad1 100644 --- a/app/views/outfits/edit.html.haml +++ b/app/views/outfits/edit.html.haml @@ -151,6 +151,26 @@ %a.outfit-delete-confirmation-no{:href => '#'} = t '.sidebar.outfits.outfit.delete_confirmation.cancel' + %script#item-template{:type => 'text/x-jquery-tmpl'} + %li{:class => 'object object-${id}'} + %img{:src => '${thumbnail_url}', :title => '${description}', :alt => ''} + ${name} + %ul + = link_to '${url}', :target => '_blank', :class => 'object-info' do + %span i + {{if nc}} + = nc_icon + {{/if}} + {{if owned || wanted}} + .closeted-icons + {{if owned}} + = owned_icon + {{/if}} + {{if wanted}} + = wanted_icon + {{/if}} + {{/if}} + %span.no-assets-message= t '.sidebar.closet.no_data.summary' %span#userbar-session-message - if user_signed_in? diff --git a/config/locales/en-meep.yml b/config/locales/en-meep.yml index b1203972..a98d516a 100644 --- a/config/locales/en-meep.yml +++ b/config/locales/en-meep.yml @@ -486,6 +486,7 @@ en-meep: success: Outfeet successfully meeped closet: no_data: + summary: No meepits yet description: We haven't meeped this item on this body type before. Have you? Meep it for us on the home page if you have! diff --git a/config/locales/en.yml b/config/locales/en.yml index b3e69ca8..3204d6fe 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -487,6 +487,7 @@ en: success: Outfit successfully saved closet: no_data: + summary: No data yet description: We haven't seen this item on this body type before. Have you? Model it for us on the home page if you have! diff --git a/public/javascripts/outfits/edit.js b/public/javascripts/outfits/edit.js index 50d73c4f..58bde75d 100644 --- a/public/javascripts/outfits/edit.js +++ b/public/javascripts/outfits/edit.js @@ -26,7 +26,7 @@ var Partial = {}, main_wardrobe, Partial.ItemSet = function ItemSet(wardrobe, selector) { var item_set = this, ul = $(selector), items = [], setClosetItems, setOutfitItems, setOutfitItemsControls, no_assets_full_message = $('#no-assets-full-message'), - container = $('#container'); + container = $('#container'), item_template = $('#item-template'); Partial.ItemSet.setWardrobe(wardrobe); @@ -59,13 +59,6 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) { item = specific_items[i]; no_assets = item.couldNotLoadAssetsFitting(wardrobe.outfits.getPetType()); li = $('li.object-' + item.id).toggleClass('no-assets', no_assets); - (function (li) { - no_assets_message = li.find('span.no-assets-message'); - no_assets_message.remove(); - if(no_assets) { - $('', {'class': 'no-assets-message', text: 'No data yet'}).appendTo(li); - } - })(li); } } @@ -75,33 +68,17 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) { ul.children().remove(); for(var i = 0; i < items.length; i++) { item = items[i]; - li = $('
', {'class': 'object object-' + item.id}); - img = $('', { - 'src': item.thumbnail_url, - 'alt': item.description, - 'title': item.description + li = item_template.tmpl({ + id: item.id, + name: item.name, + thumbnail_url: item.thumbnail_url, + url: item.getURL(), + nc: typeof item.rarity_index != 'undefined' && + (item.rarity_index == 500 || item.rarity_index == 0), + owned: item.owned, + wanted: item.wanted }); - controls = $('