forked from sunny2601/spree_delivery_options
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
source 'http://rubygems.org' | ||
|
||
# Provides basic authentication functionality for testing parts of your engine | ||
# gem 'spree_auth_devise', :git => "git://github.com/spree/spree_auth_devise" | ||
gem 'spree_auth_devise', :git => "git://github.com/spree/spree_auth_devise", :branch => '2-1-stable' | ||
gem 'haml' | ||
|
||
gemspec |
13 changes: 13 additions & 0 deletions
13
app/controllers/spree/admin/orders/delivery_options_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Spree | ||
module Admin | ||
module Orders | ||
class DeliveryOptionsController < Spree::Admin::BaseController | ||
|
||
def edit | ||
@order = Order.find_by(number: params[:order_id]) | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Deface::Override.new(:virtual_path => "spree/admin/shared/_order_tabs", | ||
:name => "add_delivery_info_to_order_details", | ||
:insert_bottom => "[data-hook='admin_order_tabs']", | ||
:partial => "spree/admin/shared/delivery_options_link", | ||
:disabled => false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Delivery Options' } | ||
|
||
= csrf_meta_tags | ||
|
||
- content_for :page_title do | ||
%i.icon-arrow-right= Spree.t(:delivery_options) | ||
|
||
- content_for :page_actions do | ||
%li= button_link_to Spree.t(:back_to_orders_list), admin_orders_path, :icon => 'icon-arrow-left' | ||
|
||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @order } | ||
|
||
-# = form_for @order, :url => admin_order_customer_url(@order) do |f| %> | ||
-# = render 'form', :f => f %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- if can? :update, @order && checkout_steps.include?("delivery") %> | ||
%li(class="#{'active' if current == 'Delivery Options'}") | ||
= link_to_with_icon 'icon-truck', Spree.t(:delivery_options), admin_order_delivery_options_url(@order) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
Spree::Core::Engine.routes.draw do | ||
# Add your extension routes here | ||
|
||
get "admin/orders/:order_id/delivery_options/", controller: 'admin/orders/delivery_options', action: 'edit', as: 'admin_order_delivery_options' | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
require 'spree_core' | ||
require 'spree_frontend' | ||
require 'spree_backend' | ||
require 'spree_delivery_options/engine' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
spec/controllers/spree/admin/orders/delivery_options_controller_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'spec_helper' | ||
|
||
describe Spree::Admin::Orders::DeliveryOptionsController do | ||
|
||
let(:user) { mock_model Spree::User, :last_incomplete_spree_order => nil, :has_spree_role? => true, :spree_api_key => 'fake' } | ||
|
||
before :each do | ||
controller.stub :spree_current_user => user | ||
controller.stub :check_authorization | ||
end | ||
|
||
describe 'edit' do | ||
|
||
it 'should render edit' do | ||
spree_get :edit | ||
response.should render_template(:edit) | ||
end | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters