Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Commit

Permalink
Update to new Spree 2.0 namespace changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rterbush committed May 6, 2013
1 parent 96c23d9 commit e3ffe1d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/controllers/spree/wished_products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ class Spree::WishedProductsController < Spree::StoreController

def create
@wished_product = Spree::WishedProduct.new(params[:wished_product])
@wishlist = current_user.wishlist
@wishlist = spree_current_user.wishlist

if @wishlist.include? params[:wished_product][:variant_id]
@wished_product = @wishlist.wished_products.detect {|wp| wp.variant_id == params[:wished_product][:variant_id].to_i }
else
@wished_product.wishlist = current_user.wishlist
@wished_product.wishlist = spree_current_user.wishlist
@wished_product.save
end

Expand Down
6 changes: 3 additions & 3 deletions app/controllers/spree/wishlists_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def new
end

def index
@wishlists = current_user.wishlists
@wishlists = spree_current_user.wishlists

respond_with(@wishlist)
end
Expand All @@ -36,7 +36,7 @@ def show
end

def default
@wishlist = current_user.wishlist
@wishlist = spree_current_user.wishlist

respond_with(@wishlist)do |format|
format.html { render 'show' }
Expand All @@ -45,7 +45,7 @@ def default

def create
@wishlist = Spree::Wishlist.new(params[:wishlist])
@wishlist.user = current_user
@wishlist.user = spree_current_user

@wishlist.save
respond_with(@wishlist)
Expand Down
2 changes: 1 addition & 1 deletion app/views/spree/products/_wishlist_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% if current_user %>
<% if spree_current_user %>
<div id="wishlist-form">
<%= form_for Spree::WishedProduct.new do |f| %>
<%= f.hidden_field :variant_id, :value => @product.master.id %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/spree/users/_wishlists.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h3><%= t(:my_wishlists) %></h3>
<ul>
<% @user.wishlists.each do |wl| %>
<% if !wl.is_private? || @user == current_user %>
<% if !wl.is_private? || @user == spree_current_user %>
<li><%= link_to wl.name, wl %></li>
<% end -%>
<% end -%>
Expand Down
12 changes: 6 additions & 6 deletions app/views/spree/wishlists/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="wishlist_header" class="row">
<h1><%= @wishlist.name %></h1>
<% if @wishlist.user == current_user %>
<% if @wishlist.user == spree_current_user %>
<div id="manage_wishlist_links">
<%= link_to t(:edit_wishlist), edit_wishlist_path(@wishlist), :class => 'button' %>
</div>
Expand All @@ -10,7 +10,7 @@
<table id="wishlist">
<thead>
<tr>
<% if @wishlist.user == current_user %>
<% if @wishlist.user == spree_current_user %>
<th><%= t(:wishlist_actions) %></th>
<% end -%>
<th><%= t(:item_view) %></th>
Expand All @@ -26,17 +26,17 @@
variant = wish.variant
product = variant.product %>
<tr class="<%= cycle('', 'alt') %>">
<% if @wishlist.user == current_user %>
<% if @wishlist.user == spree_current_user %>
<td>
<p><%= link_to t(:remove_from_wishlist), wish, :method => :delete, :class => 'button' %></p>
<%= form_for :order, :url => populate_orders_url do |f| %>
<%= hidden_field_tag "variants[#{variant.id}]", 1, :size => 3 %>
<%= link_to t(:add_to_cart), '#', :onclick => "$(this).parent().submit(); return false;", :class => "button" %>
<% end %>
<% if current_user.wishlists.count > 1 %>
<% if spree_current_user.wishlists.count > 1 %>
<%= t(:move_to_another_wishlist) %>:
<%= form_for wish do |f| %>
<%= f.select :wishlist_id, current_user.wishlists.map{|wl| [wl.name, wl.id]} %>
<%= f.select :wishlist_id, spree_current_user.wishlists.map{|wl| [wl.name, wl.id]} %>
<%= f.submit t(:move) %>
<% end %>
<% end %>
Expand Down Expand Up @@ -74,7 +74,7 @@
</tbody>
</table>
<div class="footer_links" data-hook="wishlist_footer_links">
<% if @wishlist.user == current_user %>
<% if @wishlist.user == spree_current_user %>
<%= link_to t(:create_new_wishlist), new_wishlist_path, :class => "button" %>
<% end -%>
<%= link_to t(:continue_shopping), products_path, :class => "button" %>
Expand Down

2 comments on commit e3ffe1d

@brchristian
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be merged into 1-3-stable? I am running Spree 1.3 and require this namespacing -- unless I am mistaken!

@radar
Copy link
Contributor

@radar radar commented on e3ffe1d May 14, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right. Done with e61d10e

Please sign in to comment.