diff --git a/.gitignore b/.gitignore index a765d6d558..9914e44161 100644 --- a/.gitignore +++ b/.gitignore @@ -31,5 +31,6 @@ public/images public/spree config/abr.yml config/heroku_env.rb +config/initializers/feature_toggle.rb NERD_tree* coverage diff --git a/Gemfile b/Gemfile index e08a434ca3..a59a16918c 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,6 @@ gem 'simple_form', :git => 'git://github.com/RohanM/simple_form.git' gem 'unicorn' gem 'bugsnag' gem 'newrelic_rpm' -gem 'spree_heroku', :git => 'git://github.com/eaterprises/spree-heroku.git' gem 'haml' gem 'sass' gem 'aws-sdk' @@ -29,6 +28,8 @@ gem 'truncate_html' gem 'representative_view' gem 'rabl' gem 'oj' +gem 'chili', :github => 'eaterprises/chili' +gem 'deface', :github => 'spree/deface' # Gems used only for assets and not required # in production environments by default. @@ -59,7 +60,14 @@ group :test, :development do gem 'database_cleaner', '0.7.1', :require => false gem 'simplecov', :require => false gem 'awesome_print' - gem "letter_opener" + gem 'letter_opener' + gem 'timecop' +end + +group :chili do + gem 'enterprises_distributor_info_rich_text_feature', path: 'lib/chili/enterprises_distributor_info_rich_text_feature' + gem 'eaterprises_feature', path: 'lib/chili/eaterprises_feature' + gem 'local_organics_feature', path: 'lib/chili/local_organics_feature' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 67067d1d8e..f61ec7a842 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,12 +7,12 @@ GIT activemodel (~> 3.0) GIT - remote: git://github.com/eaterprises/spree-heroku.git - revision: a1e07bf7a22fc0c07a1be9148f477d20b557dbf6 + remote: git://github.com/eaterprises/chili.git + revision: b82608623d504eb39f852115b138a53af5f89505 specs: - spree_heroku (1.0) - aws-sdk (~> 1.3.4) - spree_core (>= 0.70.0) + chili (3.1.0) + deface (~> 1.0.0.rc2) + rails (~> 3.2) GIT remote: git://github.com/eaterprises/spree-last-address.git @@ -22,6 +22,15 @@ GIT spree_last_address (1.1.0) spree_core (>= 1.1) +GIT + remote: git://github.com/spree/deface.git + revision: 1110a1336252109bce7f98f9182042e0bc2930ae + specs: + deface (1.0.0.rc3) + colorize (>= 0.5.8) + nokogiri (~> 1.6.0) + rails (>= 3.1) + GIT remote: git://github.com/spree/spree.git revision: 94566bf1b7d50f474333d10844534e570b6edf5a @@ -74,7 +83,7 @@ GIT GIT remote: git://github.com/spree/spree_paypal_express.git - revision: 483f6ababa9c8a1c574aad0a948c96cc21a591db + revision: 9d70ab6d537420ff41468d05d6d2ac3c8d2ff3bf branch: 1-3-stable specs: spree_paypal_express (1.2.0) @@ -91,6 +100,27 @@ GIT devise-encryptable (= 0.1.2) spree_core +PATH + remote: lib/chili/eaterprises_feature + specs: + eaterprises_feature (0.0.1) + chili (~> 3.1) + rails (~> 3.2.11) + +PATH + remote: lib/chili/enterprises_distributor_info_rich_text_feature + specs: + enterprises_distributor_info_rich_text_feature (0.0.1) + chili (~> 3.1) + rails (~> 3.2.11) + +PATH + remote: lib/chili/local_organics_feature + specs: + local_organics_feature (0.0.1) + chili (~> 3.1) + rails (~> 3.2.11) + GEM remote: https://rubygems.org/ specs: @@ -111,14 +141,14 @@ GEM active_utils (1.0.5) activesupport (>= 2.3.11) i18n - activemerchant (1.34.1) + activemerchant (1.34.0) active_utils (>= 1.0.2) activesupport (>= 2.3.14) builder (>= 2.0.0) i18n json (>= 1.5.1) money - nokogiri (< 1.6.0) + nokogiri activemodel (3.2.13) activesupport (= 3.2.13) builder (~> 3.0.0) @@ -173,6 +203,7 @@ GEM coffee-script-source execjs coffee-script-source (1.3.3) + colorize (0.5.8) columnize (0.3.6) comfortable_mexican_sofa (1.6.24) active_link_to (~> 1.0.0) @@ -189,9 +220,6 @@ GEM debugger-ruby_core_source (~> 1.2.3) debugger-linecache (1.2.0) debugger-ruby_core_source (1.2.3) - deface (0.9.1) - nokogiri (~> 1.5.0) - rails (~> 3.1) devise (2.2.4) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) @@ -251,6 +279,7 @@ GEM treetop (~> 1.4.8) method_source (0.8.1) mime-types (1.23) + mini_portile (0.5.1) money (5.0.0) i18n (~> 0.4) json @@ -260,7 +289,8 @@ GEM net-ssh (>= 2.6.5) net-ssh (2.6.8) newrelic_rpm (3.6.5.130) - nokogiri (1.5.10) + nokogiri (1.6.0) + mini_portile (~> 0.5.0) oj (2.1.2) orm_adapter (0.4.0) paperclip (2.8.0) @@ -365,6 +395,7 @@ GEM libv8 (~> 3.3.10) thor (0.18.1) tilt (1.4.1) + timecop (0.6.2.2) treetop (1.4.14) polyglot polyglot (>= 0.3.1) @@ -402,16 +433,21 @@ DEPENDENCIES aws-sdk bugsnag capybara + chili! coffee-rails (~> 3.2.1) comfortable_mexican_sofa database_cleaner (= 0.7.1) db2fog debugger-linecache + deface! + eaterprises_feature! + enterprises_distributor_info_rich_text_feature! factory_girl_rails faker haml jquery-rails letter_opener + local_organics_feature! newrelic_rpm oj pg @@ -427,11 +463,11 @@ DEPENDENCIES simplecov spree! spree_auth_devise! - spree_heroku! spree_i18n! spree_last_address! spree_paypal_express! therubyracer + timecop truncate_html turbo-sprockets-rails3 turn (~> 0.8.3) diff --git a/app/assets/images/ofw.png b/app/assets/images/ofw.png new file mode 100644 index 0000000000..ac571bacd0 Binary files /dev/null and b/app/assets/images/ofw.png differ diff --git a/app/assets/stylesheets/store/openfoodweb.css.scss b/app/assets/stylesheets/store/openfoodweb.css.scss index bf08508f82..0836ce2f07 100644 --- a/app/assets/stylesheets/store/openfoodweb.css.scss +++ b/app/assets/stylesheets/store/openfoodweb.css.scss @@ -192,6 +192,11 @@ fieldset#product-distributor-details { } } +/* Checkout address page */ +#checkout .alternative-available-distributors { + padding-top: 30px; +} + /* Delivery fees table on checkout page */ #delivery-fees { diff --git a/app/assets/stylesheets/store/variables.css.scss b/app/assets/stylesheets/store/variables.css.scss index 1332e9b238..f33a4318e9 100644 --- a/app/assets/stylesheets/store/variables.css.scss +++ b/app/assets/stylesheets/store/variables.css.scss @@ -7,7 +7,7 @@ $c_red: #e45353 !default; /* Error red */ $layout_background_color: #FFFFFF !default; $title_text_color: #404042 !default; $body_text_color: #404042 !default; -$link_text_color: #006066 !default; +$link_text_color: #00ADEE !default; $product_background_color: #FFFFFF !default; $product_title_text_color: #404042 !default; @@ -60,3 +60,5 @@ $ff_base: 'Ubuntu', sans-serif !default; $button_border_color: rgba(0, 138, 189, .75) !default; $table_head_color: lighten($body_text_color, 60) !default; + +@import "./variables_changes.css.scss"; diff --git a/app/controllers/spree/admin/reports_controller_decorator.rb b/app/controllers/spree/admin/reports_controller_decorator.rb index 6de3fc1575..f922f39453 100644 --- a/app/controllers/spree/admin/reports_controller_decorator.rb +++ b/app/controllers/spree/admin/reports_controller_decorator.rb @@ -333,11 +333,11 @@ Spree::Admin::ReportsController.class_eval do if params[:q][:completed_at_gt].blank? params[:q][:completed_at_gt] = Time.zone.now.beginning_of_month else - params[:q][:completed_at_gt] = Time.zone.parse(params[:q][:completed_at_gt]).beginning_of_day rescue Time.zone.now.beginning_of_month + params[:q][:completed_at_gt] = Time.zone.parse(params[:q][:completed_at_gt]) rescue Time.zone.now.beginning_of_month end if params[:q] && !params[:q][:completed_at_lt].blank? - params[:q][:completed_at_lt] = Time.zone.parse(params[:q][:completed_at_lt]).end_of_day rescue "" + params[:q][:completed_at_lt] = Time.zone.parse(params[:q][:completed_at_lt]) rescue "" end params[:q][:meta_sort] ||= "completed_at.desc" diff --git a/app/controllers/spree/orders_controller_decorator.rb b/app/controllers/spree/orders_controller_decorator.rb index 49612546b4..938f2ee566 100644 --- a/app/controllers/spree/orders_controller_decorator.rb +++ b/app/controllers/spree/orders_controller_decorator.rb @@ -5,6 +5,31 @@ Spree::OrdersController.class_eval do before_filter :populate_order_count_on_hand, :only => :populate after_filter :populate_variant_attributes, :only => :populate + def select_distributor + distributor = Enterprise.is_distributor.find params[:id] + + order = current_order(true) + order.distributor = distributor + order.save! + + redirect_to main_app.enterprise_path(distributor) + end + + def deselect_distributor + order = current_order(true) + + order.distributor = nil + order.save! + + redirect_to root_path + end + + + private + + + # -- Callbacks + def populate_order_distributor @distributor = params[:distributor_id].present? ? Enterprise.is_distributor.find(params[:distributor_id]) : nil @@ -51,26 +76,8 @@ Spree::OrdersController.class_eval do end end - def select_distributor - distributor = Enterprise.is_distributor.find params[:id] - order = current_order(true) - order.distributor = distributor - order.save! - - redirect_to main_app.enterprise_path(distributor) - end - - def deselect_distributor - order = current_order(true) - - order.distributor = nil - order.save! - - redirect_to root_path - end - - private + # -- Utils def populate_valid? distributor # -- Distributor must be specified diff --git a/app/helpers/html_helper.rb b/app/helpers/html_helper.rb new file mode 100644 index 0000000000..85dc5b1c53 --- /dev/null +++ b/app/helpers/html_helper.rb @@ -0,0 +1,5 @@ +module HtmlHelper + def strip_html(html) + strip_tags(html).gsub(/ /i, ' ').gsub(/&/i, '&') + end +end diff --git a/app/mailers/spree/order_mailer_decorator.rb b/app/mailers/spree/order_mailer_decorator.rb new file mode 100644 index 0000000000..1ce563ad56 --- /dev/null +++ b/app/mailers/spree/order_mailer_decorator.rb @@ -0,0 +1,3 @@ +Spree::OrderMailer.class_eval do + helper HtmlHelper +end diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 17c9380097..96f48aa111 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -27,9 +27,9 @@ class Enterprise < ActiveRecord::Base def to_param "#{id}-#{name.parameterize}" end - + def available_variants - ProductDistribution.find_all_by_distributor_id( self.id ).map{ |pd| pd.product.variants + [pd.product.master] }.flatten + Spree::Variant.joins(:product => :product_distributions).where('product_distributions.distributor_id=?', self.id) end diff --git a/app/models/spree/gateway/migs.rb b/app/models/spree/gateway/migs.rb new file mode 100644 index 0000000000..bfffc6de12 --- /dev/null +++ b/app/models/spree/gateway/migs.rb @@ -0,0 +1,19 @@ +module Spree + class Gateway::Migs < Gateway + preference :login, :string + preference :password, :string + + attr_accessible :preferred_login, :preferred_password + + + def provider_class + ActiveMerchant::Billing::MigsGateway + end + + def options_with_test_preference + options_without_test_preference.merge(:test => self.preferred_test_mode) + end + + alias_method_chain :options, :test_preference + end +end diff --git a/app/models/spree/line_item_decorator.rb b/app/models/spree/line_item_decorator.rb index aac21c1225..ec4f83e5e2 100644 --- a/app/models/spree/line_item_decorator.rb +++ b/app/models/spree/line_item_decorator.rb @@ -5,11 +5,16 @@ Spree::LineItem.class_eval do before_create :set_itemwise_shipping_method + def itemwise_shipping_cost order = OpenStruct.new :line_items => [self] shipping_method.compute_amount(order) end + def update_itemwise_shipping_method_without_callbacks!(distributor) + update_column(:shipping_method_id, self.product.shipping_method_for_distributor(distributor).id) + end + private diff --git a/app/models/spree/order_decorator.rb b/app/models/spree/order_decorator.rb index 85c75771b3..f49fa307c8 100644 --- a/app/models/spree/order_decorator.rb +++ b/app/models/spree/order_decorator.rb @@ -3,13 +3,20 @@ require 'open_food_web/distributor_change_validator' Spree::Order.class_eval do belongs_to :distributor, :class_name => 'Enterprise' - before_validation :shipping_address_from_distributor validate :products_available_from_new_distributor, :if => :distributor_id_changed? attr_accessible :distributor_id + before_validation :shipping_address_from_distributor + before_save :update_line_item_shipping_methods after_create :set_default_shipping_method + def empty! + line_items.destroy_all + adjustments.destroy_all + set_default_shipping_method + end + def products_available_from_new_distributor # Check that the line_items in the current order are available from a newly selected distributor errors.add(:distributor_id, "cannot supply the products in your cart") unless DistributorChangeValidator.new(self).can_change_to_distributor?(distributor) @@ -32,7 +39,7 @@ Spree::Order.class_eval do end def line_item_variants - line_items.map{ |li| li.variant } + line_items.map { |li| li.variant } end @@ -66,4 +73,11 @@ Spree::Order.class_eval do end end end + + def update_line_item_shipping_methods + if %w(cart address delivery resumed).include? state + self.line_items.each { |li| li.update_itemwise_shipping_method_without_callbacks!(distributor) } + self.update! + end + end end diff --git a/app/overrides/add_feedback_script.rb b/app/overrides/add_feedback_script.rb deleted file mode 100644 index 1bfb854c10..0000000000 --- a/app/overrides/add_feedback_script.rb +++ /dev/null @@ -1,5 +0,0 @@ -Deface::Override.new(:virtual_path => "spree/layouts/spree_application", - :insert_bottom => "[data-hook='inside_head']", - :partial => "layouts/feedback_script", - :name => "add_feedback_script", - :original => '429dfd9824ee588f51fb1b69013933424f149592') \ No newline at end of file diff --git a/app/views/admin/enterprises/show.html.haml b/app/views/admin/enterprises/show.html.haml index a2eb9027fa..d4a4ed0743 100644 --- a/app/views/admin/enterprises/show.html.haml +++ b/app/views/admin/enterprises/show.html.haml @@ -6,7 +6,7 @@ %tr %th Description: %td= @enterprise.description - %tr + %tr{"data-hook" => "long_description"} %th Extended Description: %td= @enterprise.long_description.andand.html_safe %tr diff --git a/app/views/enterprises/_distributor_details.html.haml b/app/views/enterprises/_distributor_details.html.haml index 950ba1e7f2..a3f070b451 100644 --- a/app/views/enterprises/_distributor_details.html.haml +++ b/app/views/enterprises/_distributor_details.html.haml @@ -1,23 +1,24 @@ -%h2= distributor.name -%p - %strong Address: - %br/ - = render 'spree/shared/address', :address => distributor.address -%p - %strong Next collection time: - %br/ - = distributor.next_collection_at -%p - %strong Regular collection times: - %br/ - = distributor.pickup_times -%p - %strong Contact: - %br/ - = distributor.contact - %br/ - = "Phone: #{distributor.phone}" - %br/ - = "Email: #{distributor.email}" -%p= distributor.description -%p= link_to distributor.website, distributor.website if distributor.website +.distributor-details{'data-hook' => 'distributor-details'} + %h2= distributor.name + %p + %strong Address: + %br/ + = render 'spree/shared/address', :address => distributor.address + %p + %strong Next collection time: + %br/ + = distributor.next_collection_at + %p + %strong Regular collection times: + %br/ + = distributor.pickup_times + %p + %strong Contact: + %br/ + = distributor.contact + %br/ + = "Phone: #{distributor.phone}" + %br/ + = "Email: #{distributor.email}" + %p= distributor.description + %p= link_to distributor.website, distributor.website if distributor.website diff --git a/app/views/spree/admin/reports/order_cycles.html.haml b/app/views/spree/admin/reports/order_cycles.html.haml index 4468f1d183..e8fb54c069 100644 --- a/app/views/spree/admin/reports/order_cycles.html.haml +++ b/app/views/spree/admin/reports/order_cycles.html.haml @@ -3,11 +3,11 @@ %br .date-range-filter %div{"class" => "left sub-field"} - = f.text_field :completed_at_gt, :class => 'datepicker' + = f.text_field :completed_at_gt, :class => 'datetimepicker' %br = label_tag nil, t(:start), :class => 'sub' %div{"class" => "right sub-field"} - = f.text_field :completed_at_lt, :class => 'datepicker' + = f.text_field :completed_at_lt, :class => 'datetimepicker' %br = label_tag nil, t(:stop) %br diff --git a/app/views/spree/checkout/_other_available_distributors.html.erb b/app/views/spree/checkout/_other_available_distributors.html.erb index d9f4560cb7..358441c878 100644 --- a/app/views/spree/checkout/_other_available_distributors.html.erb +++ b/app/views/spree/checkout/_other_available_distributors.html.erb @@ -1,5 +1,5 @@ <% unless @order.state != 'address' %> -
+
<% unless alternative_available_distributors(@order).empty? %> <%= form_for(@order) do |f| %> <%= f.label :distributor_label, "Alternative distributors for this order:" %> @@ -10,4 +10,4 @@ No alternative distributors available. <% end %>
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/spree/products/_add_to_cart.html.haml b/app/views/spree/products/_add_to_cart.html.haml index 0b0e118e54..fbf952f812 100644 --- a/app/views/spree/products/_add_to_cart.html.haml +++ b/app/views/spree/products/_add_to_cart.html.haml @@ -19,16 +19,16 @@ %div.cleared %br - if order.nil? || order.distributor.nil? - %div Distributor for your order: + %div.distributor Distributor for your order: = select_tag "distributor_id", options_from_collection_for_select([Enterprise.new]+@product.distributors, "id", "name", :include_blank => '') - else - available_distributors = DistributorChangeValidator.new(order).available_distributors(@product.distributors) - if available_distributors.length > 1 - %div Distributor for your order: + %div.distributor Distributor for your order: = select_tag "distributor_id", options_from_collection_for_select(available_distributors, "id", "name", current_distributor.andand.id) - else = hidden_field_tag "distributor_id", order.distributor.id .distributor-fixed= "Your distributor for this order is #{order.distributor.name}" %br = button_tag :class => 'large primary', :id => 'add-to-cart-button', :type => :submit do - = t(:add_to_cart) \ No newline at end of file + = t(:add_to_cart) diff --git a/app/views/spree/shared/_order_details_steps_data.html.erb b/app/views/spree/shared/_order_details_steps_data.html.erb index 005209cd1e..ee68620787 100644 --- a/app/views/spree/shared/_order_details_steps_data.html.erb +++ b/app/views/spree/shared/_order_details_steps_data.html.erb @@ -4,8 +4,7 @@
<%= "Customer Details" %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %>
- Name: <%= order.bill_address.full_name %>
- Address: <%= order.bill_address.address1 + ", " + order.bill_address.city %> + <%= render 'enterprises/distributor_details', :distributor => order.distributor %>
@@ -35,4 +34,4 @@
- \ No newline at end of file + diff --git a/config/application.rb b/config/application.rb index fa5411b9a6..02a159bc2f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -37,6 +37,10 @@ module Openfoodweb OpenFoodWeb::Calculator::Weight] end + # Register Spree payment methods + initializer "spree.gateway.payment_methods", :after => "spree.register.payment_methods" do |app| + app.config.spree.payment_methods << Spree::Gateway::Migs + end # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers @@ -72,7 +76,7 @@ module Openfoodweb # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' - config.assets.initialize_on_precompile = false + config.assets.initialize_on_precompile = true config.assets.precompile += ['store/all.css', 'store/all.js', 'admin/all.css', 'admin/*.js', 'admin/**/*.js', 'comfortable_mexican_sofa/*'] end end diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb index 59982c1a9e..cf58bfb576 100644 --- a/config/initializers/spree.rb +++ b/config/initializers/spree.rb @@ -11,10 +11,6 @@ require 'spree/product_filters' require 'open_food_web/searcher' Spree.config do |config| - config.site_name = "Open Food Web" - config.logo = 'logo.jpg' - config.admin_interface_logo = 'logo.jpg' - config.shipping_instructions = true config.checkout_zone = 'Australia' config.address_requires_state = true diff --git a/config/unicorn.rb b/config/unicorn.rb index 832f09d0a1..e5d7317940 100644 --- a/config/unicorn.rb +++ b/config/unicorn.rb @@ -1,6 +1,6 @@ preload_app true # https://newrelic.com/docs/ruby/no-data-with-unicorn worker_processes 4 # amount of unicorn workers to spin up -timeout 30 # restarts workers that hang for 30 seconds +timeout 60 # restarts workers that hang for 30 seconds # https://devcenter.heroku.com/articles/forked-pg-connections diff --git a/db/migrate/20130426023034_add_distributor_info_to_enterprises.enterprises_distributor_info_rich_text_feature.rb b/db/migrate/20130426023034_add_distributor_info_to_enterprises.enterprises_distributor_info_rich_text_feature.rb new file mode 100644 index 0000000000..69a6b9981e --- /dev/null +++ b/db/migrate/20130426023034_add_distributor_info_to_enterprises.enterprises_distributor_info_rich_text_feature.rb @@ -0,0 +1,6 @@ +# This migration comes from enterprises_distributor_info_rich_text_feature (originally 20130426022945) +class AddDistributorInfoToEnterprises < ActiveRecord::Migration + def change + add_column :enterprises, :distributor_info, :text + end +end diff --git a/db/schema.rb b/db/schema.rb index 4c47491b49..3b8f421bc5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -156,6 +156,7 @@ ActiveRecord::Schema.define(:version => 20130629120645) do t.string "next_collection_at" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.text "distributor_info" end create_table "exchange_fees", :force => true do |t| diff --git a/db/seeds.rb b/db/seeds.rb index bb8fe22bbc..85fc9e4d86 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -2,6 +2,7 @@ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). require File.expand_path('../../spec/factories', __FILE__) +require File.expand_path('../../spec/support/spree/init', __FILE__) # -- Spree diff --git a/lib/chili/eaterprises_feature/.gitignore b/lib/chili/eaterprises_feature/.gitignore new file mode 100644 index 0000000000..8619e09c5a --- /dev/null +++ b/lib/chili/eaterprises_feature/.gitignore @@ -0,0 +1,3 @@ +.bundle/ +log/*.log +pkg/ diff --git a/lib/chili/eaterprises_feature/README.rdoc b/lib/chili/eaterprises_feature/README.rdoc new file mode 100644 index 0000000000..047a9eccec --- /dev/null +++ b/lib/chili/eaterprises_feature/README.rdoc @@ -0,0 +1,3 @@ += Eaterprises Feature + +This feature is released under the AGPL licence. \ No newline at end of file diff --git a/lib/chili/eaterprises_feature/app/assets/images/eaterprises_feature/.gitkeep b/lib/chili/eaterprises_feature/app/assets/images/eaterprises_feature/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/chili/eaterprises_feature/app/assets/javascripts/eaterprises_feature/application.js b/lib/chili/eaterprises_feature/app/assets/javascripts/eaterprises_feature/application.js new file mode 100644 index 0000000000..15ebed9422 --- /dev/null +++ b/lib/chili/eaterprises_feature/app/assets/javascripts/eaterprises_feature/application.js @@ -0,0 +1,13 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require_tree . diff --git a/lib/chili/eaterprises_feature/app/assets/stylesheets/eaterprises_feature/application.css b/lib/chili/eaterprises_feature/app/assets/stylesheets/eaterprises_feature/application.css new file mode 100644 index 0000000000..3192ec897b --- /dev/null +++ b/lib/chili/eaterprises_feature/app/assets/stylesheets/eaterprises_feature/application.css @@ -0,0 +1,13 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_tree . + */ diff --git a/lib/chili/eaterprises_feature/app/assets/stylesheets/eaterprises_feature/variables_changes.css.scss b/lib/chili/eaterprises_feature/app/assets/stylesheets/eaterprises_feature/variables_changes.css.scss new file mode 100644 index 0000000000..c4007abd2f --- /dev/null +++ b/lib/chili/eaterprises_feature/app/assets/stylesheets/eaterprises_feature/variables_changes.css.scss @@ -0,0 +1 @@ +$link_text_color: #006066; diff --git a/lib/chili/eaterprises_feature/app/overrides/layouts/application/assets.html.erb.deface b/lib/chili/eaterprises_feature/app/overrides/layouts/application/assets.html.erb.deface new file mode 100644 index 0000000000..72e5ed7748 --- /dev/null +++ b/lib/chili/eaterprises_feature/app/overrides/layouts/application/assets.html.erb.deface @@ -0,0 +1,3 @@ + +<%= stylesheet_link_tag 'eaterprises_feature/application' %> +<%= javascript_include_tag 'eaterprises_feature/application' %> diff --git a/app/views/layouts/_feedback_script.html.erb b/lib/chili/eaterprises_feature/app/overrides/spree/layouts/spree_application/feedback_script.html.erb.deface similarity index 89% rename from app/views/layouts/_feedback_script.html.erb rename to lib/chili/eaterprises_feature/app/overrides/spree/layouts/spree_application/feedback_script.html.erb.deface index 605e48721c..5ced3ebb12 100644 --- a/app/views/layouts/_feedback_script.html.erb +++ b/lib/chili/eaterprises_feature/app/overrides/spree/layouts/spree_application/feedback_script.html.erb.deface @@ -1,3 +1,4 @@ + <% if Rails.env.production? %>