show owns/wanted items on somene elses items list

This commit is contained in:
Emi Matchu 2011-07-30 23:03:43 -04:00
parent 11b7ae74db
commit b9700e3d7c
6 changed files with 97 additions and 80 deletions

View file

@ -36,6 +36,21 @@ class ClosetHangersController < ApplicationController
else
@unlisted_closet_hangers_by_owned = {}
end
if @public_perspective
items = []
@closet_lists_by_owned.each do |owned, lists|
lists.each do |list|
list.hangers.each { |hanger| items << hanger.item }
end
end
@unlisted_closet_hangers_by_owned.each do |owned, hangers|
hangers.each { |hanger| items << hanger.item }
end
current_user.assign_closeted_to_items!(items)
end
end
# Since the user does not care about the idea of a hanger, but rather the

View file

@ -196,8 +196,9 @@ ul.buttons
.nc-icon
right: ($object-width - $object-img-size) / 2 + $object-padding
$closeted-icons-left: ($object-width - $object-img-size) / 2 + $object-padding
.closeted-icons
left: ($object-width - $object-img-size) / 2 + $object-padding
left: $closeted-icons-left
dt
font-weight: bold

View file

@ -82,12 +82,12 @@ body.closet_hangers-index
.quantity
+opacity(.75)
background: white
padding: 2px 4px
padding: 6px 4px 4px
position: absolute
left: ($object-width - $object-img-size) / 2 + $object-padding
line-height: 1
text-align: left
top: $object-img-size - 20px
top: 0
span, input[type=number]
font-size: 16px
@ -96,8 +96,9 @@ body.closet_hangers-index
form
display: none
.quantity-1
display: none
&[data-quantity="1"]
.quantity
display: none
.closet-hangers-group
border-top: 1px solid $module-border-color
@ -275,7 +276,7 @@ body.closet_hangers-index
.closet-hanger-destroy
position: absolute
right: ($object-width - $object-img-size) / 2 + $object-padding
top: 0
top: $object-img-size - 28px
input
+context-button
@ -283,7 +284,7 @@ body.closet_hangers-index
.quantity
+opacity(1)
background: transparent
top: $object-img-size - 24px
top: 0
padding: 0
span

View file

@ -1,5 +1,5 @@
- show_controls ||= false # we could do user check here, but may as well do it once
.object{'data-item-id' => closet_hanger.item_id}
.object{'data-item-id' => closet_hanger.item_id, 'data-quantity' => closet_hanger.quantity}
= render :partial => 'items/item_link', :locals => {:item => closet_hanger.item}
.quantity{:class => "quantity-#{closet_hanger.quantity}"}
%span= closet_hanger.quantity

View file

@ -156,7 +156,7 @@
var objectWrapper = form.closest(".object").addClass("loading");
var newQuantity = quantityEl.val();
var quantitySpan = objectWrapper.find(".quantity span").text(newQuantity);
quantitySpan.parent().attr('class', 'quantity quantity-' + newQuantity);
objectWrapper.attr('data-quantity', newQuantity);
var data = form.serialize(); // get data before disabling inputs
objectWrapper.disableForms();
form.data('loading', true);

View file

@ -332,22 +332,22 @@ ul.buttons li, ul.buttons li form {
.object .nc-icon {
right: 18px;
}
/* line 199, ../../../app/stylesheets/_layout.sass */
/* line 200, ../../../app/stylesheets/_layout.sass */
.object .closeted-icons {
left: 18px;
}
/* line 202, ../../../app/stylesheets/_layout.sass */
/* line 203, ../../../app/stylesheets/_layout.sass */
dt {
font-weight: bold;
}
/* line 205, ../../../app/stylesheets/_layout.sass */
/* line 206, ../../../app/stylesheets/_layout.sass */
dd {
margin: 0 0 1.5em 1em;
}
/* line 208, ../../../app/stylesheets/_layout.sass */
/* line 209, ../../../app/stylesheets/_layout.sass */
#home-link {
font-family: Delicious, Helvetica, Arial, Verdana, sans-serif;
font-size: 175%;
@ -358,21 +358,21 @@ dd {
position: absolute;
top: 0;
}
/* line 218, ../../../app/stylesheets/_layout.sass */
/* line 219, ../../../app/stylesheets/_layout.sass */
#home-link:hover {
background: #eeffee;
text-decoration: none;
}
/* line 221, ../../../app/stylesheets/_layout.sass */
/* line 222, ../../../app/stylesheets/_layout.sass */
#home-link span:before {
content: "<< ";
}
/* line 225, ../../../app/stylesheets/_layout.sass */
/* line 226, ../../../app/stylesheets/_layout.sass */
.pagination a, .pagination span {
margin: 0 0.5em;
}
/* line 227, ../../../app/stylesheets/_layout.sass */
/* line 228, ../../../app/stylesheets/_layout.sass */
.pagination .current {
font-weight: bold;
}
@ -694,12 +694,12 @@ body.closet_hangers-index #closet-hangers .object .quantity {
-o-opacity: 0.75;
-khtml-opacity: 0.75;
background: white;
padding: 2px 4px;
padding: 6px 4px 4px;
position: absolute;
left: 18px;
line-height: 1;
text-align: left;
top: 60px;
top: 0;
}
/* line 92, ../../../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] {
@ -710,17 +710,17 @@ body.closet_hangers-index #closet-hangers .object .quantity span, body.closet_ha
body.closet_hangers-index #closet-hangers .object form {
display: none;
}
/* line 99, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #closet-hangers .object .quantity-1 {
/* line 100, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index #closet-hangers .object[data-quantity="1"] .quantity {
display: none;
}
/* line 102, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 103, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group {
border-top: 1px solid #006600;
margin-bottom: 2em;
padding-bottom: 1em;
}
/* line 107, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 108, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group > header {
border-bottom: 1px solid #aaddaa;
display: block;
@ -728,12 +728,12 @@ body.closet_hangers-index .closet-hangers-group > header {
padding: 0.25em 0;
position: relative;
}
/* line 114, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 115, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group > header h3 {
font-size: 250%;
margin: 0;
}
/* line 118, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 119, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group > header .add-closet-list {
/* http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html */
-moz-border-radius: 5px;
@ -768,12 +768,12 @@ body.closet_hangers-index .closet-hangers-group > header .add-closet-list:hover
body.closet_hangers-index .closet-hangers-group > header .add-closet-list:active {
top: 1px;
}
/* line 125, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 126, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group > header .add-closet-list:active {
margin-bottom: -1.1em;
top: auto;
}
/* line 129, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 130, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group > header span.show, body.closet_hangers-index .closet-hangers-group > header span.hide {
color: #448844;
display: none;
@ -782,18 +782,18 @@ body.closet_hangers-index .closet-hangers-group > header span.show, body.closet_
position: absolute;
top: 1em;
}
/* line 137, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 138, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group > header span.show:hover, body.closet_hangers-index .closet-hangers-group > header span.hide:hover {
color: inherit;
text-decoration: underline;
}
/* line 141, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 142, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list {
border-bottom: 1px solid #aaddaa;
padding: 0.5em 0;
position: relative;
}
/* line 146, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 147, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .visibility-form {
font-size: 85%;
left: 0.5em;
@ -802,17 +802,17 @@ body.closet_hangers-index .closet-list .visibility-form {
top: 0.25em;
z-index: 10;
}
/* line 154, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 155, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .visibility-form input, body.closet_hangers-index .closet-list .visibility-form select {
font-size: inherit;
margin-bottom: 0;
margin-top: 0;
}
/* line 160, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 161, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .visibility-form select {
border-color: white;
}
/* line 163, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 164, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .visibility-form input[type=submit] {
/* http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html */
-moz-border-radius: 5px;
@ -855,11 +855,11 @@ body.closet_hangers-index .closet-list .visibility-form input[type=submit]:activ
body.closet_hangers-index .closet-list .visibility-form input[type=submit]:hover {
background-color: #999999;
}
/* line 168, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 169, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .visibility-form input[type=submit]:active {
top: 1px;
}
/* line 171, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 172, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .visibility-form .visibility-descriptions {
-moz-opacity: 0.75;
-webkit-opacity: 0.75;
@ -870,20 +870,20 @@ body.closet_hangers-index .closet-list .visibility-form .visibility-descriptions
list-style: none;
padding: 0 0.5em;
}
/* line 178, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 179, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .visibility-form .visibility-descriptions li {
display: none;
}
/* line 182, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 183, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .visibility-form:hover .visibility-descriptions li.current {
display: block;
}
/* line 185, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 186, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list header {
display: block;
position: relative;
}
/* line 189, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 190, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list h4 {
font-family: Delicious, Helvetica, Arial, Verdana, sans-serif;
font-size: 150%;
@ -891,19 +891,19 @@ body.closet_hangers-index .closet-list h4 {
margin: 0 auto 0.67em;
width: 50%;
}
/* line 196, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 197, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .empty-list {
display: none;
font-style: italic;
}
/* line 200, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 201, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .closet-list-controls {
display: none;
position: absolute;
right: 1em;
top: 0;
}
/* line 206, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 207, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .closet-list-controls a, body.closet_hangers-index .closet-list .closet-list-controls input[type=submit] {
/* http://www.zurb.com/blog_uploads/0000/0617/buttons-03.html */
-moz-border-radius: 5px;
@ -944,36 +944,36 @@ body.closet_hangers-index .closet-list .closet-list-controls a:active, body.clos
body.closet_hangers-index .closet-list .closet-list-controls a:hover, body.closet_hangers-index .closet-list .closet-list-controls input[type=submit]:hover {
background-color: #999999;
}
/* line 209, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 210, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list .closet-list-controls form {
display: inline;
}
/* line 213, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 214, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list[data-hangers-count="0"] .empty-list {
display: block;
}
/* line 217, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 218, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list.unlisted h4 {
font-size: 125%;
font-style: italic;
}
/* line 223, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 224, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list:hover .closet-list-controls {
display: block;
}
/* line 227, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 228, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list:hover .visibility-form input[type=submit] {
visibility: visible;
}
/* line 230, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 231, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list:hover .visibility-form select {
border-color: #aaddaa;
}
/* line 233, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 234, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list:last-child {
border-bottom: 0;
}
/* line 236, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 237, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list.droppable-active {
-moz-border-radius: 1em;
-webkit-border-radius: 1em;
@ -984,53 +984,53 @@ body.closet_hangers-index .closet-list.droppable-active {
border-style: dotted;
margin: 1em 0;
}
/* line 243, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 244, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list.droppable-active .object {
-moz-opacity: 0.25;
-webkit-opacity: 0.25;
-o-opacity: 0.25;
-khtml-opacity: 0.25;
}
/* line 247, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 248, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list.droppable-active .object.ui-draggable-dragging {
-moz-opacity: 1;
-webkit-opacity: 1;
-o-opacity: 1;
-khtml-opacity: 1;
}
/* line 250, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 251, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list.droppable-active .closet-list-controls {
display: none;
}
/* line 253, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 254, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list.droppable-active .closet-list-hangers {
overflow: hidden;
}
/* line 256, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 257, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list.droppable-active .visibility-form {
display: none;
}
/* line 260, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 261, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-hangers-group-autocomplete-item span, body.closet_hangers-index .closet-list-autocomplete-item span {
font-style: italic;
padding: 0.2em 0.4em;
}
/* line 265, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 266, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index .closet-list-autocomplete-item a, body.closet_hangers-index .closet-list-autocomplete-item span {
font-size: 85%;
padding-left: 2em;
}
/* line 272, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 273, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover form {
display: inline;
}
/* line 275, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 276, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .closet-hanger-destroy {
position: absolute;
right: 18px;
top: 0;
top: 52px;
}
/* line 280, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 281, ../../../app/stylesheets/closet_hangers/_index.sass */
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 */
-moz-border-radius: 5px;
@ -1071,83 +1071,83 @@ 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 {
background-color: #999999;
}
/* line 283, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 284, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity {
-moz-opacity: 1;
-webkit-opacity: 1;
-o-opacity: 1;
-khtml-opacity: 1;
background: transparent;
top: 56px;
top: 0;
padding: 0;
}
/* line 289, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 290, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity span {
display: none;
}
/* line 292, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 293, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity input[type=number] {
padding: 2px;
width: 2em;
}
/* line 296, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 297, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user #closet-hangers .object:hover .quantity input[type=submit] {
font-size: 85%;
}
/* line 301, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 302, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object:hover .quantity {
display: block;
}
/* line 304, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 305, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object:hover .quantity input[type=number] {
width: 2.5em;
}
/* line 307, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 308, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object:hover .quantity input[type=submit] {
display: none;
}
/* line 310, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 311, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object.loading {
background: #eeffee;
outline: 1px solid #006600;
}
/* line 314, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 315, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object.loading .quantity {
display: block;
}
/* line 317, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 318, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers .object.loading .quantity span:after {
content: "…";
}
/* line 321, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 322, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers-contact form {
display: none;
}
/* line 324, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 325, ../../../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 {
display: inline;
}
/* line 328, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 329, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers-contact.editing form {
display: block;
}
/* line 331, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 332, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js #closet-hangers-contact.editing .edit-contact-link {
display: none;
}
/* line 336, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 337, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js .closet-hangers-group header .show, body.closet_hangers-index.current-user.js .closet-hangers-group header .hide {
cursor: pointer;
}
/* line 339, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 340, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js .closet-hangers-group header .hide {
display: block;
}
/* line 343, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 344, ../../../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 {
display: none;
}
/* line 346, ../../../app/stylesheets/closet_hangers/_index.sass */
/* line 347, ../../../app/stylesheets/closet_hangers/_index.sass */
body.closet_hangers-index.current-user.js .closet-hangers-group.hidden header .show {
display: block;
}