c80_yax 0.1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/CODE_OF_CONDUCT.md +49 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +41 -0
  7. data/Rakefile +2 -0
  8. data/app/admin/c80_yax/items.rb +128 -0
  9. data/app/admin/c80_yax/prop_names.rb +90 -0
  10. data/app/admin/c80_yax/strsubcats.rb +128 -0
  11. data/app/admin/c80_yax/uoms.rb +35 -0
  12. data/app/admin/c80_yax/x_c80_yax.rb +5 -0
  13. data/app/assets/javascripts/backend/items.js +416 -0
  14. data/app/assets/javascripts/c80_yax.js.coffee +6 -0
  15. data/app/assets/javascripts/lib_backend/collapsable-groups.js +22 -0
  16. data/app/assets/javascripts/lib_backend/jalert.js +16 -0
  17. data/app/assets/stylesheets/c80_yax/backend/active_admin/admin_items.scss +152 -0
  18. data/app/assets/stylesheets/c80_yax/backend/collapsed.scss +56 -0
  19. data/app/assets/stylesheets/c80_yax/backend/jquery-my-dialog.scss +22 -0
  20. data/app/assets/stylesheets/c80_yax/lib/loading.scss +13 -0
  21. data/app/assets/stylesheets/c80_yax/mixins.scss +89 -0
  22. data/app/assets/stylesheets/c80_yax_backend.scss +7 -0
  23. data/app/controllers/c80_yax/admin_data_controller.rb +22 -0
  24. data/app/controllers/c80_yax/app_controller.rb +6 -0
  25. data/app/helpers/c80_yax/data_helper.rb +84 -0
  26. data/app/models/c80_yax/iphoto.rb +7 -0
  27. data/app/models/c80_yax/item.rb +169 -0
  28. data/app/models/c80_yax/item_prop.rb +83 -0
  29. data/app/models/c80_yax/prop.rb +5 -0
  30. data/app/models/c80_yax/prop_name.rb +32 -0
  31. data/app/models/c80_yax/strsubcat.rb +71 -0
  32. data/app/models/c80_yax/uom.rb +5 -0
  33. data/app/uploaders/c80_yax/iphoto_uploader.rb +41 -0
  34. data/bin/console +14 -0
  35. data/bin/setup +8 -0
  36. data/c80_yax.gemspec +26 -0
  37. data/config/locales/ru.yml +52 -0
  38. data/config/routes.rb +3 -0
  39. data/db/migrate/20161030061203_create_c80_yax_strsubcats.rb +12 -0
  40. data/db/migrate/20161030225354_create_c80_yax_items.rb +20 -0
  41. data/db/migrate/20161107202727_create_c80_yax_iphotos.rb +11 -0
  42. data/db/migrate/20161107210000_create_c80_yax_props.rb +15 -0
  43. data/db/migrate/20161108095505_create_c80_yax_uoms.rb +11 -0
  44. data/db/migrate/20161108095950_create_c80_yax_prop_names.rb +13 -0
  45. data/db/migrate/20161108100707_create_c80_yax_join_table_prop_names_strsubcats.rb +12 -0
  46. data/db/migrate/20161108102828_create_c80_yax_item_props.rb +13 -0
  47. data/db/seeds/c80_yax_01_fill_props.rb +11 -0
  48. data/lib/c80_yax/engine.rb +23 -0
  49. data/lib/c80_yax/version.rb +3 -0
  50. data/lib/c80_yax.rb +8 -0
  51. metadata +135 -0
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/c80_yax.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'c80_yax/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "c80_yax"
8
+ spec.version = C80Yax::VERSION
9
+ spec.authors = ["C80609A"]
10
+ spec.email = ["c080609a@gmail.com"]
11
+
12
+ spec.summary = "Yax gem"
13
+ spec.description = "Gem adds yax to site"
14
+ spec.homepage = "https://github.com/c080609a/c80_yax"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.12"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_dependency 'activesupport', ['>= 3.0.0']
25
+
26
+ end
@@ -0,0 +1,52 @@
1
+ ru:
2
+ c80_yax:
3
+ active_admin:
4
+ menu:
5
+ core_item: 'Каталог'
6
+ strsubcat: 'Категории'
7
+ item: 'Товары'
8
+ activerecord:
9
+ models:
10
+ strsubcat:
11
+ one: 'категорию'
12
+ other: 'Категории'
13
+ item:
14
+ one: 'товар'
15
+ other: 'Товары'
16
+ # iphoto:
17
+ # one: 'Фотоm'
18
+ # other: 'Фотоr'
19
+ attributes:
20
+ c80_yax/strsubcat:
21
+ id: 'id'
22
+ ord: 'Порядковый №'
23
+ title: 'Название'
24
+ created_at: 'Дата создания'
25
+ updated_at: 'Обновлено'
26
+ parent: 'Принадлежит категории'
27
+ parent_id_in: 'Принадлежит категории'
28
+ c80_yax/item:
29
+ id: 'id'
30
+ title: 'Название'
31
+ short_desc: 'Краткое описание'
32
+ full_desc: 'Подробное описание'
33
+ is_hit: 'Хит'
34
+ is_sale: 'Акция'
35
+ is_main: 'Выводить на главной'
36
+ is_gift: 'Подарочный набор'
37
+ is_starting: 'Стартовый набор'
38
+ is_available: 'В наличии'
39
+ strsubcat: 'Категория'
40
+ related_parent: 'related_parent'
41
+ related_childs: 'related_childs'
42
+ iphotos: 'Фото'
43
+ # iphoto: 'Фото'
44
+ errors:
45
+ models:
46
+ c80_yax/strsubcat:
47
+ attributes:
48
+ title:
49
+ taken: 'Категория с таким названием уже существует'
50
+ blank: 'Укажите, пожалуйста, название категории'
51
+ too_short: 'Название слишком короткое'
52
+ too_long: 'Название слишком длинное'
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ C80Yax::Engine.routes.draw do
2
+ match 'admin_data_get_strsubcat_propnames', :to => 'admin_data#get_strsubcat_propnames', :via => :post
3
+ end
@@ -0,0 +1,12 @@
1
+ class CreateC80YaxStrsubcats < ActiveRecord::Migration
2
+ def change
3
+ create_table :c80_yax_strsubcats do |t|
4
+ t.string :title
5
+ t.string :slug
6
+ t.integer :ord
7
+ t.references :parent, index: true
8
+
9
+ t.timestamps null: false
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,20 @@
1
+ class CreateC80YaxItems < ActiveRecord::Migration
2
+ def change
3
+ create_table :c80_yax_items do |t|
4
+ t.string :title
5
+ t.string :slug
6
+ t.text :short_desc
7
+ t.text :full_desc
8
+ t.boolean :is_hit
9
+ t.boolean :is_sale
10
+ t.boolean :is_main
11
+ t.boolean :is_gift
12
+ t.boolean :is_starting
13
+ t.boolean :is_available
14
+ t.references :strsubcat, index: true
15
+ t.references :related_parent, index: true
16
+
17
+ t.timestamps null: false
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,11 @@
1
+ class CreateC80YaxIphotos < ActiveRecord::Migration
2
+ def change
3
+ create_table :c80_yax_iphotos, :options => 'COLLATE=utf8_unicode_ci' do |t|
4
+ t.string :image
5
+ t.references :item, index: true
6
+
7
+ t.timestamps null: false
8
+ end
9
+ # add_foreign_key :ophotos, :offers
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ class CreateC80YaxProps < ActiveRecord::Migration
2
+ def change
3
+ create_table :c80_yax_props, :options => 'COLLATE=utf8_unicode_ci' do |t|
4
+
5
+ t.integer :thumb_sm_width
6
+ t.integer :thumb_sm_height
7
+ t.integer :thumb_md_width
8
+ t.integer :thumb_md_height
9
+ t.integer :thumb_lg_width
10
+ t.integer :thumb_lg_height
11
+
12
+ t.timestamps null: false
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ class CreateC80YaxUoms < ActiveRecord::Migration
2
+ def change
3
+ create_table :c80_yax_uoms, :options => 'COLLATE=utf8_unicode_ci' do |t|
4
+ t.string :title
5
+ t.string :comment
6
+ t.boolean :is_number
7
+
8
+ t.timestamps null: false
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ class CreateC80YaxPropNames < ActiveRecord::Migration
2
+ def change
3
+ create_table :c80_yax_prop_names, :options => 'COLLATE=utf8_unicode_ci' do |t|
4
+ t.string :title
5
+ t.boolean :is_normal_price
6
+ t.boolean :is_excluded_from_filtering
7
+ t.references :uom, index: true
8
+ t.references :related, index: true # NOTE:: see forbiz schema.rb:518: "prop_names" t.integer "related" (скорее всего, был забыт _id)
9
+
10
+ t.timestamps null: false
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ class CreateC80YaxJoinTablePropNamesStrsubcats < ActiveRecord::Migration
2
+ def change
3
+ create_table :c80_yax_prop_names_strsubcats, :id => false do |t|
4
+ t.integer :prop_name_id, :null => false
5
+ t.integer :strsubcat_id, :null => false
6
+ end
7
+
8
+ add_index :c80_yax_prop_names_strsubcats, [:prop_name_id, :strsubcat_id], :unique => true, :name => 'my_index_q'
9
+ add_index :c80_yax_prop_names_strsubcats, [:strsubcat_id, :prop_name_id], :unique => true, :name => 'my_index_w'
10
+
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreateC80YaxItemProps < ActiveRecord::Migration
2
+ def change
3
+ create_table :c80_yax_item_props, :options => 'COLLATE=utf8_unicode_ci' do |t|
4
+ t.string :value
5
+ t.references :item, index: true
6
+ t.references :prop_name, index: true
7
+
8
+ t.timestamps null: false
9
+ end
10
+ # add_foreign_key :item_props, :items
11
+ # add_foreign_key :item_props, :prop_names
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # rake db:seed:c80_yax_01_fill_props
2
+
3
+ C80Yax::Prop.delete_all
4
+ C80Yax::Prop.create!({
5
+ thumb_sm_width: 80,
6
+ thumb_sm_height: 50,
7
+ thumb_md_width: 250,
8
+ thumb_md_height: 160,
9
+ thumb_lg_width: 1000,
10
+ thumb_lg_height: 550
11
+ })
@@ -0,0 +1,23 @@
1
+ module C80Yax
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace C80Yax
4
+
5
+ initializer :c80_yax_engine do
6
+ if defined?(ActiveAdmin)
7
+ ActiveAdmin.application.load_paths += Dir["#{config.root}/app/models/**/"]
8
+ #ActiveAdmin.application.load_paths += Dir["#{config.root}/app/models/concerns/**/"]
9
+ ActiveAdmin.application.load_paths += Dir["#{config.root}/app/admin/c80_yax/**/"]
10
+ # ActiveAdmin.application.load_paths += Dir["#{config.root}/app/jobs/**/"]
11
+ end
12
+ end
13
+
14
+ initializer :append_migrations do |app|
15
+ unless app.root.to_s.match root.to_s
16
+ config.paths["db/migrate"].expanded.each do |expanded_path|
17
+ app.config.paths["db/migrate"] << expanded_path
18
+ end
19
+ end
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,3 @@
1
+ module C80Yax
2
+ VERSION = '0.1.0.1'
3
+ end
data/lib/c80_yax.rb ADDED
@@ -0,0 +1,8 @@
1
+ require "c80_yax/version"
2
+ require "c80_yax/engine"
3
+
4
+ module C80Yax
5
+ def self.table_name_prefix
6
+ 'c80_yax_'
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: c80_yax
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - C80609A
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.0.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.0.0
55
+ description: Gem adds yax to site
56
+ email:
57
+ - c080609a@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - CODE_OF_CONDUCT.md
64
+ - Gemfile
65
+ - LICENSE.txt
66
+ - README.md
67
+ - Rakefile
68
+ - app/admin/c80_yax/items.rb
69
+ - app/admin/c80_yax/prop_names.rb
70
+ - app/admin/c80_yax/strsubcats.rb
71
+ - app/admin/c80_yax/uoms.rb
72
+ - app/admin/c80_yax/x_c80_yax.rb
73
+ - app/assets/javascripts/backend/items.js
74
+ - app/assets/javascripts/c80_yax.js.coffee
75
+ - app/assets/javascripts/lib_backend/collapsable-groups.js
76
+ - app/assets/javascripts/lib_backend/jalert.js
77
+ - app/assets/stylesheets/c80_yax/backend/active_admin/admin_items.scss
78
+ - app/assets/stylesheets/c80_yax/backend/collapsed.scss
79
+ - app/assets/stylesheets/c80_yax/backend/jquery-my-dialog.scss
80
+ - app/assets/stylesheets/c80_yax/lib/loading.scss
81
+ - app/assets/stylesheets/c80_yax/mixins.scss
82
+ - app/assets/stylesheets/c80_yax_backend.scss
83
+ - app/controllers/c80_yax/admin_data_controller.rb
84
+ - app/controllers/c80_yax/app_controller.rb
85
+ - app/helpers/c80_yax/data_helper.rb
86
+ - app/models/c80_yax/iphoto.rb
87
+ - app/models/c80_yax/item.rb
88
+ - app/models/c80_yax/item_prop.rb
89
+ - app/models/c80_yax/prop.rb
90
+ - app/models/c80_yax/prop_name.rb
91
+ - app/models/c80_yax/strsubcat.rb
92
+ - app/models/c80_yax/uom.rb
93
+ - app/uploaders/c80_yax/iphoto_uploader.rb
94
+ - bin/console
95
+ - bin/setup
96
+ - c80_yax.gemspec
97
+ - config/locales/ru.yml
98
+ - config/routes.rb
99
+ - db/migrate/20161030061203_create_c80_yax_strsubcats.rb
100
+ - db/migrate/20161030225354_create_c80_yax_items.rb
101
+ - db/migrate/20161107202727_create_c80_yax_iphotos.rb
102
+ - db/migrate/20161107210000_create_c80_yax_props.rb
103
+ - db/migrate/20161108095505_create_c80_yax_uoms.rb
104
+ - db/migrate/20161108095950_create_c80_yax_prop_names.rb
105
+ - db/migrate/20161108100707_create_c80_yax_join_table_prop_names_strsubcats.rb
106
+ - db/migrate/20161108102828_create_c80_yax_item_props.rb
107
+ - db/seeds/c80_yax_01_fill_props.rb
108
+ - lib/c80_yax.rb
109
+ - lib/c80_yax/engine.rb
110
+ - lib/c80_yax/version.rb
111
+ homepage: https://github.com/c080609a/c80_yax
112
+ licenses:
113
+ - MIT
114
+ metadata: {}
115
+ post_install_message:
116
+ rdoc_options: []
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ requirements: []
130
+ rubyforge_project:
131
+ rubygems_version: 2.5.1
132
+ signing_key:
133
+ specification_version: 4
134
+ summary: Yax gem
135
+ test_files: []