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] @item = Item.find params[:id]
if user_signed_in? if user_signed_in?
@hanger = current_user.closet_hangers.find_or_initialize_by_item_id(@item.id) @hanger = current_user.closet_hangers.find_or_initialize_by_item_id(@item.id)
@hanger.quantity ||= 0 @hanger.quantity ||= 1
end end
end end

View file

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

View file

@ -3,7 +3,7 @@
%link{:rel => 'canonical', :href => url_for(@item)} %link{:rel => 'canonical', :href => url_for(@item)}
- cache "items_show_#{@item.id}_main_content" do - cache "items_show_#{@item.id}_main_content" do
%header %header#item-header
= image_tag @item.thumbnail_url, :id => 'item-thumbnail' = image_tag @item.thumbnail_url, :id => 'item-thumbnail'
%div %div
%h2#item-name= @item.name %h2#item-name= @item.name
@ -14,10 +14,17 @@
- if @hanger - if @hanger
= form_for(@hanger, :url => user_item_closet_hanger_path(current_user, @item), :html => {:id => 'closet-hanger-form'}) do |f| = 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?" - if @hanger.new_record?
= f.number_field :quantity, :min => 0, :required => true %header Do you own this item?
= f.submit "Save" %p
= link_to 'Your Items &rarr;'.html_safe, user_closet_hangers_path(current_user) 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 %p= @item.description
#item-zones #item-zones

View file

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