From e6020a5cfe338161473f59f848a5df0959ad1fa1 Mon Sep 17 00:00:00 2001 From: Matchu Date: Fri, 15 Jul 2011 16:32:05 -0400 Subject: [PATCH] simplify closeting item --- app/controllers/items_controller.rb | 2 +- app/stylesheets/items/_show.sass | 9 ++++++--- app/views/items/show.html.haml | 17 ++++++++++++----- public/stylesheets/compiled/screen.css | 22 +++++++++++----------- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index a5f6a142..b5e12c80 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -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 diff --git a/app/stylesheets/items/_show.sass b/app/stylesheets/items/_show.sass index 6443f295..7bc4d7d6 100644 --- a/app/stylesheets/items/_show.sass +++ b/app/stylesheets/items/_show.sass @@ -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 + diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index 81c99120..201982d5 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -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 →'.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 →'.html_safe, user_closet_hangers_path(current_user), :id => 'closet-hanger-form-your-items' %p= @item.description #item-zones diff --git a/public/stylesheets/compiled/screen.css b/public/stylesheets/compiled/screen.css index 7d7a0fc8..d6d5953a 100644 --- a/public/stylesheets/compiled/screen.css +++ b/public/stylesheets/compiled/screen.css @@ -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;