diff --git a/app/controllers/distributors_controller.rb b/app/controllers/distributors_controller.rb deleted file mode 100644 index 5b95f601ff..0000000000 --- a/app/controllers/distributors_controller.rb +++ /dev/null @@ -1,45 +0,0 @@ -class DistributorsController < ApplicationController - force_ssl - - respond_to :html - - helper 'spree/admin/navigation' - layout '/spree/layouts/admin' - - def index - @distributors = Distributor.all - respond_with(@distributors) - end - - def new - @distributor = Distributor.new - end - - def edit - @distributor = Distributor.find(params[:id]) - end - - def update - @distributor = Distributor.find(params[:id]) - - if @distributor.update_attributes(params[:distributor]) - redirect_to distributors_path - else - render :action => "edit" - end - end - - def show - @distributor = Distributor.find(params[:id]) - respond_with(@distributor) - end - - def create - @distributor = Distributor.new(params[:distributor]) - if @distributor.save - redirect_to distributors_path - else - render :action => "new" - end - end -end \ No newline at end of file diff --git a/app/controllers/spree/admin/distributors_controller.rb b/app/controllers/spree/admin/distributors_controller.rb new file mode 100644 index 0000000000..5445599ae3 --- /dev/null +++ b/app/controllers/spree/admin/distributors_controller.rb @@ -0,0 +1,8 @@ +module Spree + module Admin + class DistributorsController < ResourceController + + + end + end +end \ No newline at end of file diff --git a/app/models/distributor.rb b/app/models/distributor.rb deleted file mode 100644 index 42b3d016d6..0000000000 --- a/app/models/distributor.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Distributor < ActiveRecord::Base -end diff --git a/app/models/spree/distributor.rb b/app/models/spree/distributor.rb new file mode 100644 index 0000000000..d4532040fe --- /dev/null +++ b/app/models/spree/distributor.rb @@ -0,0 +1,5 @@ +module Spree + class Distributor < ActiveRecord::Base + set_table_name 'distributors' + end +end diff --git a/app/overrides/distributors_admin_tab.rb b/app/overrides/distributors_admin_tab.rb new file mode 100644 index 0000000000..66e4946b40 --- /dev/null +++ b/app/overrides/distributors_admin_tab.rb @@ -0,0 +1,5 @@ +Deface::Override.new(:virtual_path => "spree/layouts/admin", + :name => "distributors_admin_tabs", + :insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]", + :text => "<%= tab(:distributors, :url => spree.admin_distributors_path) %>", + :disabled => false) diff --git a/app/overrides/drop_off_point.rb b/app/overrides/drop_off_point.rb new file mode 100644 index 0000000000..25b80c7116 --- /dev/null +++ b/app/overrides/drop_off_point.rb @@ -0,0 +1,4 @@ +Deface::Override.new(:virtual_path => "spree/checkout/_delivery", + :insert_before => "[data-hook='buttons']", + :text => "
TODO: Select a drop off point....
", + :name => "drop_off_point") \ No newline at end of file diff --git a/app/overrides/replace_delivery_addres.rb b/app/overrides/replace_delivery_addres.rb new file mode 100644 index 0000000000..25b80c7116 --- /dev/null +++ b/app/overrides/replace_delivery_addres.rb @@ -0,0 +1,4 @@ +Deface::Override.new(:virtual_path => "spree/checkout/_delivery", + :insert_before => "[data-hook='buttons']", + :text => "TODO: Select a drop off point....
", + :name => "drop_off_point") \ No newline at end of file diff --git a/app/views/distributors/_form.html.erb b/app/views/distributors/_form.html.erb deleted file mode 100644 index f3fdc1b2c6..0000000000 --- a/app/views/distributors/_form.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -<%= simple_form_for distributor do |f| %> - <%= f.input :name %> - <%= f.input :description %> - <%= f.input :contact %> - <%= f.input :phone %> - <%= f.input :email %> - <%= f.input :pickup_address %> - <%= f.input :pickup_times %> - <%= f.input :url %> - <%= f.input :abn %> - <%= f.input :acn %> - <%= f.button :submit %> -<% end %> \ No newline at end of file diff --git a/app/views/distributors/edit.html.erb b/app/views/distributors/edit.html.erb deleted file mode 100644 index 02b6a80e2c..0000000000 --- a/app/views/distributors/edit.html.erb +++ /dev/null @@ -1,2 +0,0 @@ - -<%= render :partial => 'form', :locals => { :distributor => @distributor } %> \ No newline at end of file diff --git a/app/views/distributors/index.html.erb b/app/views/distributors/index.html.erb deleted file mode 100644 index d531fe7fc5..0000000000 --- a/app/views/distributors/index.html.erb +++ /dev/null @@ -1,31 +0,0 @@ - - - -| Name | -- Description - | -
|---|---|
| <%= link_to distributor.name, distributor_path(distributor) %> | -<%=distributor.description %> | -
| <%= t(:none) %> | |
| Name : | +<%= f.text_field :name %> | +
| Description : | +<%= f.text_field :description %> | +
| Contact : | +<%= f.text_field :contact %> | +
| Phone : | +<%= f.text_field :phone %> | +
| Email : | +<%= f.text_field :email %> | +
| Address : | +<%= f.text_field :pickup_address %> | +
| Pickup times : | +<%= f.text_field :pickup_times %> | +
| URL : | +<%= f.text_field :url %> | +
| ABN : | +<%= f.text_field :abn %> | +
| ACN : | +<%= f.text_field :acn %> | +