adminpanel 1.2.9 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/Gemfile +1 -0
  2. data/adminpanel.gemspec +1 -0
  3. data/app/controllers/adminpanel/analytics_controller.rb +1 -1
  4. data/app/controllers/adminpanel/application_controller.rb +6 -6
  5. data/app/controllers/adminpanel/categories_controller.rb +17 -8
  6. data/app/controllers/adminpanel/galleries_controller.rb +2 -0
  7. data/app/controllers/adminpanel/sections_controller.rb +2 -0
  8. data/app/controllers/adminpanel/sessions_controller.rb +2 -2
  9. data/app/controllers/adminpanel/users_controller.rb +2 -0
  10. data/app/helpers/adminpanel/custom_form_builder.rb +24 -0
  11. data/app/helpers/adminpanel/rest_actions_helper.rb +26 -9
  12. data/app/helpers/adminpanel/shared_pages_helper.rb +2 -1
  13. data/app/models/adminpanel/group.rb +6 -0
  14. data/app/models/adminpanel/user.rb +48 -5
  15. data/app/views/adminpanel/categories/_categories_table.html.erb +3 -2
  16. data/app/views/adminpanel/categories/_category_form.html.erb +4 -4
  17. data/app/views/adminpanel/categories/create.js.erb +2 -1
  18. data/app/views/adminpanel/categories/index.html.erb +1 -1
  19. data/app/views/adminpanel/categories/new.js.erb +2 -1
  20. data/app/views/layouts/_side_menu.html.erb +20 -18
  21. data/app/views/layouts/_top_bar.html.erb +1 -1
  22. data/app/views/shared/_form_fields.html.erb +57 -5
  23. data/app/views/shared/_modal.html.erb +8 -0
  24. data/app/views/shared/_remote_form_fields.html.erb +12 -0
  25. data/app/views/shared/create_belongs_to.js.erb +5 -0
  26. data/app/views/shared/create_has_many.js.erb +5 -0
  27. data/app/views/shared/edit.html.erb +1 -0
  28. data/app/views/shared/new.html.erb +15 -4
  29. data/app/views/shared/new.js.erb +2 -0
  30. data/config/locales/es.yml +5 -3
  31. data/lib/adminpanel.rb +1 -0
  32. data/lib/adminpanel/active_record/adminpanel_extension.rb +0 -4
  33. data/lib/adminpanel/version.rb +1 -1
  34. data/lib/generators/adminpanel/initialize/initialize_generator.rb +11 -0
  35. data/lib/generators/adminpanel/initialize/templates/ability.rb +31 -0
  36. data/lib/generators/adminpanel/initialize/templates/adminpanel_setup.rb +7 -7
  37. data/lib/generators/adminpanel/initialize/templates/create_adminpanel_tables.rb +9 -1
  38. data/lib/tasks/adminpanel/adminpanel.rake +2 -1
  39. data/spec/dummy/app/models/ability.rb +31 -0
  40. data/spec/dummy/app/models/adminpanel/category.rb +4 -1
  41. data/spec/features/authentication_pages_spec.rb +6 -5
  42. data/spec/features/galleries_pages_spec.rb +3 -1
  43. data/spec/features/section_pages_spec.rb +2 -1
  44. data/spec/features/shared_pages_spec.rb +66 -22
  45. data/spec/generators/gallery_generator_spec.rb +3 -3
  46. data/spec/generators/resource_generator_spec.rb +3 -3
  47. data/spec/models/gallery_spec.rb +3 -1
  48. data/spec/models/section_spec.rb +12 -11
  49. data/spec/models/user_spec.rb +6 -2
  50. data/spec/spec_helper.rb +5 -2
  51. data/spec/support/define_factory_models.rb +6 -0
  52. data/spec/support/helper_methods.rb +2 -1
  53. data/spec/support/test_database.rb +7 -0
  54. data/spec/tasks/adminpanel_rake_spec.rb +1 -0
  55. metadata +53 -32
  56. data/spec/dummy/app/controllers/adminpanel/categories_controller.rb +0 -4
  57. data/spec/models/product_spec.rb +0 -39
@@ -1,4 +0,0 @@
1
- module Adminpanel
2
- class CategoriesController < Adminpanel::ApplicationController
3
- end
4
- end
@@ -1,39 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Adminpanel::Product do
4
- # before do
5
- # @product = Adminpanel::Product.new(
6
- # :description => "Test description for product",
7
- # :name => "product name",
8
- # :brief => "short description"
9
- # )
10
- # end
11
-
12
- # subject { @product }
13
-
14
- # it { should respond_to(:name) }
15
- # it { should respond_to(:description) }
16
- # it { should respond_to(:brief) }
17
-
18
- # end
19
-
20
- # describe "when no name present" do
21
- # before {@product.name = " "}
22
- # it {should_not be_valid}
23
- # end
24
-
25
- # describe "when no description present" do
26
- # before {@product.description = " "}
27
- # it {should_not be_valid}
28
- # end
29
-
30
- # it {should_not be_valid}
31
- # end
32
-
33
- # describe "when no brief is present" do
34
- # before {@product.brief = " "}
35
- # it {should_not be_valid}
36
- # end
37
-
38
-
39
- end