improve Your Items copy given the different groups

This commit is contained in:
Emi Matchu 2011-07-26 18:41:15 -04:00
parent c3279f0512
commit c592459d02
6 changed files with 79 additions and 64 deletions

View file

@ -1,8 +1,8 @@
require 'cgi' require 'cgi'
module ClosetHangersHelper module ClosetHangersHelper
def closet_hanger_verb(owned) def closet_hanger_verb(owned, positive=true)
ClosetHanger.verb(closet_hanger_subject, owned) ClosetHanger.verb(closet_hanger_subject, owned, positive)
end end
def send_neomail_url(user) def send_neomail_url(user)

View file

@ -15,9 +15,9 @@ class ClosetHanger < ActiveRecord::Base
self.class.verb(subject, owned?) self.class.verb(subject, owned?)
end end
def self.verb(subject, owned) def self.verb(subject, owned, positive=true)
base = (owned) ? 'own' : 'want' base = (owned) ? 'own' : 'want'
base << 's' unless subject == :you base << 's' if positive && subject != :you
base base
end end
end end

View file

@ -52,15 +52,17 @@ body.closet_hangers-index
&:after &:after
content: ":" content: ":"
#edit-contact-link, #cancel-contact-link #edit-contact-link-to-replace-form, #cancel-contact-link
cursor: pointer
display: none display: none
.edit-contact-link, #cancel-contact-link
cursor: pointer
text-decoration: underline text-decoration: underline
&:hover &:hover
text-decoration: none text-decoration: none
#edit-contact-link #edit-contact-link-to-replace-form
#contact-link-has-value #contact-link-has-value
display: none display: none
@ -178,14 +180,14 @@ body.closet_hangers-index
form form
display: none display: none
#edit-contact-link, #cancel-contact-link .edit-contact-link, #cancel-contact-link
display: inline display: inline
&.editing &.editing
form form
display: block display: block
#edit-contact-link .edit-contact-link
display: none display: none
.closet-hangers-group .closet-hangers-group

View file

@ -15,7 +15,7 @@
- if @user.neopets_username? - if @user.neopets_username?
= link_to "Neomail #{@user.neopets_username}", send_neomail_url(@user) = link_to "Neomail #{@user.neopets_username}", send_neomail_url(@user)
- else - else
%span#edit-contact-link{:class => @user.neopets_username? ? 'has-value' : nil} %span#edit-contact-link-to-replace-form.edit-contact-link{:class => @user.neopets_username? ? 'has-value' : nil}
%span#contact-link-no-value %span#contact-link-no-value
Add your Neopets username Add your Neopets username
%span#contact-link-has-value %span#contact-link-has-value
@ -37,7 +37,11 @@
%p %p
You can share You can share
= link_to "this page", request.fullpath = link_to "this page", request.fullpath
with the world, and they'll be able to see what items you own. with the world, and they'll be able to see what items you own and want.
It's also a good idea to
%span.edit-contact-link add your Neopets username
so that when other users see your items they will know how to contact you for
trades.
#closet-hangers{:class => public_perspective? ? nil : 'current-user'} #closet-hangers{:class => public_perspective? ? nil : 'current-user'}
- [true, false].each do |owned| - [true, false].each do |owned|
@ -52,20 +56,26 @@
.closet-hangers-group-content .closet-hangers-group-content
- if public_perspective? - if public_perspective?
- unless @closet_hangers_by_owned[owned] - unless @closet_hangers_by_owned[owned]
%p #{@user.name} hasn't tracked any items on Dress to Impress. %p #{@user.name} doesn't seem to #{closet_hanger_verb(owned, false)} anything.
- else - else
- unless @closet_hangers_by_owned[owned] - unless @closet_hangers_by_owned[owned]
%p %p
You haven't tracked any #{closet_hanger_verb(owned)} items on Dress You haven't tracked any items you #{closet_hanger_verb(owned)} on
to Impress. It's worth doing, since you can share this list with your Dress to Impress. As you browse the site and create outfits, we'll
friends and keep track of what items you still need as you create new use this list to tell you what items you #{closet_hanger_verb(owned)},
outfits. and you can share this page with your friends, too.
%p %p
It's easy to get started! It's easy to get started! Use the search form at the top of the
= link_to "Just import your Neopets closet in a few quick steps.", new_closet_page_path page to find items to add, or add an item from its
You can also add an item from its
= link_to 'Infinite Closet', items_path = link_to 'Infinite Closet', items_path
page. Have fun! page.
- if owned
%p
You can even
= succeed ',' do
= link_to "import your Neopets closet in a few quick steps", new_closet_page_path
so why not?
%p Have fun!
= render_closet_hangers(owned) = render_closet_hangers(owned)
- content_for :stylesheets do - content_for :stylesheets do

View file

@ -240,7 +240,7 @@
*/ */
var contactEl = $('#closet-hangers-contact'); var contactEl = $('#closet-hangers-contact');
var editContactLink = $('#edit-contact-link'); var editContactLink = $('.edit-contact-link');
var contactForm = contactEl.children('form'); var contactForm = contactEl.children('form');
var cancelContactLink = $('#cancel-contact-link'); var cancelContactLink = $('#cancel-contact-link');
var contactFormUsername = contactForm.children('input[type=text]'); var contactFormUsername = contactForm.children('input[type=text]');

View file

@ -646,41 +646,44 @@ body.closet_hangers-index #closet-hangers-contact label:after {
content: ":"; content: ":";
} }
/* line 55, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 55, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #edit-contact-link, body.closet_hangers-index #cancel-contact-link { body.closet_hangers-index #edit-contact-link-to-replace-form, body.closet_hangers-index #cancel-contact-link {
cursor: pointer;
display: none; display: none;
}
/* line 58, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .edit-contact-link, body.closet_hangers-index #cancel-contact-link {
cursor: pointer;
text-decoration: underline; text-decoration: underline;
} }
/* line 60, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 62, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #edit-contact-link:hover, body.closet_hangers-index #cancel-contact-link:hover { body.closet_hangers-index .edit-contact-link:hover, body.closet_hangers-index #cancel-contact-link:hover {
text-decoration: none; text-decoration: none;
} }
/* line 64, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 66, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #edit-contact-link #contact-link-has-value { body.closet_hangers-index #edit-contact-link-to-replace-form #contact-link-has-value {
display: none; display: none;
} }
/* line 67, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 69, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #edit-contact-link #contact-link-no-value { body.closet_hangers-index #edit-contact-link-to-replace-form #contact-link-no-value {
display: inline; display: inline;
} }
/* line 71, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 73, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #edit-contact-link.has-value #contact-link-has-value { body.closet_hangers-index #edit-contact-link-to-replace-form.has-value #contact-link-has-value {
display: inline; display: inline;
} }
/* line 74, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 76, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #edit-contact-link.has-value #contact-link-no-value { body.closet_hangers-index #edit-contact-link-to-replace-form.has-value #contact-link-no-value {
display: none; display: none;
} }
/* line 77, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 79, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #cancel-contact-link { body.closet_hangers-index #cancel-contact-link {
margin-left: 1em; margin-left: 1em;
} }
/* line 80, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 82, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #closet-hangers { body.closet_hangers-index #closet-hangers {
clear: both; clear: both;
text-align: center; text-align: center;
} }
/* line 85, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 87, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #closet-hangers .object .quantity { body.closet_hangers-index #closet-hangers .object .quantity {
-moz-opacity: 0.75; -moz-opacity: 0.75;
-webkit-opacity: 0.75; -webkit-opacity: 0.75;
@ -694,16 +697,16 @@ body.closet_hangers-index #closet-hangers .object .quantity {
text-align: left; text-align: left;
top: 60px; top: 60px;
} }
/* line 95, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 97, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #closet-hangers .object .quantity span, body.closet_hangers-index #closet-hangers .object .quantity input[type=number] { body.closet_hangers-index #closet-hangers .object .quantity span, body.closet_hangers-index #closet-hangers .object .quantity input[type=number] {
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
/* line 99, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 101, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #closet-hangers .object form { body.closet_hangers-index #closet-hangers .object form {
display: none; display: none;
} }
/* line 102, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 104, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index header { body.closet_hangers-index header {
border-bottom: 1px solid #aaddaa; border-bottom: 1px solid #aaddaa;
display: block; display: block;
@ -711,12 +714,12 @@ body.closet_hangers-index header {
padding: 0.25em 0; padding: 0.25em 0;
position: relative; position: relative;
} }
/* line 109, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 111, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index header h3 { body.closet_hangers-index header h3 {
font-size: 250%; font-size: 250%;
margin: 0; margin: 0;
} }
/* line 113, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 115, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index header span.show, body.closet_hangers-index header span.hide { body.closet_hangers-index header span.show, body.closet_hangers-index header span.hide {
color: #448844; color: #448844;
display: none; display: none;
@ -725,28 +728,28 @@ body.closet_hangers-index header span.show, body.closet_hangers-index header spa
right: 1em; right: 1em;
bottom: 0; bottom: 0;
} }
/* line 122, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 124, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index header:hover span.show, body.closet_hangers-index header:hover span.hide { body.closet_hangers-index header:hover span.show, body.closet_hangers-index header:hover span.hide {
color: inherit; color: inherit;
text-decoration: underline; text-decoration: underline;
} }
/* line 126, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 128, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group { body.closet_hangers-index .closet-hangers-group {
border-top: 1px solid #006600; border-top: 1px solid #006600;
margin-bottom: 2em; margin-bottom: 2em;
padding-bottom: 1em; padding-bottom: 1em;
} }
/* line 134, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 136, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover form { body.closet_hangers-index.current-user #closet-hangers .object:hover form {
display: inline; display: inline;
} }
/* line 137, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 139, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .closet-hanger-destroy { body.closet_hangers-index.current-user #closet-hangers .object:hover .closet-hanger-destroy {
position: absolute; position: absolute;
right: 18px; right: 18px;
top: 0; top: 0;
} }
/* line 142, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 144, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .closet-hanger-destroy input { body.closet_hangers-index.current-user #closet-hangers .object:hover .closet-hanger-destroy input {
/* http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html */ /* http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html */
-moz-border-radius: 5px; -moz-border-radius: 5px;
@ -787,7 +790,7 @@ body.closet_hangers-index.current-user #closet-hangers .object:hover .closet-han
body.closet_hangers-index.current-user #closet-hangers .object:hover .closet-hanger-destroy input:hover { body.closet_hangers-index.current-user #closet-hangers .object:hover .closet-hanger-destroy input:hover {
background-color: #999999; background-color: #999999;
} }
/* line 145, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 147, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity { body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity {
-moz-opacity: 1; -moz-opacity: 1;
-webkit-opacity: 1; -webkit-opacity: 1;
@ -797,65 +800,65 @@ body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity {
top: 56px; top: 56px;
padding: 0; padding: 0;
} }
/* line 151, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 153, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity span { body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity span {
display: none; display: none;
} }
/* line 154, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 156, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity input[type=number] { body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity input[type=number] {
padding: 2px; padding: 2px;
width: 2em; width: 2em;
} }
/* line 158, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 160, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity input[type=submit] { body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity input[type=submit] {
font-size: 85%; font-size: 85%;
} }
/* line 164, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 166, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object:hover .quantity input[type=number] { body.closet_hangers-index.current-user.js #closet-hangers .object:hover .quantity input[type=number] {
width: 2.5em; width: 2.5em;
} }
/* line 167, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 169, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object:hover .quantity input[type=submit] { body.closet_hangers-index.current-user.js #closet-hangers .object:hover .quantity input[type=submit] {
display: none; display: none;
} }
/* line 170, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 172, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object.loading { body.closet_hangers-index.current-user.js #closet-hangers .object.loading {
background: #eeffee; background: #eeffee;
outline: 1px solid #006600; outline: 1px solid #006600;
} }
/* line 174, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 176, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object.loading .quantity span:after { body.closet_hangers-index.current-user.js #closet-hangers .object.loading .quantity span:after {
content: "…"; content: "…";
} }
/* line 178, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 180, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers-contact form { body.closet_hangers-index.current-user.js #closet-hangers-contact form {
display: none; display: none;
} }
/* line 181, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 183, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers-contact #edit-contact-link, body.closet_hangers-index.current-user.js #closet-hangers-contact #cancel-contact-link { body.closet_hangers-index.current-user.js #closet-hangers-contact .edit-contact-link, body.closet_hangers-index.current-user.js #closet-hangers-contact #cancel-contact-link {
display: inline; display: inline;
} }
/* line 185, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 187, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers-contact.editing form { body.closet_hangers-index.current-user.js #closet-hangers-contact.editing form {
display: block; display: block;
} }
/* line 188, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 190, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers-contact.editing #edit-contact-link { body.closet_hangers-index.current-user.js #closet-hangers-contact.editing .edit-contact-link {
display: none; display: none;
} }
/* line 192, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 194, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js .closet-hangers-group header { body.closet_hangers-index.current-user.js .closet-hangers-group header {
cursor: pointer; cursor: pointer;
} }
/* line 195, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 197, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js .closet-hangers-group header .hide { body.closet_hangers-index.current-user.js .closet-hangers-group header .hide {
display: block; display: block;
} }
/* line 199, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 201, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js .closet-hangers-group.hidden header .hide, body.closet_hangers-index.current-user.js .closet-hangers-group.hidden .closet-hangers-group-content { body.closet_hangers-index.current-user.js .closet-hangers-group.hidden header .hide, body.closet_hangers-index.current-user.js .closet-hangers-group.hidden .closet-hangers-group-content {
display: none; display: none;
} }
/* line 202, ../../../app/stylesheets/closet_hangers/_index.sass */ /* line 204, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js .closet-hangers-group.hidden header .show { body.closet_hangers-index.current-user.js .closet-hangers-group.hidden header .show {
display: block; display: block;
} }