adminpanel 1.2.12 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +3 -4
  3. data/Gemfile +22 -20
  4. data/README.md +12 -9
  5. data/adminpanel.gemspec +29 -28
  6. data/app/assets/fonts/.keep +0 -0
  7. data/app/assets/javascripts/adminpanel/images_form.js +5 -2
  8. data/app/assets/javascripts/adminpanel/imagesloaded.js +5 -2
  9. data/app/assets/javascripts/adminpanel/tables.js +6 -3
  10. data/app/assets/javascripts/application-admin.js +2 -1
  11. data/app/assets/stylesheets/adminpanel/{_clearfix.css.scss → _clearfix.css} +0 -0
  12. data/app/assets/stylesheets/adminpanel/bootstrap.css +2 -2
  13. data/app/assets/stylesheets/adminpanel/medium-editor.css.scss +1 -1
  14. data/app/assets/stylesheets/application-admin.css +2 -1
  15. data/app/controllers/adminpanel/application_controller.rb +28 -21
  16. data/app/controllers/adminpanel/categories_controller.rb +16 -5
  17. data/app/controllers/adminpanel/galleries_controller.rb +11 -5
  18. data/app/controllers/adminpanel/sections_controller.rb +14 -0
  19. data/app/controllers/adminpanel/users_controller.rb +10 -80
  20. data/app/controllers/concerns/adminpanel/galleryzable_actions.rb +33 -0
  21. data/app/controllers/concerns/adminpanel/rest_actions.rb +109 -0
  22. data/app/helpers/adminpanel/application_helper.rb +0 -1
  23. data/app/helpers/adminpanel/custom_form_builder.rb +12 -13
  24. data/app/helpers/adminpanel/router_helper.rb +11 -2
  25. data/app/helpers/adminpanel/shared_pages_helper.rb +0 -1
  26. data/app/models/adminpanel/analytic.rb +3 -2
  27. data/app/models/adminpanel/gallery.rb +8 -4
  28. data/app/models/adminpanel/group.rb +1 -1
  29. data/app/models/adminpanel/image.rb +1 -2
  30. data/app/models/adminpanel/section.rb +19 -10
  31. data/app/models/adminpanel/user.rb +11 -3
  32. data/app/models/concerns/adminpanel/base.rb +149 -0
  33. data/app/models/concerns/adminpanel/galleryzation.rb +66 -0
  34. data/app/models/contact.rb +16 -9
  35. data/app/views/adminpanel/analytics/index.html.erb +2 -1
  36. data/app/views/adminpanel/categories/_categories_table.html.erb +6 -7
  37. data/app/views/adminpanel/categories/_category_form.html.erb +2 -2
  38. data/app/views/adminpanel/categories/create.js.erb +2 -2
  39. data/app/views/adminpanel/categories/index.html.erb +1 -1
  40. data/app/views/adminpanel/galleries/_galleries_table.html.erb +7 -7
  41. data/app/views/adminpanel/galleries/index.html.erb +6 -5
  42. data/app/views/adminpanel/sections/_sections_table.html.erb +2 -2
  43. data/app/views/adminpanel/sections/edit.html.erb +5 -3
  44. data/app/views/adminpanel/sections/show.html.erb +3 -3
  45. data/app/views/adminpanel/sessions/new.html.erb +1 -1
  46. data/app/views/layouts/_side_menu.html.erb +2 -2
  47. data/app/views/layouts/_top_bar.html.erb +3 -3
  48. data/app/views/layouts/admin-login.html.erb +0 -1
  49. data/app/views/layouts/admin.html.erb +3 -3
  50. data/app/views/shared/_delete_icon_button.html.erb +16 -0
  51. data/app/views/shared/_edit_icon_button.html.erb +14 -0
  52. data/app/views/shared/_error_messages.html.erb +1 -1
  53. data/app/views/shared/_form_fields.html.erb +15 -13
  54. data/app/views/shared/_gallery_entries.html.erb +2 -2
  55. data/app/views/shared/_init_editor.html.erb +5 -2
  56. data/app/views/shared/_new_resource_button.html.erb +18 -0
  57. data/app/views/shared/_remote_form_fields.html.erb +1 -1
  58. data/app/views/shared/_show_icon_button.html.erb +14 -0
  59. data/app/views/shared/edit.html.erb +3 -3
  60. data/app/views/shared/index.html.erb +13 -48
  61. data/app/views/shared/new.html.erb +3 -3
  62. data/app/views/shared/show.html.erb +5 -5
  63. data/config/initializers/pluralization_es.rb +16 -0
  64. data/config/locales/en.yml +89 -0
  65. data/config/locales/es.yml +4 -4
  66. data/config/routes.rb +15 -16
  67. data/lib/adminpanel.rb +8 -8
  68. data/lib/adminpanel/version.rb +1 -1
  69. data/lib/generators/adminpanel/gallery/gallery_generator.rb +12 -8
  70. data/lib/generators/adminpanel/gallery/templates/gallery_template.rb +2 -3
  71. data/lib/generators/adminpanel/initialize/templates/category_template.rb +2 -3
  72. data/lib/generators/adminpanel/resource/resource_generator.rb +24 -18
  73. data/lib/generators/adminpanel/resource/templates/controller.rb +5 -0
  74. data/lib/generators/adminpanel/resource/templates/resource.rb +3 -3
  75. data/lib/tasks/adminpanel/adminpanel.rake +43 -90
  76. data/spec/dummy/app/controllers/adminpanel/mugs_controller.rb +9 -0
  77. data/spec/dummy/app/controllers/adminpanel/products_controller.rb +12 -0
  78. data/spec/dummy/app/models/ability.rb +1 -1
  79. data/spec/dummy/app/models/adminpanel/categorization.rb +1 -2
  80. data/spec/dummy/app/models/adminpanel/category.rb +18 -19
  81. data/spec/dummy/app/models/adminpanel/mug.rb +37 -0
  82. data/spec/dummy/app/models/adminpanel/photo.rb +3 -3
  83. data/spec/dummy/app/models/adminpanel/product.rb +2 -2
  84. data/spec/dummy/config/application.rb +2 -11
  85. data/spec/dummy/config/database.yml +0 -6
  86. data/spec/dummy/config/environments/development.rb +11 -23
  87. data/spec/dummy/config/environments/production.rb +40 -32
  88. data/spec/dummy/config/environments/test.rb +13 -18
  89. data/spec/dummy/config/initializers/adminpanel_setup.rb +2 -1
  90. data/spec/dummy/config/locales/.keep +0 -0
  91. data/spec/dummy/db/schema.rb +68 -2
  92. data/spec/features/authentication_pages_spec.rb +15 -15
  93. data/spec/features/galleries_pages_spec.rb +30 -22
  94. data/spec/features/section_pages_spec.rb +15 -18
  95. data/spec/features/shared_pages_spec.rb +97 -127
  96. data/spec/generators/gallery_generator_spec.rb +2 -3
  97. data/spec/generators/resource_generator_spec.rb +20 -3
  98. data/spec/models/gallery_spec.rb +2 -2
  99. data/spec/models/section_spec.rb +8 -15
  100. data/spec/models/user_spec.rb +23 -39
  101. data/spec/spec_helper.rb +9 -1
  102. data/spec/support/factories.rb +52 -0
  103. data/spec/support/helper_methods.rb +25 -5
  104. data/spec/tasks/adminpanel_rake_spec.rb +11 -10
  105. metadata +361 -353
  106. data/app/assets/fonts/FontAwesome.otf +0 -0
  107. data/app/assets/fonts/fontawesome-webfont.eot +0 -0
  108. data/app/assets/fonts/fontawesome-webfont.svg +0 -255
  109. data/app/assets/fonts/fontawesome-webfont.ttf +0 -0
  110. data/app/assets/fonts/fontawesome-webfont.woff +0 -0
  111. data/app/assets/stylesheets/adminpanel/colorpicker.css +0 -7
  112. data/app/assets/stylesheets/adminpanel/elfinder.min.css +0 -59
  113. data/app/assets/stylesheets/adminpanel/font-awesome.min.css +0 -34
  114. data/app/helpers/adminpanel/pluralizations_helper.rb +0 -25
  115. data/app/helpers/adminpanel/rest_actions_helper.rb +0 -128
  116. data/app/views/adminpanel/galleries/delete.html.erb +0 -2
  117. data/app/views/adminpanel/galleries/edit.html.erb +0 -19
  118. data/app/views/adminpanel/galleries/new.html.erb +0 -18
  119. data/app/views/adminpanel/galleries/show.html.erb +0 -18
  120. data/app/views/adminpanel/galleries/update.html.erb +0 -2
  121. data/lib/adminpanel/active_record/adminpanel_extension.rb +0 -187
  122. data/spec/dummy/config/locales/en.yml +0 -5
  123. data/spec/support/define_factory_models.rb +0 -45
  124. data/spec/support/submit_forms_without_button.rb +0 -17
  125. data/spec/support/test_database.rb +0 -76
  126. data/spec/uploaders/gallery_uploader_spec.rb +0 -37
  127. data/spec/uploaders/image_uploader_spec.rb +0 -31
@@ -0,0 +1,9 @@
1
+ module Adminpanel
2
+ class MugsController < Adminpanel::ApplicationController
3
+
4
+ private
5
+ def mug_params
6
+ params.require(:mug).permit(:name, :number)
7
+ end
8
+ end
9
+ end
@@ -1,4 +1,16 @@
1
1
  module Adminpanel
2
2
  class ProductsController < Adminpanel::ApplicationController
3
+
4
+ private
5
+ def product_params
6
+ params.require(:product).permit(
7
+ :price,
8
+ :name,
9
+ :category_ids,
10
+ :description,
11
+ :photos_attributes => [:product_id, :file]
12
+ )
13
+ end
14
+
3
15
  end
4
16
  end
@@ -3,7 +3,7 @@ class Ability
3
3
 
4
4
  def initialize(user)
5
5
 
6
- if user.group.name == "Admin"
6
+ if user.group.name == 'Admin'
7
7
  can :manage, :all
8
8
  else
9
9
  # cannot :manage, Adminpanel::User
@@ -1,7 +1,6 @@
1
1
  module Adminpanel
2
2
  class Categorization < ActiveRecord::Base
3
- attr_accessible :product_id, :category_id
4
-
3
+ include Adminpanel::Base
5
4
  belongs_to :product
6
5
  belongs_to :category
7
6
 
@@ -1,27 +1,26 @@
1
1
  module Adminpanel
2
- class Category < ActiveRecord::Base
3
- attr_accessible :product_ids, :name, :model
2
+ class Category < ActiveRecord::Base
3
+ include Adminpanel::Base
4
+ validates_presence_of :model
4
5
 
5
- validates_presence_of :model
6
+ has_many :categorizations
7
+ has_many :products, :through => :categorizations, :dependent => :destroy
6
8
 
7
- has_many :categorizations
8
- has_many :products, :through => :categorizations, :dependent => :destroy
9
9
 
10
+ def self.form_attributes
11
+ [
12
+ {"name" => {"type" => "text_field", "name" => "name", "label" => "name", "placeholder" => "name"}},
13
+ # {'model' => {"type" => "text_field", "name" => "name", "label" => "name", "placeholder" => "name", 'show' => 'false'}},
14
+ {"product_ids" => {"type" => "has_many", "model" => "Adminpanel::Product", "name" => "product_ids"}},
15
+ ]
16
+ end
10
17
 
11
- def self.form_attributes
12
- [
13
- {"name" => {"type" => "text_field", "name" => "name", "label" => "name", "placeholder" => "name"}},
14
- # {'model' => {"type" => "text_field", "name" => "name", "label" => "name", "placeholder" => "name", 'show' => 'false'}},
15
- {"product_ids" => {"type" => "has_many", "model" => "Adminpanel::Product", "name" => "product_ids"}},
16
- ]
17
- end
18
-
19
- def self.display_name
20
- "Category"
21
- end
18
+ def self.display_name
19
+ "Categoria"
20
+ end
22
21
 
23
- def self.icon
24
- "icon-truck"
25
- end
22
+ def self.icon
23
+ "icon-truck"
26
24
  end
25
+ end
27
26
  end
@@ -0,0 +1,37 @@
1
+ module Adminpanel
2
+ class Mug < ActiveRecord::Base
3
+ include Adminpanel::Base
4
+
5
+
6
+ def self.form_attributes
7
+ [
8
+ {
9
+ 'name' => {
10
+ 'type' => 'text_field',
11
+ 'label' => 'name',
12
+ 'placeholder' => 'name'
13
+ }
14
+ },
15
+ {
16
+ 'number' => {
17
+ 'type' => 'number_field',
18
+ 'label' => 'number',
19
+ 'placeholder' => 'number'
20
+ }
21
+ },
22
+ ]
23
+ end
24
+
25
+ def self.display_name
26
+ 'Taza' #singular
27
+ end
28
+
29
+ # def self.icon
30
+ # "truck" # fa-{icon}
31
+ # end
32
+
33
+ def self.routes_options
34
+ { except:[:new, :create, :edit, :update, :destroy, :show], path:'tazas'}
35
+ end
36
+ end
37
+ end
@@ -1,8 +1,8 @@
1
1
  module Adminpanel
2
2
  class Photo < ActiveRecord::Base
3
- attr_accessible :product_id, :file
4
-
3
+ include Adminpanel::Base
4
+ # include Adminpanel::Galleryzation
5
5
  mount_uploader :file, PhotoUploader
6
-
6
+
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Adminpanel
2
2
  class Product < ActiveRecord::Base
3
- attr_accessible :price, :name, :photos_attributes, :category_ids, :description
4
-
3
+ include Adminpanel::Base
4
+
5
5
  has_many :categorizations
6
6
  has_many :categories, :through => :categorizations
7
7
  mount_images :photos
@@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__)
3
3
  require 'rails/all'
4
4
 
5
5
  Bundler.require(*Rails.groups)
6
- require "adminpanel"
6
+ require 'adminpanel'
7
7
 
8
8
  module Dummy
9
9
  class Application < Rails::Application
@@ -29,7 +29,7 @@ module Dummy
29
29
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
30
  config.i18n.default_locale = :es
31
31
  I18n.config.enforce_available_locales = true
32
-
32
+
33
33
  # Configure the default encoding used in templates for Ruby 1.9.
34
34
  config.encoding = "utf-8"
35
35
 
@@ -44,14 +44,6 @@ module Dummy
44
44
  # like if you have constraints or database-specific column types
45
45
  # config.active_record.schema_format = :sql
46
46
 
47
- # Enforce whitelist mode for mass assignment.
48
- # This will create an empty whitelist of attributes available for mass-assignment for all models
49
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
50
- # parameters by using an attr_accessible or attr_protected declaration.
51
- if Rails::VERSION::MAJOR == 3
52
- config.active_record.whitelist_attributes = true
53
- end
54
-
55
47
  # Enable the asset pipeline
56
48
  config.assets.enabled = true
57
49
 
@@ -59,4 +51,3 @@ module Dummy
59
51
  config.assets.version = '1.0'
60
52
  end
61
53
  end
62
-
@@ -16,9 +16,3 @@ test:
16
16
  adapter: sqlite3
17
17
  database: ":memory:"
18
18
  timeout: 500
19
-
20
- production:
21
- adapter: sqlite3
22
- database: db/production.sqlite3
23
- pool: 5
24
- timeout: 5000
@@ -1,41 +1,29 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- config.eager_load = false if Rails::VERSION::MAJOR == 4
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
10
11
 
11
- # Show full error reports and disable caching
12
+ # Show full error reports and disable caching.
12
13
  config.consider_all_requests_local = true
13
14
  config.action_controller.perform_caching = false
14
15
 
15
- # Don't care if the mailer can't send
16
+ # Don't care if the mailer can't send.
16
17
  config.action_mailer.raise_delivery_errors = false
17
18
 
18
- # Print deprecation notices to the Rails logger
19
+ # Print deprecation notices to the Rails logger.
19
20
  config.active_support.deprecation = :log
20
21
 
21
- if Rails::VERSION::MAJOR == 3
22
- # Log error messages when you accidentally call methods on nil.
23
- config.whiny_nils = true
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
24
 
25
- # Only use best-standards-support built into browsers
26
- config.action_dispatch.best_standards_support = :builtin
27
-
28
- # Raise exception on mass assignment protection for Active Record models
29
- config.active_record.mass_assignment_sanitizer = :strict
30
-
31
- # Log the query plan for queries taking more than this (works
32
- # with SQLite, MySQL, and PostgreSQL)
33
- config.active_record.auto_explain_threshold_in_seconds = 0.5
34
-
35
- # Do not compress assets
36
- config.assets.compress = false
37
- end
38
-
39
- # Expands the lines which load the assets
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
40
28
  config.assets.debug = true
41
29
  end
@@ -1,72 +1,80 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
- # Code is not reloaded between requests
4
+ # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
6
 
7
- # Full error reports are disabled and caching is turned on
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both thread web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
8
14
  config.consider_all_requests_local = false
9
15
  config.action_controller.perform_caching = true
10
16
 
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
12
23
  config.serve_static_assets = false
13
24
 
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
16
28
 
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
18
30
  config.assets.compile = false
19
31
 
20
- # Generate digests for assets URLs
32
+ # Generate digests for assets URLs.
21
33
  config.assets.digest = true
22
34
 
23
- if Rails::VERSION::MAJOR == 4
24
- config.eager_load = true
25
- config.assets.js_compressor = :uglifier
26
- end
27
-
28
- # Defaults to nil and saved in location specified by config.assets.prefix
29
- # config.assets.manifest = YOUR_PATH
35
+ # Version of your assets, change this if you want to expire all your assets.
36
+ config.assets.version = '1.0'
30
37
 
31
- # Specifies the header that your server uses for sending files
38
+ # Specifies the header that your server uses for sending files.
32
39
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
33
40
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
34
41
 
35
42
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
36
43
  # config.force_ssl = true
37
44
 
38
- # See everything in the log (default is :info)
39
- # config.log_level = :debug
45
+ # Set to :debug to see everything in the log.
46
+ config.log_level = :info
40
47
 
41
- # Prepend all log lines with the following tags
48
+ # Prepend all log lines with the following tags.
42
49
  # config.log_tags = [ :subdomain, :uuid ]
43
50
 
44
- # Use a different logger for distributed setups
51
+ # Use a different logger for distributed setups.
45
52
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
46
53
 
47
- # Use a different cache store in production
54
+ # Use a different cache store in production.
48
55
  # config.cache_store = :mem_cache_store
49
56
 
50
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
57
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
51
58
  # config.action_controller.asset_host = "http://assets.example.com"
52
59
 
53
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
60
+ # Precompile additional assets.
61
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
54
62
  # config.assets.precompile += %w( search.js )
55
63
 
56
- # Disable delivery errors, bad email addresses will be ignored
64
+ # Ignore bad email addresses and do not raise email delivery errors.
65
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
57
66
  # config.action_mailer.raise_delivery_errors = false
58
67
 
59
- # Enable threaded mode
60
- # config.threadsafe!
61
-
62
68
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
63
- # the I18n.default_locale when a translation can not be found)
69
+ # the I18n.default_locale when a translation can not be found).
64
70
  config.i18n.fallbacks = true
65
71
 
66
- # Send deprecation notices to registered listeners
72
+ # Send deprecation notices to registered listeners.
67
73
  config.active_support.deprecation = :notify
68
74
 
69
- # Log the query plan for queries taking more than this (works
70
- # with SQLite, MySQL, and PostgreSQL)
71
- # config.active_record.auto_explain_threshold_in_seconds = 0.5
75
+ # Disable automatic flushing of the log to improve performance.
76
+ # config.autoflush_log = false
77
+
78
+ # Use default logging formatter so that PID and timestamp are not suppressed.
79
+ config.log_formatter = ::Logger::Formatter.new
72
80
  end
@@ -1,5 +1,5 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
5
5
  # test suite. You never need to work with it otherwise. Remember that
@@ -7,35 +7,30 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
13
-
14
- if Rails::VERSION::MAJOR == 4
15
- config.eager_load = true
16
- else
17
- # Log error messages when you accidentally call methods on nil
18
- config.whiny_nils = true
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
19
14
 
20
- # Raise exception on mass assignment protection for Active Record models
21
- config.active_record.mass_assignment_sanitizer = :strict
22
- end
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
23
18
 
24
- # Show full error reports and disable caching
19
+ # Show full error reports and disable caching.
25
20
  config.consider_all_requests_local = true
26
21
  config.action_controller.perform_caching = false
27
22
 
28
- # Raise exceptions instead of rendering exception templates
23
+ # Raise exceptions instead of rendering exception templates.
29
24
  config.action_dispatch.show_exceptions = false
30
25
 
31
- # Disable request forgery protection in test environment
32
- config.action_controller.allow_forgery_protection = false
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
33
28
 
34
29
  # Tell Action Mailer not to deliver emails to the real world.
35
30
  # The :test delivery method accumulates sent emails in the
36
31
  # ActionMailer::Base.deliveries array.
37
32
  config.action_mailer.delivery_method = :test
38
33
 
39
- # Print deprecation notices to the stderr
34
+ # Print deprecation notices to the stderr.
40
35
  config.active_support.deprecation = :stderr
41
36
  end
@@ -17,6 +17,7 @@ Adminpanel.setup do |config|
17
17
  :sections,
18
18
  :categories,
19
19
  :products,
20
- :users
20
+ :users,
21
+ :mugs
21
22
  ]
22
23
  end
File without changes
@@ -10,6 +10,72 @@
10
10
  #
11
11
  # It's strongly recommended to check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(:version => 0) do
14
-
13
+ ActiveRecord::Schema.define do
14
+ create_table :adminpanel_users do |t|
15
+ t.string :name
16
+ t.string :email
17
+ t.string :password_digest
18
+ t.string :remember_token
19
+ t.integer :group_id
20
+ t.datetime :created_at, :null => false
21
+ t.datetime :updated_at, :null => false
22
+ end
23
+ create_table :adminpanel_galleries do |t|
24
+ t.string :file
25
+ t.integer :position
26
+ t.datetime :created_at, :null => false
27
+ t.datetime :updated_at, :null => false
28
+ end
29
+ create_table :adminpanel_images do |t|
30
+ t.string :file
31
+ t.string :section_id
32
+ t.datetime :created_at, :null => false
33
+ t.datetime :updated_at, :null => false
34
+ end
35
+ create_table :adminpanel_products do |t|
36
+ t.string :price
37
+ t.string :name
38
+ t.text :description
39
+ t.datetime :created_at, :null => false
40
+ t.datetime :updated_at, :null => false
41
+ end
42
+ create_table :adminpanel_photos do |t|
43
+ t.string :file
44
+ t.text :product_id
45
+ t.datetime :created_at, :null => false
46
+ t.datetime :updated_at, :null => false
47
+ end
48
+ create_table :adminpanel_categories do |t|
49
+ t.string :name
50
+ t.string :model
51
+ t.datetime :created_at, :null => false
52
+ t.datetime :updated_at, :null => false
53
+ end
54
+ create_table :adminpanel_categorizations do |t|
55
+ t.integer :product_id
56
+ t.integer :category_id
57
+ t.datetime :created_at, :null => false
58
+ t.datetime :updated_at, :null => false
59
+ end
60
+ create_table :adminpanel_groups do |t|
61
+ t.string :name
62
+ t.datetime :created_at, :null => false
63
+ t.datetime :updated_at, :null => false
64
+ end
65
+ create_table :adminpanel_mugs do |t|
66
+ t.string :name
67
+ t.integer :number
68
+ t.datetime :created_at, :null => false
69
+ t.datetime :updated_at, :null => false
70
+ end
71
+ create_table :adminpanel_sections do |t|
72
+ t.string :name
73
+ t.text :description
74
+ t.string :key
75
+ t.boolean :has_image
76
+ t.string :page
77
+ t.datetime :created_at, :null => false
78
+ t.datetime :updated_at, :null => false
79
+ t.boolean :has_description
80
+ end
15
81
  end