From 99e59a2f9b346610a187780a677e5edb9e326f4f Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 15 Jul 2011 19:29:43 -0400 Subject: [PATCH] oops. quantity form only shows on current user closet --- app/stylesheets/closet_hangers/_index.sass | 3 ++- .../closet_hangers/_closet_hanger.html.haml | 11 +++++----- app/views/closet_hangers/index.html.haml | 2 +- public/stylesheets/compiled/screen.css | 20 +++++++++---------- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/app/stylesheets/closet_hangers/_index.sass b/app/stylesheets/closet_hangers/_index.sass index 2d8aafbc..6737d1f4 100644 --- a/app/stylesheets/closet_hangers/_index.sass +++ b/app/stylesheets/closet_hangers/_index.sass @@ -34,7 +34,8 @@ body.closet_hangers-index font-size: 16px font-weight: bold - &:hover + &.current-user + .object:hover .quantity +opacity(1) top: $object-img-size - 30px diff --git a/app/views/closet_hangers/_closet_hanger.html.haml b/app/views/closet_hangers/_closet_hanger.html.haml index 5c767cbd..31c48471 100644 --- a/app/views/closet_hangers/_closet_hanger.html.haml +++ b/app/views/closet_hangers/_closet_hanger.html.haml @@ -1,9 +1,10 @@ .object = render :partial => 'items/item_link', :locals => {:item => closet_hanger.item} .quantity - %span{:title => "You own #{pluralize closet_hanger.quantity, closet_hanger.item.name}"}= closet_hanger.quantity - = form_for closet_hanger, :url => user_item_closet_hanger_path(current_user, closet_hanger.item) do |f| - = hidden_field_tag :return_to, request.fullpath - = f.number_field :quantity, :min => 0, :required => true, :title => "You own #{pluralize closet_hanger.quantity, closet_hanger.item.name}" - = f.submit "Save" + %span= closet_hanger.quantity + - if user_is?(closet_hanger.user) + = form_for closet_hanger, :url => user_item_closet_hanger_path(current_user, closet_hanger.item) do |f| + = hidden_field_tag :return_to, request.fullpath + = f.number_field :quantity, :min => 0, :required => true, :title => "You own #{pluralize closet_hanger.quantity, closet_hanger.item.name}" + = f.submit "Save" diff --git a/app/views/closet_hangers/index.html.haml b/app/views/closet_hangers/index.html.haml index 7a9bf0b8..df705da8 100644 --- a/app/views/closet_hangers/index.html.haml +++ b/app/views/closet_hangers/index.html.haml @@ -4,7 +4,7 @@ = link_to "Import closet from Neopets", new_closet_page_path, :id => 'import-link' - else - title "#{@user.name}'s Items" -#closet-hangers +#closet-hangers{:class => user_is?(@user) ? 'current-user' : nil} - if !@closet_hangers.empty? = render @closet_hangers - else diff --git a/public/stylesheets/compiled/screen.css b/public/stylesheets/compiled/screen.css index dd0f88db..42aca470 100644 --- a/public/stylesheets/compiled/screen.css +++ b/public/stylesheets/compiled/screen.css @@ -623,29 +623,29 @@ body.closet_hangers-index #closet-hangers .object .quantity span, body.closet_ha font-size: 16px; font-weight: bold; } -/* line 38, ../../../app/stylesheets/closet_hangers/_index.sass */ -body.closet_hangers-index #closet-hangers .object:hover .quantity { +/* line 39, ../../../app/stylesheets/closet_hangers/_index.sass */ +body.closet_hangers-index #closet-hangers.current-user .object:hover .quantity { -moz-opacity: 1; -webkit-opacity: 1; -o-opacity: 1; -khtml-opacity: 1; top: 50px; } -/* line 42, ../../../app/stylesheets/closet_hangers/_index.sass */ -body.closet_hangers-index #closet-hangers .object:hover .quantity span { +/* line 43, ../../../app/stylesheets/closet_hangers/_index.sass */ +body.closet_hangers-index #closet-hangers.current-user .object:hover .quantity span { display: none; } -/* line 45, ../../../app/stylesheets/closet_hangers/_index.sass */ -body.closet_hangers-index #closet-hangers .object:hover .quantity form { +/* line 46, ../../../app/stylesheets/closet_hangers/_index.sass */ +body.closet_hangers-index #closet-hangers.current-user .object:hover .quantity form { display: inline; } -/* line 48, ../../../app/stylesheets/closet_hangers/_index.sass */ -body.closet_hangers-index #closet-hangers .object:hover .quantity form input[type=number] { +/* line 49, ../../../app/stylesheets/closet_hangers/_index.sass */ +body.closet_hangers-index #closet-hangers.current-user .object:hover .quantity form input[type=number] { padding: 2px; width: 2em; } -/* line 52, ../../../app/stylesheets/closet_hangers/_index.sass */ -body.closet_hangers-index #closet-hangers .object:hover .quantity input[type=submit] { +/* line 53, ../../../app/stylesheets/closet_hangers/_index.sass */ +body.closet_hangers-index #closet-hangers.current-user .object:hover .quantity input[type=submit] { font-size: 85%; }