alchemy_spree 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -1
- data/Versionfile +3 -1
- data/alchemy_spree.gemspec +2 -2
- data/app/controllers/spree/base_controller_decorator.rb +1 -1
- data/app/controllers/spree/user_sessions_controller_decorator.rb +4 -2
- data/app/models/alchemy/user_decorator.rb +14 -0
- data/app/views/alchemy/admin/spree/index.html.erb +37 -14
- data/lib/alchemy_spree.rb +1 -1
- data/lib/alchemy_spree/alchemy_language_store.rb +17 -0
- data/lib/alchemy_spree/engine.rb +8 -1
- data/lib/alchemy_spree/version.rb +1 -1
- data/lib/spree/authentication_helpers.rb +28 -0
- metadata +9 -29
- data/lib/alchemy_spree/alchemy_language_id_store.rb +0 -14
data/Gemfile
CHANGED
@@ -3,6 +3,9 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in alchemy_spree.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
+
gem 'alchemy_cms', '2.2.rc12', :github => 'magiclabs/alchemy_cms'
|
7
|
+
gem 'spree', '1.2.0.beta', :github => 'spree/spree', :branch => 'auth-take-two'
|
8
|
+
|
6
9
|
group :developmemt, :test do
|
7
|
-
|
10
|
+
gem 'sqlite3'
|
8
11
|
end
|
data/Versionfile
CHANGED
data/alchemy_spree.gemspec
CHANGED
@@ -15,6 +15,6 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.require_paths = ["lib"]
|
16
16
|
gem.version = AlchemySpree::VERSION
|
17
17
|
|
18
|
-
gem.add_dependency('alchemy_cms', ['~> 2.
|
19
|
-
gem.add_dependency('spree', ['~> 1.0.
|
18
|
+
#gem.add_dependency('alchemy_cms', ['~> 2.2.rc12'])
|
19
|
+
#gem.add_dependency('spree', ['~> 1.1.0.beta'])
|
20
20
|
end
|
@@ -1,18 +1,41 @@
|
|
1
1
|
<%= image_tag('alchemy/ajax_loader.gif', :id => "frame_load_info", :style => "position: absolute; top: 50%; left: 50%; margin-top: -12px; margin-left: -12px") %>
|
2
2
|
<iframe src="<%= spree.admin_url(:protocol => Rails.env.production? ? 'https' : nil) %>" frameborder=0 width="100%" id="spree_admin" style="display: none"></iframe>
|
3
3
|
<script type="text/javascript">
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
4
|
+
jQuery(document).ready(function($) {
|
5
|
+
var $frame = $('iframe#spree_admin');
|
6
|
+
|
7
|
+
function sizeSpreeFrame() {
|
8
|
+
$frame.css({height: $(window).height() - 30});
|
9
|
+
}
|
10
|
+
|
11
|
+
$('#toolbar').remove();
|
12
|
+
$('#archive_all').css({padding: 0});
|
13
|
+
|
14
|
+
$frame.on('load', function() {
|
15
|
+
var frame_document;
|
16
|
+
var frame_window = (this.contentWindow || this.contentDocument);
|
17
|
+
var elements = ['header', 'footer', 'admin-menu', 'sub-menu', 'content'];
|
18
|
+
if (frame_window.document) {
|
19
|
+
frame_document = frame_window.document;
|
20
|
+
} else {
|
21
|
+
frame_document = frame_window;
|
22
|
+
frame_window = frame_document.window;
|
23
|
+
}
|
24
|
+
frame_document.body.style.backgroundColor = '#EDEDED';
|
25
|
+
frame_document.body.style.fontFamily = '"Lucida Grande", Arial, sans-serif';
|
26
|
+
frame_document.body.style.fontSize = '12px';
|
27
|
+
for (var i = elements.length - 1; i >= 0; i--) {
|
28
|
+
element = frame_document.getElementById(elements[i]);
|
29
|
+
if (element) {
|
30
|
+
if (element.id === 'header' || element.id === 'footer') element.style.display = 'none';
|
31
|
+
element.style.margin = 0;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
sizeSpreeFrame();
|
35
|
+
$('#frame_load_info').hide();
|
36
|
+
$frame.show();
|
37
|
+
});
|
38
|
+
|
39
|
+
$(window).on('resize', sizeSpreeFrame);
|
40
|
+
});
|
18
41
|
</script>
|
data/lib/alchemy_spree.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require "alchemy_spree/engine"
|
1
|
+
require "alchemy_spree/engine"
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module AlchemySpree
|
2
|
+
module AlchemyLanguageStore
|
3
|
+
def self.included(c)
|
4
|
+
c.send(:before_filter, :store_alchemy_language)
|
5
|
+
end
|
6
|
+
|
7
|
+
private
|
8
|
+
|
9
|
+
def store_alchemy_language
|
10
|
+
@alchemy_language ||= Alchemy::Language.find_by_code(::I18n.locale.to_s)
|
11
|
+
@alchemy_language ||= Alchemy::Language.get_default
|
12
|
+
session[:language_id] = @alchemy_language.id
|
13
|
+
session[:language_code] = @alchemy_language.code
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
data/lib/alchemy_spree/engine.rb
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
require "alchemy_spree/alchemy_module"
|
2
|
-
require 'alchemy_spree/
|
2
|
+
require 'alchemy_spree/alchemy_language_store'
|
3
3
|
|
4
4
|
module AlchemySpree
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
engine_name 'alchemy_spree'
|
7
7
|
|
8
|
+
if defined?(Spree.user_class)
|
9
|
+
initializer 'spree.user_class', :after => 'alchemy.include_authentication_helpers' do
|
10
|
+
Spree.user_class = "Alchemy::User"
|
11
|
+
require File.join(File.dirname(__FILE__), '../spree/authentication_helpers')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
8
15
|
def self.activate
|
9
16
|
Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")) do |c|
|
10
17
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Spree
|
2
|
+
module AuthenticationHelpers
|
3
|
+
def self.included(receiver)
|
4
|
+
receiver.send :helper_method, :spree_login_path
|
5
|
+
receiver.send :helper_method, :spree_signup_path
|
6
|
+
receiver.send :helper_method, :spree_logout_path
|
7
|
+
receiver.send :helper_method, :spree_current_user
|
8
|
+
end
|
9
|
+
|
10
|
+
def spree_current_user
|
11
|
+
current_alchemy_user
|
12
|
+
end
|
13
|
+
|
14
|
+
def spree_login_path
|
15
|
+
alchemy.login_path
|
16
|
+
end
|
17
|
+
|
18
|
+
def spree_signup_path
|
19
|
+
alchemy.signup_path
|
20
|
+
end
|
21
|
+
|
22
|
+
def spree_logout_path
|
23
|
+
alchemy.logout_path
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
ApplicationController.send :include, Spree::AuthenticationHelpers
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_spree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,30 +9,8 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
-
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: alchemy_cms
|
16
|
-
requirement: &70101865134720 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 2.1.6
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: *70101865134720
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: spree
|
27
|
-
requirement: &70101865133520 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0.1
|
33
|
-
type: :runtime
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70101865133520
|
12
|
+
date: 2012-06-11 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
36
14
|
description: A Alchemy CMS and Spree connector
|
37
15
|
email:
|
38
16
|
- tvd@magiclabs.de
|
@@ -52,6 +30,7 @@ files:
|
|
52
30
|
- app/controllers/spree/base_controller_decorator.rb
|
53
31
|
- app/controllers/spree/user_sessions_controller_decorator.rb
|
54
32
|
- app/models/alchemy/essence_spree_product.rb
|
33
|
+
- app/models/alchemy/user_decorator.rb
|
55
34
|
- app/overrides/include_tinymce_js.rb
|
56
35
|
- app/views/alchemy/admin/spree/index.html.erb
|
57
36
|
- app/views/alchemy/essences/_essence_spree_product_editor.html.erb
|
@@ -61,10 +40,11 @@ files:
|
|
61
40
|
- config/routes.rb
|
62
41
|
- db/migrate/20120229160509_create_alchemy_essence_spree_products.rb
|
63
42
|
- lib/alchemy_spree.rb
|
64
|
-
- lib/alchemy_spree/
|
43
|
+
- lib/alchemy_spree/alchemy_language_store.rb
|
65
44
|
- lib/alchemy_spree/alchemy_module.rb
|
66
45
|
- lib/alchemy_spree/engine.rb
|
67
46
|
- lib/alchemy_spree/version.rb
|
47
|
+
- lib/spree/authentication_helpers.rb
|
68
48
|
- script/rails
|
69
49
|
- test/alchemy_spree_test.rb
|
70
50
|
- test/dummy/Rakefile
|
@@ -114,7 +94,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
114
94
|
version: '0'
|
115
95
|
segments:
|
116
96
|
- 0
|
117
|
-
hash: -
|
97
|
+
hash: -1812501221866682820
|
118
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
99
|
none: false
|
120
100
|
requirements:
|
@@ -123,10 +103,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
103
|
version: '0'
|
124
104
|
segments:
|
125
105
|
- 0
|
126
|
-
hash: -
|
106
|
+
hash: -1812501221866682820
|
127
107
|
requirements: []
|
128
108
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.8.
|
109
|
+
rubygems_version: 1.8.24
|
130
110
|
signing_key:
|
131
111
|
specification_version: 3
|
132
112
|
summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module AlchemyCrm
|
2
|
-
module AlchemyLanguageIdStore
|
3
|
-
def self.included(c)
|
4
|
-
c.send(:before_filter, :store_alchemy_language_id)
|
5
|
-
end
|
6
|
-
|
7
|
-
private
|
8
|
-
|
9
|
-
def store_alchemy_language_id
|
10
|
-
session[:language_id] ||= Alchemy::Language.get_default.id
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|