alchemy_spree 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -3,9 +3,6 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in alchemy_spree.gemspec
4
4
  gemspec
5
5
 
6
- gem "alchemy_cms", :path => '../alchemy_cms'
7
- gem "spree", :path => '../spree'
8
-
9
6
  group :developmemt, :test do
10
7
  gem 'sqlite3'
11
8
  end
data/README.md CHANGED
@@ -4,10 +4,11 @@ The World's Most Flexible E-Commerce Platform meets The World's Most Flexible Co
4
4
 
5
5
  This gem is a [Alchemy CMS](https://github.com/magiclabs/alchemy_cms) and [Spree](https://github.com/spree/spree) connector.
6
6
 
7
- ### For now it does two things:
7
+ ### For now it does this:
8
8
 
9
9
  1. It provides an Alchemy module that displays Spree admin in an iframe inside Alchemy admin.
10
10
  2. It gives you a new Essence for Alchemy called EssenceSpreeProduct that you can use to place a Spree product on your page.
11
+ 3. It adds a TinyMCE editor to the Spree product description textarea.
11
12
 
12
13
  ### TODO:
13
14
 
data/Versionfile ADDED
@@ -0,0 +1 @@
1
+ '1.0.x' => {:branch => 'master'}
@@ -4,8 +4,8 @@ require File.expand_path('../lib/alchemy_spree/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Thomas von Deyen"]
6
6
  gem.email = ["tvd@magiclabs.de"]
7
- gem.description = %q{An Alchemy CMS and Spree connector}
8
- gem.summary = %q{An Alchemy CMS and Spree connector}
7
+ gem.description = %q{A Alchemy CMS and Spree connector}
8
+ gem.summary = %q{The World's Most Flexible E-Commerce Platform meets The World's Most Flexible Content Management System!}
9
9
  gem.homepage = "https://github.com/magiclabs/alchemy_spree"
10
10
 
11
11
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -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.1.5'])
19
- gem.add_dependency('spree', ['>= 1.0.0'])
18
+ gem.add_dependency('alchemy_cms', ['~> 2.1.6'])
19
+ gem.add_dependency('spree', ['~> 1.0.1'])
20
20
  end
@@ -0,0 +1,6 @@
1
+ Deface::Override.new(
2
+ :virtual_path => "spree/layouts/admin",
3
+ :name => "include_tinymce_js",
4
+ :insert_bottom => "[data-hook='admin_inside_head'], #admin_inside_head[data-hook]",
5
+ :text => "<%= render :partial => 'partials/tinymce_javascript' -%>"
6
+ )
@@ -1,4 +1,5 @@
1
- <iframe src="<%= spree.admin_url %>" frameborder=0 width="100%" id="spree_admin" style="display: none"></iframe>
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
+ <iframe src="<%= spree.admin_url(:protocol => Rails.env.production? ? 'https' : nil) %>" frameborder=0 width="100%" id="spree_admin" style="display: none"></iframe>
2
3
  <script type="text/javascript">
3
4
  jQuery(document).ready(function($) {
4
5
  var $frame = $('iframe#spree_admin');
@@ -9,6 +10,7 @@
9
10
  $frame.on('load', function() {
10
11
  $('#main_content').css({'background-color': '#162F54'});
11
12
  sizeSpreeFrame();
13
+ $('#frame_load_info').hide();
12
14
  $frame.show();
13
15
  });
14
16
  $(window).on('resize', sizeSpreeFrame);
@@ -3,6 +3,7 @@
3
3
  <%= select_tag(
4
4
  content.form_field_name,
5
5
  options_from_collection_for_select(Spree::Product.not_deleted, :id, :name, content.essence.spree_product_id),
6
- :class => 'alchemy_select'
6
+ :class => ['alchemy_select', html_options[:class]].join(' '),
7
+ :style => html_options[:style]
7
8
  ) %>
8
9
  </div>
@@ -0,0 +1,36 @@
1
+ <script type="text/javascript">
2
+ var tinyMCEPreInit = {
3
+ base: '/assets/tiny_mce',
4
+ suffix: ''
5
+ };
6
+ </script>
7
+ <script type="text/javascript" src="/assets/tiny_mce/tiny_mce"></script>
8
+ <script type="text/javascript">
9
+ jQuery(function($) {
10
+ var myConfig = { dompath: true };
11
+ if ($('textarea#product_description').length > 0) {
12
+ tinyMCE.init({
13
+ mode : "exact",
14
+ elements : 'product_description',
15
+ theme : "advanced",
16
+ language : '<%= ::I18n.locale.to_s.split('-')[0].downcase -%>',
17
+ skin : "o2k7",
18
+ skin_variant : 'silver',
19
+ inlinepopups_skin : 'alchemy',
20
+ popup_css : "/assets/alchemy/tinymce_dialog.css",
21
+ content_css : "/assets/alchemy/tinymce_content.css",
22
+ width : "100%",
23
+ plugins : "paste,inlinepopups",
24
+
25
+ // Theme options
26
+ theme_advanced_buttons1 : "bold,italic,underline,strikethrough,sub,sup,|,numlist,bullist,indent,outdent,|,removeformat,cleanup",
27
+ theme_advanced_buttons2 : "pastetext,pasteword,|,link,unlink,|,charmap,code,help",
28
+ theme_advanced_buttons3 : "",
29
+ theme_advanced_toolbar_location : "top",
30
+ theme_advanced_toolbar_align : "left",
31
+ theme_advanced_statusbar_location : "bottom",
32
+ theme_advanced_resizing : true
33
+ });
34
+ }
35
+ });
36
+ </script>
@@ -3,5 +3,15 @@ require "alchemy_spree/alchemy_module"
3
3
  module AlchemySpree
4
4
  class Engine < ::Rails::Engine
5
5
  engine_name 'alchemy_spree'
6
+
7
+ config.autoload_paths += %W(#{config.root}/lib)
8
+
9
+ def self.activate
10
+ Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/**/*.rb")) do |c|
11
+ Rails.application.config.cache_classes ? require(c) : load(c)
12
+ end
13
+ end
14
+
15
+ config.to_prepare &method(:activate).to_proc
6
16
  end
7
17
  end
@@ -1,3 +1,3 @@
1
1
  module AlchemySpree
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
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.0
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,31 +9,31 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-01 00:00:00.000000000 Z
12
+ date: 2012-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: alchemy_cms
16
- requirement: &70259663685060 !ruby/object:Gem::Requirement
16
+ requirement: &70180004895480 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: 2.1.5
21
+ version: 2.1.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70259663685060
24
+ version_requirements: *70180004895480
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: spree
27
- requirement: &70259663684340 !ruby/object:Gem::Requirement
27
+ requirement: &70180004894260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
- - - ! '>='
30
+ - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 1.0.0
32
+ version: 1.0.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70259663684340
36
- description: An Alchemy CMS and Spree connector
35
+ version_requirements: *70180004894260
36
+ description: A Alchemy CMS and Spree connector
37
37
  email:
38
38
  - tvd@magiclabs.de
39
39
  executables: []
@@ -45,13 +45,16 @@ files:
45
45
  - LICENSE
46
46
  - README.md
47
47
  - Rakefile
48
+ - Versionfile
48
49
  - alchemy_spree.gemspec
49
50
  - app/assets/images/alchemy_spree/alchemy_module_icon.png
50
51
  - app/controllers/alchemy/admin/spree_controller.rb
51
52
  - app/models/alchemy/essence_spree_product.rb
53
+ - app/overrides/include_tinymce_js.rb
52
54
  - app/views/alchemy/admin/spree/index.html.erb
53
55
  - app/views/alchemy/essences/_essence_spree_product_editor.html.erb
54
56
  - app/views/alchemy/essences/_essence_spree_product_view.html.erb
57
+ - app/views/partials/_tinymce_javascript.html.erb
55
58
  - config/authorization_rules.rb
56
59
  - config/routes.rb
57
60
  - db/migrate/20120229160509_create_alchemy_essence_spree_products.rb
@@ -108,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
111
  version: '0'
109
112
  segments:
110
113
  - 0
111
- hash: 2556095942562390661
114
+ hash: 2926926103786300071
112
115
  required_rubygems_version: !ruby/object:Gem::Requirement
113
116
  none: false
114
117
  requirements:
@@ -117,13 +120,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
120
  version: '0'
118
121
  segments:
119
122
  - 0
120
- hash: 2556095942562390661
123
+ hash: 2926926103786300071
121
124
  requirements: []
122
125
  rubyforge_project:
123
126
  rubygems_version: 1.8.15
124
127
  signing_key:
125
128
  specification_version: 3
126
- summary: An Alchemy CMS and Spree connector
129
+ summary: The World's Most Flexible E-Commerce Platform meets The World's Most Flexible
130
+ Content Management System!
127
131
  test_files:
128
132
  - test/alchemy_spree_test.rb
129
133
  - test/dummy/Rakefile