mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Split spree variable changes into per-feature files, add an eaterprises feature for default layout
This commit is contained in:
1
Gemfile
1
Gemfile
@@ -59,5 +59,6 @@ group :test, :development do
|
||||
end
|
||||
|
||||
group :chili do
|
||||
gem 'eaterprises_feature', path: 'lib/chili/eaterprises_feature'
|
||||
gem 'local_organics_feature', path: 'lib/chili/local_organics_feature'
|
||||
end
|
||||
|
||||
@@ -104,6 +104,13 @@ GIT
|
||||
i18n (~> 0.5)
|
||||
spree (~> 1.1)
|
||||
|
||||
PATH
|
||||
remote: lib/chili/eaterprises_feature
|
||||
specs:
|
||||
eaterprises_feature (0.0.1)
|
||||
chili (~> 3.1)
|
||||
rails (~> 3.2.11)
|
||||
|
||||
PATH
|
||||
remote: lib/chili/local_organics_feature
|
||||
specs:
|
||||
@@ -396,6 +403,7 @@ DEPENDENCIES
|
||||
comfortable_mexican_sofa
|
||||
database_cleaner (= 0.7.1)
|
||||
deface!
|
||||
eaterprises_feature!
|
||||
factory_girl_rails
|
||||
faker
|
||||
haml
|
||||
|
||||
@@ -7,7 +7,7 @@ $c_red: #e45353; /* Error red */
|
||||
$layout_background_color: #FFFFFF;
|
||||
$title_text_color: #404042;
|
||||
$body_text_color: #404042;
|
||||
$link_text_color: #006066;
|
||||
$link_text_color: #00ADEE;
|
||||
|
||||
$product_background_color: #FFFFFF;
|
||||
$product_title_text_color: #404042;
|
||||
@@ -56,3 +56,6 @@ $ff_base: 'Ubuntu', sans-serif;
|
||||
$input_box_font_size: 13px;
|
||||
$base_font_size: 12px;
|
||||
$button_border_color: rgba(0, 138, 189, .75);
|
||||
|
||||
|
||||
@import "./variables_changes.css.scss";
|
||||
|
||||
3
lib/chili/eaterprises_feature/.gitignore
vendored
Normal file
3
lib/chili/eaterprises_feature/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.bundle/
|
||||
log/*.log
|
||||
pkg/
|
||||
3
lib/chili/eaterprises_feature/README.rdoc
Normal file
3
lib/chili/eaterprises_feature/README.rdoc
Normal file
@@ -0,0 +1,3 @@
|
||||
= EaterprisesFeature
|
||||
|
||||
This project rocks and uses MIT-LICENSE.
|
||||
@@ -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 .
|
||||
@@ -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 .
|
||||
*/
|
||||
@@ -0,0 +1 @@
|
||||
$link_text_color: #006066;
|
||||
@@ -0,0 +1,4 @@
|
||||
module EaterprisesFeature
|
||||
class ApplicationController < Chili::ApplicationController
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
<!-- insert_bottom 'head' -->
|
||||
<%= stylesheet_link_tag 'eaterprises_feature/application' %>
|
||||
<%= javascript_include_tag 'eaterprises_feature/application' %>
|
||||
@@ -0,0 +1,6 @@
|
||||
<!-- insert_bottom 'body' -->
|
||||
<div style='background: #FFF;text-align: center; padding: 4px 0;position: fixed;width: 100%;z-index: 9999;top: 0;'>
|
||||
eaterprises_feature active - edit/remove this file:<br/>
|
||||
<strong>lib/chili/eaterprises_feature/app/overrides/layouts/application/example.html.erb.deface</strong><br/>
|
||||
<%= link_to 'deface docs', 'https://github.com/spree/deface', target: '_blank' %>
|
||||
</div>
|
||||
3
lib/chili/eaterprises_feature/config/routes.rb
Normal file
3
lib/chili/eaterprises_feature/config/routes.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
EaterprisesFeature::Engine.automount!
|
||||
EaterprisesFeature::Engine.routes.draw do
|
||||
end
|
||||
22
lib/chili/eaterprises_feature/eaterprises_feature.gemspec
Normal file
22
lib/chili/eaterprises_feature/eaterprises_feature.gemspec
Normal file
@@ -0,0 +1,22 @@
|
||||
$:.push File.expand_path("../lib", __FILE__)
|
||||
|
||||
# Maintain your gem's version:
|
||||
require "eaterprises_feature/version"
|
||||
|
||||
# Describe your gem and declare its dependencies:
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "eaterprises_feature"
|
||||
s.version = EaterprisesFeature::VERSION
|
||||
s.authors = ["Rohan Mitchell"]
|
||||
s.email = ["rohan@rohanmitchell.com"]
|
||||
s.homepage = ""
|
||||
s.summary = "Summary of EaterprisesFeature."
|
||||
s.description = "Description of EaterprisesFeature."
|
||||
|
||||
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
|
||||
|
||||
s.add_dependency "rails", "~> 3.2.11"
|
||||
s.add_dependency 'chili', '~> 3.1'
|
||||
|
||||
s.add_development_dependency "sqlite3"
|
||||
end
|
||||
7
lib/chili/eaterprises_feature/lib/eaterprises_feature.rb
Normal file
7
lib/chili/eaterprises_feature/lib/eaterprises_feature.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require "chili"
|
||||
require "eaterprises_feature/engine"
|
||||
|
||||
module EaterprisesFeature
|
||||
extend Chili::Base
|
||||
active_if { ENV['OFW_DEPLOYMENT'] == 'eaterprises' }
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
module EaterprisesFeature
|
||||
class Engine < ::Rails::Engine
|
||||
isolate_namespace EaterprisesFeature
|
||||
|
||||
if ENV['OFW_DEPLOYMENT'] == 'eaterprises'
|
||||
initializer 'eaterprises_feature.sass', :after => :load_config_initializers do |app|
|
||||
app.config.sass.load_paths += [self.root.join('app', 'assets', 'stylesheets', 'eaterprises_feature')]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
module EaterprisesFeature
|
||||
VERSION = "0.0.1"
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
class EaterprisesFeatureGenerator < Rails::Generators::Base
|
||||
include Chili::GeneratorProxy
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
# desc "Explaining what the task does"
|
||||
# task :eaterprises_feature do
|
||||
# # Task goes here
|
||||
# end
|
||||
@@ -0,0 +1 @@
|
||||
$link_text_color: #de790c;
|
||||
@@ -0,0 +1,60 @@
|
||||
/*--------------------------------------*/
|
||||
/* Colors
|
||||
/*--------------------------------------*/
|
||||
$c_green: #8dba53; /* Spree green */
|
||||
$c_red: #e45353; /* Error red */
|
||||
|
||||
diediedie
|
||||
|
||||
$layout_background_color: #FFFFFF;
|
||||
$title_text_color: #404042;
|
||||
$body_text_color: #404042;
|
||||
$link_text_color: #006066;
|
||||
|
||||
$product_background_color: #FFFFFF;
|
||||
$product_title_text_color: #404042;
|
||||
$product_body_text_color: #404042;
|
||||
$product_link_text_color: #BBBBBB;
|
||||
|
||||
/*--------------------------------------*/
|
||||
/* Fonts import from remote
|
||||
/*--------------------------------------*/
|
||||
@import url(//fonts.googleapis.com/css?family=Ubuntu:400,700,400italic,700italic|&subset=latin,cyrillic,greek,greek-ext,latin-ext,cyrillic-ext);
|
||||
|
||||
/*--------------------------------------*/
|
||||
/* Font families
|
||||
/*--------------------------------------*/
|
||||
$ff_base: 'Ubuntu', sans-serif;
|
||||
|
||||
/*--------------------------------------
|
||||
| Font sizes
|
||||
|--------------------------------------
|
||||
|- Navigation
|
||||
| */
|
||||
$header_navigation_font_size: 14px;
|
||||
$horizontal_navigation_font_size: 16px;
|
||||
$main_navigation_header_font_size: 14px;
|
||||
$main_navigation_font_size: 12px;
|
||||
/*|------------------------------------
|
||||
|- Product Listing
|
||||
| */
|
||||
$product_list_name_font_size: 12px;
|
||||
$product_list_price_font_size: 16px;
|
||||
$product_list_header_font_size: 20px;
|
||||
$product_list_search_font_size: 14px;
|
||||
/*|------------------------------------
|
||||
|- Product Details
|
||||
| */
|
||||
$product_detail_name_font_size: 24px;
|
||||
$product_detail_description_font_size: 12px;
|
||||
$product_detail_price_font_size: 20px;
|
||||
$product_detail_title_font_size: 14px;
|
||||
/*|------------------------------------
|
||||
|- Basic
|
||||
| */
|
||||
$heading_font_size: 24px;
|
||||
$sub_heading_font_size: 14px;
|
||||
$button_font_size: 12px;
|
||||
$input_box_font_size: 13px;
|
||||
$base_font_size: 12px;
|
||||
$button_border_color: rgba(0, 138, 189, .75);
|
||||
@@ -3,5 +3,5 @@ require "local_organics_feature/engine"
|
||||
|
||||
module LocalOrganicsFeature
|
||||
extend Chili::Base
|
||||
active_if { true } # edit this to activate/deactivate feature at runtime
|
||||
active_if { ENV['OFW_DEPLOYMENT'] == 'local_organics' }
|
||||
end
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
module LocalOrganicsFeature
|
||||
class Engine < ::Rails::Engine
|
||||
isolate_namespace LocalOrganicsFeature
|
||||
|
||||
if ENV['OFW_DEPLOYMENT'] == 'local_organics'
|
||||
initializer 'local_organics_feature.sass', :after => :load_config_initializers do |app|
|
||||
app.config.sass.load_paths += [self.root.join('app', 'assets', 'stylesheets', 'local_organics_feature')]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user