1
0
Fork 0
forked from OpenNeo/impress

i18n for outfits/edit.js item partials: no-data-yet and icons

This commit is contained in:
Emi Matchu 2013-01-07 18:55:36 -06:00
parent c3ebfee2e4
commit 59a5c60f3b
4 changed files with 33 additions and 34 deletions

View file

@ -151,6 +151,26 @@
%a.outfit-delete-confirmation-no{:href => '#'} %a.outfit-delete-confirmation-no{:href => '#'}
= t '.sidebar.outfits.outfit.delete_confirmation.cancel' = t '.sidebar.outfits.outfit.delete_confirmation.cancel'
</li> </li>
%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 %span#userbar-session-message
- if user_signed_in? - if user_signed_in?

View file

@ -486,6 +486,7 @@ en-meep:
success: Outfeet successfully meeped success: Outfeet successfully meeped
closet: closet:
no_data: no_data:
summary: No meepits yet
description: description:
We haven't meeped this item on this body type before. Have you? We haven't meeped this item on this body type before. Have you?
Meep it for us on the home page if you have! Meep it for us on the home page if you have!

View file

@ -487,6 +487,7 @@ en:
success: Outfit successfully saved success: Outfit successfully saved
closet: closet:
no_data: no_data:
summary: No data yet
description: description:
We haven't seen this item on this body type before. Have you? We haven't seen this item on this body type before. Have you?
Model it for us on the home page if you have! Model it for us on the home page if you have!

View file

@ -26,7 +26,7 @@ var Partial = {}, main_wardrobe,
Partial.ItemSet = function ItemSet(wardrobe, selector) { Partial.ItemSet = function ItemSet(wardrobe, selector) {
var item_set = this, ul = $(selector), items = [], setClosetItems, var item_set = this, ul = $(selector), items = [], setClosetItems,
setOutfitItems, setOutfitItemsControls, no_assets_full_message = $('#no-assets-full-message'), setOutfitItems, setOutfitItemsControls, no_assets_full_message = $('#no-assets-full-message'),
container = $('#container'); container = $('#container'), item_template = $('#item-template');
Partial.ItemSet.setWardrobe(wardrobe); Partial.ItemSet.setWardrobe(wardrobe);
@ -59,13 +59,6 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) {
item = specific_items[i]; item = specific_items[i];
no_assets = item.couldNotLoadAssetsFitting(wardrobe.outfits.getPetType()); no_assets = item.couldNotLoadAssetsFitting(wardrobe.outfits.getPetType());
li = $('li.object-' + item.id).toggleClass('no-assets', no_assets); 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) {
$('<span/>', {'class': 'no-assets-message', text: 'No data yet'}).appendTo(li);
}
})(li);
} }
} }
@ -75,33 +68,17 @@ Partial.ItemSet = function ItemSet(wardrobe, selector) {
ul.children().remove(); ul.children().remove();
for(var i = 0; i < items.length; i++) { for(var i = 0; i < items.length; i++) {
item = items[i]; item = items[i];
li = $('<li/>', {'class': 'object object-' + item.id}); li = item_template.tmpl({
img = $('<img/>', { id: item.id,
'src': item.thumbnail_url, name: item.name,
'alt': item.description, thumbnail_url: item.thumbnail_url,
'title': item.description url: item.getURL(),
nc: typeof item.rarity_index != 'undefined' &&
(item.rarity_index == 500 || item.rarity_index == 0),
owned: item.owned,
wanted: item.wanted
}); });
controls = $('<ul/>'); li.appendTo(ul);
info_link = $('<a/>', {
'class': 'object-info',
html: '<span>i</span>',
href: item.getURL(),
target: '_blank'
});
if(
typeof item.rarity_index != 'undefined' &&
(item.rarity_index == 500 || item.rarity_index == 0)
) {
$('<div/>', {'class': 'nc-icon', text: 'NC', title: 'NC'}).appendTo(li);
}
if(item.owned || item.wanted) {
var iconsWrapper = $('<div/>', {'class': 'closeted-icons'}).appendTo(li);
if(item.owned) {
$('<img/>', {alt: 'Own', title: 'You own this', src: '/images/owned.png'}).appendTo(iconsWrapper);
$('<img/>', {alt: 'Want', title: 'You want this', src: '/images/wanted.png'}).appendTo(iconsWrapper);
}
}
li.append(img).append(controls).append(info_link).append(item.name).appendTo(ul);
} }
setClosetItems(wardrobe.outfits.getClosetItems()); setClosetItems(wardrobe.outfits.getClosetItems());
setOutfitItems(wardrobe.outfits.getWornItems()); setOutfitItems(wardrobe.outfits.getWornItems());