simplify closeting item

This commit is contained in:
Emi Matchu 2011-07-15 16:32:05 -04:00
parent 47e3b72937
commit e6020a5cfe
4 changed files with 30 additions and 20 deletions

View file

@ -41,7 +41,7 @@ class ItemsController < ApplicationController
@item = Item.find params[:id]
if user_signed_in?
@hanger = current_user.closet_hangers.find_or_initialize_by_item_id(@item.id)
@hanger.quantity ||= 0
@hanger.quantity ||= 1
end
end

View file

@ -1,5 +1,5 @@
body.items-show
header
#item-header
border-bottom: 1px solid $module-border-color
display: block
margin-bottom: 1em
@ -70,15 +70,18 @@ body.items-show
padding: 1em .5em .5em
width: 18em
label
label, header
display: block
font-weight: bold
input[type=number]
width: 4em
a
#closet-hanger-form-your-items
display: block
margin-top: .5em
text-align: right
p
font-family: $main-font

View file

@ -3,7 +3,7 @@
%link{:rel => 'canonical', :href => url_for(@item)}
- cache "items_show_#{@item.id}_main_content" do
%header
%header#item-header
= image_tag @item.thumbnail_url, :id => 'item-thumbnail'
%div
%h2#item-name= @item.name
@ -14,10 +14,17 @@
- if @hanger
= form_for(@hanger, :url => user_item_closet_hanger_path(current_user, @item), :html => {:id => 'closet-hanger-form'}) do |f|
= f.label :quantity, "How many of these do you own?"
= f.number_field :quantity, :min => 0, :required => true
= f.submit "Save"
= link_to 'Your Items &rarr;'.html_safe, user_closet_hangers_path(current_user)
- if @hanger.new_record?
%header Do you own this item?
%p
We can help you track your closet.
= f.hidden_field :quantity
= f.submit "I own this item!"
- else
= f.label :quantity, "How many of these do you own?"
= f.number_field :quantity, :min => 0, :required => true
= f.submit "Save"
= link_to 'Your Items &rarr;'.html_safe, user_closet_hangers_path(current_user), :id => 'closet-hanger-form-your-items'
%p= @item.description
#item-zones

View file

@ -834,14 +834,14 @@ body.items-index #species-search-links img {
}
/* line 2, ../../../app/stylesheets/items/_show.sass */
body.items-show header {
body.items-show #item-header {
border-bottom: 1px solid #006600;
display: block;
margin-bottom: 1em;
padding: 1em 0;
}
/* line 7, ../../../app/stylesheets/items/_show.sass */
body.items-show header div, body.items-show header img {
body.items-show #item-header div, body.items-show #item-header img {
display: -moz-inline-box;
-moz-box-orient: vertical;
display: inline-block;
@ -850,11 +850,11 @@ body.items-show header div, body.items-show header img {
*vertical-align: auto;
}
/* line 9, ../../../app/stylesheets/items/_show.sass */
body.items-show header div {
body.items-show #item-header div {
text-align: left;
}
/* line 11, ../../../app/stylesheets/items/_show.sass */
body.items-show header a {
body.items-show #item-header a {
font-size: 75%;
margin-left: 1em;
}
@ -961,7 +961,7 @@ body.items-show #closet-hanger-form {
width: 18em;
}
/* line 73, ../../../app/stylesheets/items/_show.sass */
body.items-show #closet-hanger-form label {
body.items-show #closet-hanger-form label, body.items-show #closet-hanger-form header {
display: block;
font-weight: bold;
}
@ -970,11 +970,15 @@ body.items-show #closet-hanger-form input[type=number] {
width: 4em;
}
/* line 80, ../../../app/stylesheets/items/_show.sass */
body.items-show #closet-hanger-form a {
body.items-show #closet-hanger-form #closet-hanger-form-your-items {
display: block;
margin-top: 0.5em;
text-align: right;
}
/* line 85, ../../../app/stylesheets/items/_show.sass */
body.items-show #closet-hanger-form p {
font-family: "Droid Sans", Helvetica, Arial, Verdana, sans-serif;
}
@import url(../shared/jquery.jgrowl.css);
/* line 112, ../../../app/stylesheets/outfits/_edit.sass */
@ -1545,11 +1549,7 @@ body.outfits-edit .object:hover ul, body.outfits-edit .object:hover .object-info
}
/* line 415, ../../../app/stylesheets/outfits/_edit.sass */
body.outfits-edit .nc-icon {
<<<<<<< HEAD
background: url('/images/nc.png?1310662236') no-repeat;
=======
background: url('/images/nc.png?1310533288') no-repeat;
>>>>>>> closeted icon, all over the place
background: url('/images/nc.png?1310666180') no-repeat;
height: 16px;
position: absolute;
right: 16px;