From 77d616d0cdb46df69deffb4b6d731529f940cab1 Mon Sep 17 00:00:00 2001 From: Adam Jahn Date: Wed, 23 Nov 2011 15:24:10 -0500 Subject: [PATCH] Upgraded for 0.80.x --- app/controllers/admin/comment_types_controller.rb | 2 -- app/controllers/admin/comments_controller.rb | 7 ------- app/controllers/spree/admin/comment_types_controller.rb | 2 ++ app/controllers/spree/admin/comments_controller.rb | 7 +++++++ .../{ => spree}/admin/orders_controller_decorator.rb | 2 +- .../{ => spree}/admin/shipments_controller_decorator.rb | 2 +- app/models/comment_type.rb | 3 --- app/models/order_decorator.rb | 3 --- app/models/shipment_decorator.rb | 3 --- app/models/{ => spree}/comment.rb | 2 +- app/models/spree/comment_type.rb | 3 +++ app/models/spree/order_decorator.rb | 3 +++ app/models/spree/shipment_decorator.rb | 3 +++ app/overrides/add_comment_configuration.rb | 2 +- app/overrides/add_comment_to_admin_orders_tabs.rb | 4 ++-- app/overrides/add_shipment_comment_button.rb | 2 +- app/views/admin/orders/comments.html.erb | 2 -- app/views/admin/shipments/comments.html.erb | 2 -- app/views/{ => spree}/admin/comment_types/_form.html.erb | 0 app/views/{ => spree}/admin/comment_types/edit.html.erb | 6 +++--- app/views/{ => spree}/admin/comment_types/index.html.erb | 2 +- app/views/{ => spree}/admin/comment_types/new.html.erb | 6 +++--- app/views/{ => spree}/admin/orders/_tab.html.erb | 0 app/views/spree/admin/orders/comments.html.erb | 2 ++ app/views/{ => spree}/admin/shared/_comment_list.html.erb | 0 app/views/{ => spree}/admin/shared/_comments.html.erb | 2 +- app/views/{ => spree}/admin/shipments/_button.html.erb | 0 app/views/spree/admin/shipments/comments.html.erb | 2 ++ config/routes.rb | 2 +- db/migrate/20111123200847_prefix_tables_with_spree.rb | 6 ++++++ 30 files changed, 44 insertions(+), 38 deletions(-) delete mode 100644 app/controllers/admin/comment_types_controller.rb delete mode 100644 app/controllers/admin/comments_controller.rb create mode 100644 app/controllers/spree/admin/comment_types_controller.rb create mode 100644 app/controllers/spree/admin/comments_controller.rb rename app/controllers/{ => spree}/admin/orders_controller_decorator.rb (69%) rename app/controllers/{ => spree}/admin/shipments_controller_decorator.rb (69%) delete mode 100644 app/models/comment_type.rb delete mode 100644 app/models/order_decorator.rb delete mode 100644 app/models/shipment_decorator.rb rename app/models/{ => spree}/comment.rb (89%) create mode 100644 app/models/spree/comment_type.rb create mode 100644 app/models/spree/order_decorator.rb create mode 100644 app/models/spree/shipment_decorator.rb delete mode 100644 app/views/admin/orders/comments.html.erb delete mode 100644 app/views/admin/shipments/comments.html.erb rename app/views/{ => spree}/admin/comment_types/_form.html.erb (100%) rename app/views/{ => spree}/admin/comment_types/edit.html.erb (65%) rename app/views/{ => spree}/admin/comment_types/index.html.erb (94%) rename app/views/{ => spree}/admin/comment_types/new.html.erb (63%) rename app/views/{ => spree}/admin/orders/_tab.html.erb (100%) create mode 100644 app/views/spree/admin/orders/comments.html.erb rename app/views/{ => spree}/admin/shared/_comment_list.html.erb (100%) rename app/views/{ => spree}/admin/shared/_comments.html.erb (93%) rename app/views/{ => spree}/admin/shipments/_button.html.erb (100%) create mode 100644 app/views/spree/admin/shipments/comments.html.erb create mode 100644 db/migrate/20111123200847_prefix_tables_with_spree.rb diff --git a/app/controllers/admin/comment_types_controller.rb b/app/controllers/admin/comment_types_controller.rb deleted file mode 100644 index f0f1e81..0000000 --- a/app/controllers/admin/comment_types_controller.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Admin::CommentTypesController < Admin::ResourceController -end \ No newline at end of file diff --git a/app/controllers/admin/comments_controller.rb b/app/controllers/admin/comments_controller.rb deleted file mode 100644 index 09409d9..0000000 --- a/app/controllers/admin/comments_controller.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Admin::CommentsController < Admin::ResourceController - private - - def location_after_save - :back - end -end \ No newline at end of file diff --git a/app/controllers/spree/admin/comment_types_controller.rb b/app/controllers/spree/admin/comment_types_controller.rb new file mode 100644 index 0000000..de2ee04 --- /dev/null +++ b/app/controllers/spree/admin/comment_types_controller.rb @@ -0,0 +1,2 @@ +class Spree::Admin::CommentTypesController < Spree::Admin::ResourceController +end \ No newline at end of file diff --git a/app/controllers/spree/admin/comments_controller.rb b/app/controllers/spree/admin/comments_controller.rb new file mode 100644 index 0000000..eab12ee --- /dev/null +++ b/app/controllers/spree/admin/comments_controller.rb @@ -0,0 +1,7 @@ +class Spree::Admin::CommentsController < Spree::Admin::ResourceController + private + + def location_after_save + :back + end +end \ No newline at end of file diff --git a/app/controllers/admin/orders_controller_decorator.rb b/app/controllers/spree/admin/orders_controller_decorator.rb similarity index 69% rename from app/controllers/admin/orders_controller_decorator.rb rename to app/controllers/spree/admin/orders_controller_decorator.rb index 0c93586..f72ca3a 100644 --- a/app/controllers/admin/orders_controller_decorator.rb +++ b/app/controllers/spree/admin/orders_controller_decorator.rb @@ -1,4 +1,4 @@ -Admin::OrdersController.class_eval do +Spree::Admin::OrdersController.class_eval do def comments load_order @comment_types = CommentType.where(:applies_to => "Order") diff --git a/app/controllers/admin/shipments_controller_decorator.rb b/app/controllers/spree/admin/shipments_controller_decorator.rb similarity index 69% rename from app/controllers/admin/shipments_controller_decorator.rb rename to app/controllers/spree/admin/shipments_controller_decorator.rb index 1fe70b1..d43b696 100644 --- a/app/controllers/admin/shipments_controller_decorator.rb +++ b/app/controllers/spree/admin/shipments_controller_decorator.rb @@ -1,4 +1,4 @@ -Admin::ShipmentsController.class_eval do +Spree::Admin::ShipmentsController.class_eval do def comments load_shipment @comment_types = CommentType.where(:applies_to => "Shipment") diff --git a/app/models/comment_type.rb b/app/models/comment_type.rb deleted file mode 100644 index bae7659..0000000 --- a/app/models/comment_type.rb +++ /dev/null @@ -1,3 +0,0 @@ -class CommentType < ActiveRecord::Base - has_many :comments -end diff --git a/app/models/order_decorator.rb b/app/models/order_decorator.rb deleted file mode 100644 index 930d228..0000000 --- a/app/models/order_decorator.rb +++ /dev/null @@ -1,3 +0,0 @@ -Order.class_eval do - acts_as_commentable -end \ No newline at end of file diff --git a/app/models/shipment_decorator.rb b/app/models/shipment_decorator.rb deleted file mode 100644 index 76a4cb1..0000000 --- a/app/models/shipment_decorator.rb +++ /dev/null @@ -1,3 +0,0 @@ -Shipment.class_eval do - acts_as_commentable -end \ No newline at end of file diff --git a/app/models/comment.rb b/app/models/spree/comment.rb similarity index 89% rename from app/models/comment.rb rename to app/models/spree/comment.rb index c51ca0f..4c25e6c 100644 --- a/app/models/comment.rb +++ b/app/models/spree/comment.rb @@ -1,4 +1,4 @@ -class Comment < ActiveRecord::Base +class Spree::Comment < ActiveRecord::Base include ActsAsCommentable::Comment belongs_to :commentable, :polymorphic => true diff --git a/app/models/spree/comment_type.rb b/app/models/spree/comment_type.rb new file mode 100644 index 0000000..6f48e5c --- /dev/null +++ b/app/models/spree/comment_type.rb @@ -0,0 +1,3 @@ +class Spree::CommentType < ActiveRecord::Base + has_many :comments +end diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb new file mode 100644 index 0000000..774cfb4 --- /dev/null +++ b/app/models/spree/order_decorator.rb @@ -0,0 +1,3 @@ +Spree::Order.class_eval do + acts_as_commentable +end \ No newline at end of file diff --git a/app/models/spree/shipment_decorator.rb b/app/models/spree/shipment_decorator.rb new file mode 100644 index 0000000..2aa0a3b --- /dev/null +++ b/app/models/spree/shipment_decorator.rb @@ -0,0 +1,3 @@ +Spree::Shipment.class_eval do + acts_as_commentable +end \ No newline at end of file diff --git a/app/overrides/add_comment_configuration.rb b/app/overrides/add_comment_configuration.rb index cca0587..2bf5aeb 100644 --- a/app/overrides/add_comment_configuration.rb +++ b/app/overrides/add_comment_configuration.rb @@ -1,4 +1,4 @@ -Deface::Override.new(:virtual_path => "admin/configurations/index", +Deface::Override.new(:virtual_path => "spree/admin/configurations/index", :name => "converted_admin_configurations_menu_468573024", :insert_after => "[data-hook='admin_configurations_menu'], #admin_configurations_menu[data-hook]", :text => "<%= configurations_menu_item(I18n.t('comment_types'), admin_comment_types_url, I18n.t('manage_comment_types')) %>", diff --git a/app/overrides/add_comment_to_admin_orders_tabs.rb b/app/overrides/add_comment_to_admin_orders_tabs.rb index 0e0466e..dbaf5ea 100644 --- a/app/overrides/add_comment_to_admin_orders_tabs.rb +++ b/app/overrides/add_comment_to_admin_orders_tabs.rb @@ -1,5 +1,5 @@ -Deface::Override.new(:virtual_path => "admin/shared/_order_tabs", +Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs", :name => "converted_admin_order_tabs_472794197", :insert_bottom => "[data-hook='admin_order_tabs'], #admin_order_tabs[data-hook]", - :partial => "admin/orders/tab", + :partial => "spree/admin/orders/tab", :disabled => false) \ No newline at end of file diff --git a/app/overrides/add_shipment_comment_button.rb b/app/overrides/add_shipment_comment_button.rb index 4ac5a24..fb5e32e 100644 --- a/app/overrides/add_shipment_comment_button.rb +++ b/app/overrides/add_shipment_comment_button.rb @@ -1,5 +1,5 @@ Deface::Override.new(:virtual_path => "admin/shipments/edit", :name => "converted_admin_shipment_edit_buttons_233418828", :insert_after => "[data-hook='admin_shipment_edit_buttons'], #admin_shipment_edit_buttons[data-hook]", - :partial => "admin/shipments/button", + :partial => "spree/admin/shipments/button", :disabled => false) \ No newline at end of file diff --git a/app/views/admin/orders/comments.html.erb b/app/views/admin/orders/comments.html.erb deleted file mode 100644 index 8b253af..0000000 --- a/app/views/admin/orders/comments.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= render 'admin/shared/order_tabs', :current => 'Comments' %> -<%= render 'admin/shared/comments', :commentable => @order %> diff --git a/app/views/admin/shipments/comments.html.erb b/app/views/admin/shipments/comments.html.erb deleted file mode 100644 index 70411dc..0000000 --- a/app/views/admin/shipments/comments.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -<%= render 'admin/shared/order_tabs', :current => 'Shipments' %> -<%= render 'admin/shared/comments', {:commentable => @shipment, :comments_for => "Shipment ##{@shipment.number}"} %> \ No newline at end of file diff --git a/app/views/admin/comment_types/_form.html.erb b/app/views/spree/admin/comment_types/_form.html.erb similarity index 100% rename from app/views/admin/comment_types/_form.html.erb rename to app/views/spree/admin/comment_types/_form.html.erb diff --git a/app/views/admin/comment_types/edit.html.erb b/app/views/spree/admin/comment_types/edit.html.erb similarity index 65% rename from app/views/admin/comment_types/edit.html.erb rename to app/views/spree/admin/comment_types/edit.html.erb index 983a1cf..ee62699 100644 --- a/app/views/admin/comment_types/edit.html.erb +++ b/app/views/spree/admin/comment_types/edit.html.erb @@ -1,8 +1,8 @@ -<%= render :partial => 'admin/shared/configuration_menu' %> +<%= render :partial => 'spree/admin/shared/configuration_menu' %> <%= hook :admin_comment_type_edit_form_header do %>

<%= t(:editing_comment_type) %>

- <%= render 'shared/error_messages', :target => @comment_type %> + <%= render 'spree/shared/error_messages', :target => @comment_type %> <% end %> <%= hook :admin_comment_type_edit_form do %> @@ -10,7 +10,7 @@ <%= render :partial => 'form', :locals => { :f => f } %> <%= hook :admin_comment_type_edit_form_buttons do %> - <%= render :partial => 'admin/shared/edit_resource_links' %> + <%= render :partial => 'spree/admin/shared/edit_resource_links' %> <% end %> <% end %> <% end %> diff --git a/app/views/admin/comment_types/index.html.erb b/app/views/spree/admin/comment_types/index.html.erb similarity index 94% rename from app/views/admin/comment_types/index.html.erb rename to app/views/spree/admin/comment_types/index.html.erb index 496d136..662c61d 100644 --- a/app/views/admin/comment_types/index.html.erb +++ b/app/views/spree/admin/comment_types/index.html.erb @@ -1,4 +1,4 @@ -<%= render :partial => 'admin/shared/configuration_menu' %> +<%= render :partial => 'spree/admin/shared/configuration_menu' %>