solidus_categories 1.2 → 2.3

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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.bundle/config +1 -0
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +20 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +45 -0
  7. data/Rakefile +2 -0
  8. data/app/decorators/spree/admin/properties_controller_decorator.rb +61 -0
  9. data/app/helpers/render_nested_options_helper.rb +23 -0
  10. data/app/helpers/render_sortable_tree_helper.rb +62 -0
  11. data/app/helpers/render_tree_helper.rb +45 -0
  12. data/app/helpers/the_sortable_tree_helper.rb +146 -0
  13. data/app/models/spree/property_decorator.rb +7 -0
  14. data/app/overrides/listing_properties.rb +5 -0
  15. data/app/views/spree/admin/_listing_properties.html.erb +10 -0
  16. data/app/views/spree/admin/properties/_editform.html.erb +21 -0
  17. data/app/views/spree/admin/properties/_form.html.erb +24 -0
  18. data/app/views/spree/admin/properties/edit.html.erb +28 -0
  19. data/app/views/spree/admin/properties/manage.html.erb +3 -0
  20. data/app/views/spree/admin/properties/show.html.erb +15 -0
  21. data/bin/console +14 -0
  22. data/bin/setup +8 -0
  23. data/config/locales/en.yml +1918 -0
  24. data/config/routes.rb +15 -0
  25. data/db/20160701150045_add_position_to_spree_properties.rb +5 -0
  26. data/db/20160705145644_add_fields_to_properties.rb +10 -0
  27. data/lib/solidus_categories.rb +5 -0
  28. data/lib/solidus_categories/engine.rb +24 -0
  29. data/lib/solidus_categories/version.rb +3 -0
  30. data/lib/tasks/install.rake +57 -0
  31. data/solidus_categories.gemspec +25 -0
  32. data/vendor/assets/javascripts/spree/backend/all.js +16 -0
  33. data/vendor/assets/javascripts/spree/frontend/all.js +11 -0
  34. data/vendor/assets/stylesheets/.keep +0 -0
  35. data/vendor/assets/stylesheets/spree/backend/all.css +12 -0
  36. data/vendor/assets/stylesheets/spree/frontend/all.css +10 -0
  37. metadata +53 -3
@@ -0,0 +1,15 @@
1
+ Rails.application.routes.draw do
2
+
3
+
4
+ Spree::Core::Engine.routes.draw do
5
+ namespace :admin do
6
+ resources :properties do
7
+ collection do
8
+ get :nested_options, :manage, :node_manage
9
+ post :rebuild
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,5 @@
1
+ class AddPositionToSpreeProperties < ActiveRecord::Migration
2
+ def change
3
+ add_column :spree_properties , :position ,:integer
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ class AddFieldsToProperties < ActiveRecord::Migration
2
+ def change
3
+ add_column :spree_properties, :lft, :integer,:null => false, :index => true, :default => 0
4
+ add_column :spree_properties, :rgt,:integer, :null => false, :index => true, :default => 0
5
+ add_column :spree_properties, :parent_id, :integer ,:null => false, :default => 0
6
+
7
+ add_column :spree_properties, :depth, :integer ,:null => false, :default => 0
8
+
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ require "solidus_categories/version"
2
+ require 'solidus_categories/engine'
3
+ module SolidusCategories
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,24 @@
1
+ module SolidusCategories
2
+ class Engine < Rails::Engine
3
+ require 'the_sortable_tree'
4
+ #isolate_namespace Spree
5
+ engine_name 'solidus_catgories'
6
+
7
+ config.autoload_paths += %W(#{config.root}/lib)
8
+
9
+ # use rspec for tests
10
+ config.generators do |g|
11
+ g.test_framework :rspec
12
+ end
13
+
14
+
15
+
16
+ def self.activate
17
+ Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
18
+ Rails.configuration.cache_classes ? require(c) : load(c)
19
+ end
20
+ end
21
+
22
+ config.to_prepare &method(:activate).to_proc
23
+ end
24
+ end
@@ -0,0 +1,3 @@
1
+ module SolidusCategories
2
+ VERSION = "2.3"
3
+ end
@@ -0,0 +1,57 @@
1
+ require 'rails/generators'
2
+
3
+ namespace :soliduscategories do
4
+
5
+ desc "perform all rake tasks"
6
+ task :install do
7
+ Rake::Task["soliduscategories:copy_stylesheets"].execute
8
+ Rake::Task["soliduscategories:copy_helpers"].execute
9
+ Rake::Task["soliduscategories:copy_migrations"].execute
10
+ Rake::Task["soliduscategories:copy_locales"].execute
11
+ end
12
+
13
+ task :copy_locales do
14
+ source = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "config/locales", "en.yml")
15
+ target = File.join(Rails.root, "config/locales", "en.yml")
16
+ FileUtils.cp_r source, target
17
+ end
18
+
19
+ task :copy_stylesheets do
20
+ source = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "vendor/assets/stylesheets/spree/backend", "all.css")
21
+ target = File.join(Rails.root, "vendor/assets/stylesheets/spree/backend", "all.css")
22
+ FileUtils.cp_r source, target
23
+
24
+ source = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "vendor/assets/javascripts/spree/backend", "all.js")
25
+ target = File.join(Rails.root, "vendor/assets/javascripts/spree/backend", "all.js")
26
+ FileUtils.cp_r source, target
27
+ end
28
+
29
+ task :copy_helpers do
30
+ source = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "app/helpers", "render_tree_helper.rb")
31
+ target = File.join(Rails.root, "app/helpers", "render_tree_helper.rb")
32
+ FileUtils.cp_r source, target
33
+ source = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "app/helpers", "render_nested_options_helper.rb")
34
+ target = File.join(Rails.root, "app/helpers", "render_nested_options_helper.rb")
35
+ FileUtils.cp_r source, target
36
+ source = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "app/helpers", "render_sortable_tree_helper.rb")
37
+ target = File.join(Rails.root, "app/helpers", "render_sortable_tree_helper.rb")
38
+ FileUtils.cp_r source, target
39
+ source = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "app/helpers", "the_sortable_tree_helper.rb")
40
+ target = File.join(Rails.root, "app/helpers", "the_sortable_tree_helper.rb")
41
+ FileUtils.cp_r source, target
42
+ end
43
+
44
+
45
+ task :copy_migrations do
46
+ source = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "db", "20160701150045_add_position_to_spree_properties.rb")
47
+ target = File.join(Rails.root, "db/migrate", "20160701150045_add_position_to_spree_properties.rb")
48
+ FileUtils.cp_r source, target
49
+
50
+ source1 = File.join(Gem.loaded_specs["solidus_categories"].full_gem_path, "db", "20160705145644_add_fields_to_properties.rb")
51
+ target1 = File.join(Rails.root, "db/migrate", "20160705145644_add_fields_to_properties.rb")
52
+ FileUtils.cp_r source1, target1
53
+ end
54
+
55
+ end
56
+
57
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'solidus_categories/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "solidus_categories"
8
+ spec.version = SolidusCategories::VERSION
9
+ spec.authors = ["prasanthi"]
10
+ spec.email = ["prasanthi.ym@gmail.com"]
11
+
12
+ spec.summary = "Changes Spree Taxonomies and Taxons to Catalogs and Categories in both admin and frontend"
13
+
14
+ spec.homepage = "https://github.com/prasanthiym/solidus_categories"
15
+
16
+ spec.files = `git ls-files`.split("\n")
17
+ spec.test_files = `git ls-files -- spec/*`.split("\n")
18
+ spec.require_path = 'lib'
19
+ spec.requirements << 'none'
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.12"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_dependency "the_sortable_tree", "~> 2.5.0"
24
+
25
+ end
@@ -0,0 +1,16 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require spree/backend
10
+ //= require jquery.ui.nestedSortable
11
+ //= require sortable_tree/initializer
12
+ //= require expandable_tree/jquery.cookie
13
+ //= require expandable_tree/restorable
14
+ //= require expandable_tree/hashchange
15
+ //= require expandable_tree/initializer
16
+ //= require_tree .
@@ -0,0 +1,11 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery
8
+ //= require jquery_ujs
9
+ //= require spree/frontend
10
+
11
+ //= require_tree .
File without changes
@@ -0,0 +1,12 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *
6
+ *= require spree/backend
7
+ *= require sortable_tree
8
+ *= require nested_options
9
+ *= require expandable_tree
10
+ *= require_self
11
+ *= require_tree .
12
+ */
@@ -0,0 +1,10 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *
6
+ *= require spree/frontend
7
+
8
+ *= require_self
9
+ *= require_tree .
10
+ */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_categories
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: '2.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - prasanthi
@@ -38,13 +38,62 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: the_sortable_tree
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 2.5.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.5.0
41
55
  description:
42
56
  email:
43
57
  - prasanthi.ym@gmail.com
44
58
  executables: []
45
59
  extensions: []
46
60
  extra_rdoc_files: []
47
- files: []
61
+ files:
62
+ - ".bundle/config"
63
+ - Gemfile
64
+ - Gemfile.lock
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - app/decorators/spree/admin/properties_controller_decorator.rb
69
+ - app/helpers/render_nested_options_helper.rb
70
+ - app/helpers/render_sortable_tree_helper.rb
71
+ - app/helpers/render_tree_helper.rb
72
+ - app/helpers/the_sortable_tree_helper.rb
73
+ - app/models/spree/property_decorator.rb
74
+ - app/overrides/listing_properties.rb
75
+ - app/views/spree/admin/_listing_properties.html.erb
76
+ - app/views/spree/admin/properties/_editform.html.erb
77
+ - app/views/spree/admin/properties/_form.html.erb
78
+ - app/views/spree/admin/properties/edit.html.erb
79
+ - app/views/spree/admin/properties/manage.html.erb
80
+ - app/views/spree/admin/properties/show.html.erb
81
+ - bin/console
82
+ - bin/setup
83
+ - config/locales/en.yml
84
+ - config/routes.rb
85
+ - db/20160701150045_add_position_to_spree_properties.rb
86
+ - db/20160705145644_add_fields_to_properties.rb
87
+ - lib/solidus_categories.rb
88
+ - lib/solidus_categories/engine.rb
89
+ - lib/solidus_categories/version.rb
90
+ - lib/tasks/install.rake
91
+ - solidus_categories.gemspec
92
+ - vendor/assets/javascripts/spree/backend/all.js
93
+ - vendor/assets/javascripts/spree/frontend/all.js
94
+ - vendor/assets/stylesheets/.keep
95
+ - vendor/assets/stylesheets/spree/backend/all.css
96
+ - vendor/assets/stylesheets/spree/frontend/all.css
48
97
  homepage: https://github.com/prasanthiym/solidus_categories
49
98
  licenses: []
50
99
  metadata: {}
@@ -62,7 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
111
  - - ">="
63
112
  - !ruby/object:Gem::Version
64
113
  version: '0'
65
- requirements: []
114
+ requirements:
115
+ - none
66
116
  rubyforge_project:
67
117
  rubygems_version: 2.4.8
68
118
  signing_key: