manage 1.3.40 → 1.3.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -20
  3. data/Rakefile +31 -31
  4. data/app/assets/javascripts/manage/collection_actions.js.coffee +30 -30
  5. data/app/assets/javascripts/manage/handlers.js.coffee +46 -46
  6. data/app/assets/javascripts/manage/table_checkboxes.js.coffee +11 -11
  7. data/app/controllers/manage/application_controller.rb +13 -13
  8. data/app/controllers/manage/dashboards_controller.rb +4 -4
  9. data/app/controllers/manage/responder.rb +11 -11
  10. data/app/controllers/manage/sessions_controller.rb +11 -11
  11. data/app/helpers/manage/application_helper.rb +42 -42
  12. data/app/helpers/manage/form_helper.rb +21 -21
  13. data/app/helpers/manage/resource_helper.rb +77 -77
  14. data/app/models/admin_user.rb +4 -4
  15. data/app/views/layouts/manage/_main_menu.html.slim +52 -52
  16. data/app/views/layouts/manage/sign_in.html.slim +30 -30
  17. data/app/views/manage/resource/_form.html.slim +4 -4
  18. data/app/views/manage/resource/index/_collection_actions.html.slim +2 -2
  19. data/app/views/manage/resource/index/_count.html.slim +6 -6
  20. data/app/views/manage/resource/show.html.slim +10 -10
  21. data/app/views/manage/sessions/new.html.slim +10 -10
  22. data/config/initializers/devise.rb +247 -247
  23. data/config/initializers/session_store.rb +3 -3
  24. data/config/initializers/simple_form.rb +145 -145
  25. data/config/initializers/simple_form_foundation.rb +26 -26
  26. data/config/locales/devise.en.yml +59 -59
  27. data/config/locales/en.yml +20 -20
  28. data/config/routes.rb +10 -10
  29. data/db/migrate/20131204142720_create_admin_users.rb +24 -24
  30. data/lib/manage/engine.rb +21 -21
  31. data/lib/manage/fields.rb +6 -6
  32. data/lib/manage/version.rb +1 -1
  33. data/lib/manage.rb +5 -5
  34. data/lib/tasks/manage_tasks.rake +15 -15
  35. data/lib/templates/erb/scaffold/_form.html.erb +13 -13
  36. data/spec/controllers/manage/resource_controller_spec.rb +29 -29
  37. data/spec/dummy/README.rdoc +28 -28
  38. data/spec/dummy/Rakefile +6 -6
  39. data/spec/dummy/app/assets/javascripts/application.js +13 -13
  40. data/spec/dummy/app/assets/stylesheets/application.css +13 -13
  41. data/spec/dummy/app/controllers/application_controller.rb +5 -5
  42. data/spec/dummy/app/controllers/manage/posts_controller.rb +4 -4
  43. data/spec/dummy/app/helpers/application_helper.rb +2 -2
  44. data/spec/dummy/app/models/post.rb +3 -3
  45. data/spec/dummy/app/models/user.rb +5 -5
  46. data/spec/dummy/app/views/layouts/application.html.erb +14 -14
  47. data/spec/dummy/bin/bundle +3 -3
  48. data/spec/dummy/bin/rails +4 -4
  49. data/spec/dummy/bin/rake +4 -4
  50. data/spec/dummy/config/application.rb +24 -24
  51. data/spec/dummy/config/boot.rb +5 -5
  52. data/spec/dummy/config/database.yml +25 -25
  53. data/spec/dummy/config/environment.rb +5 -5
  54. data/spec/dummy/config/environments/development.rb +29 -29
  55. data/spec/dummy/config/environments/production.rb +80 -80
  56. data/spec/dummy/config/environments/test.rb +36 -36
  57. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
  58. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -4
  59. data/spec/dummy/config/initializers/inflections.rb +16 -16
  60. data/spec/dummy/config/initializers/mime_types.rb +5 -5
  61. data/spec/dummy/config/initializers/secret_token.rb +12 -12
  62. data/spec/dummy/config/initializers/session_store.rb +3 -3
  63. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
  64. data/spec/dummy/config/locales/en.yml +23 -23
  65. data/spec/dummy/config/routes.rb +10 -10
  66. data/spec/dummy/config.ru +4 -4
  67. data/spec/dummy/db/migrate/20130716083410_init_migration.rb +21 -21
  68. data/spec/dummy/db/schema.rb +53 -53
  69. data/spec/dummy/public/404.html +58 -58
  70. data/spec/dummy/public/422.html +58 -58
  71. data/spec/dummy/public/500.html +57 -57
  72. data/spec/fields/reader_spec.rb +79 -79
  73. data/spec/spec_helper.rb +24 -24
  74. metadata +30 -30
@@ -1,15 +1,15 @@
1
- # desc "Explaining what the task does"
2
- # task :manage do
3
- # # Task goes here
4
- # end
5
-
6
- namespace :manage do
7
- desc "Create the initial admin user for the interface"
8
- task :create_admin => :environment do
9
- user = Manage::AdminUser.create!(
10
- :email => "admin@admin.com",
11
- :password => "11223344",
12
- :password_confirmation => "11223344"
13
- )
14
- end
15
- end
1
+ # desc "Explaining what the task does"
2
+ # task :manage do
3
+ # # Task goes here
4
+ # end
5
+
6
+ namespace :manage do
7
+ desc "Create the initial admin user for the interface"
8
+ task :create_admin => :environment do
9
+ user = Manage::AdminUser.create!(
10
+ :email => "admin@admin.com",
11
+ :password => "11223344",
12
+ :password_confirmation => "11223344"
13
+ )
14
+ end
15
+ end
@@ -1,13 +1,13 @@
1
- <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
2
- <%%= f.error_notification %>
3
-
4
- <div class="form-inputs">
5
- <%- edit_attributes.each do |attribute| -%>
6
- <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
7
- <%- end -%>
8
- </div>
9
-
10
- <div class="form-actions">
11
- <%%= f.button :submit %>
12
- </div>
13
- <%% end %>
1
+ <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
2
+ <%%= f.error_notification %>
3
+
4
+ <div class="form-inputs">
5
+ <%- edit_attributes.each do |attribute| -%>
6
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
7
+ <%- end -%>
8
+ </div>
9
+
10
+ <div class="form-actions">
11
+ <%%= f.button :submit %>
12
+ </div>
13
+ <%% end %>
@@ -1,29 +1,29 @@
1
- require 'spec_helper'
2
-
3
- module Manage
4
-
5
- describe PostsController do
6
- render_views
7
- routes { Manage::Engine.routes }
8
-
9
- before do
10
- @admin = AdminUser.create!(email: 'admin@some.gf', password: '11223344', password_confirmation: '11223344')
11
- sign_in @admin
12
-
13
- @user = User.create!(email: 'some@do.cd', username: 'Sandokan')
14
- @user.posts.create(content: 'Some')
15
- @user.save!
16
- end
17
-
18
- it 'Shows only index fields listed' do
19
- get :index
20
- body = response.body
21
-
22
- body.should include(@user.email)
23
- body.should include(@user.username)
24
- body.should include(@user.posts.first.id.to_s)
25
- body.should include(@user.posts.first.content)
26
- end
27
- end
28
- end
29
-
1
+ require 'spec_helper'
2
+
3
+ module Manage
4
+
5
+ describe PostsController do
6
+ render_views
7
+ routes { Manage::Engine.routes }
8
+
9
+ before do
10
+ @admin = AdminUser.create!(email: 'admin@some.gf', password: '11223344', password_confirmation: '11223344')
11
+ sign_in @admin
12
+
13
+ @user = User.create!(email: 'some@do.cd', username: 'Sandokan')
14
+ @user.posts.create(content: 'Some')
15
+ @user.save!
16
+ end
17
+
18
+ it 'Shows only index fields listed' do
19
+ get :index
20
+ body = response.body
21
+
22
+ body.should include(@user.email)
23
+ body.should include(@user.username)
24
+ body.should include(@user.posts.first.id.to_s)
25
+ body.should include(@user.posts.first.content)
26
+ end
27
+ end
28
+ end
29
+
@@ -1,28 +1,28 @@
1
- == README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
data/spec/dummy/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require File.expand_path('../config/application', __FILE__)
5
-
6
- Dummy::Application.load_tasks
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Dummy::Application.load_tasks
@@ -1,13 +1,13 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
9
- //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -1,13 +1,13 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
10
- *
11
- *= require_self
12
- *= require_tree .
13
- */
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -1,5 +1,5 @@
1
- class ApplicationController < ActionController::Base
2
- # Prevent CSRF attacks by raising an exception.
3
- # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
5
- end
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -1,4 +1,4 @@
1
- class Manage::PostsController < Manage::ResourceController
2
- index_fields :id, 'content', 'user.username', 'user.email'
3
- edit_fields :content
4
- end
1
+ class Manage::PostsController < Manage::ResourceController
2
+ index_fields :id, 'content', 'user.username', 'user.email'
3
+ edit_fields :content
4
+ end
@@ -1,2 +1,2 @@
1
- module ApplicationHelper
2
- end
1
+ module ApplicationHelper
2
+ end
@@ -1,3 +1,3 @@
1
- class Post < ActiveRecord::Base
2
- belongs_to :user
3
- end
1
+ class Post < ActiveRecord::Base
2
+ belongs_to :user
3
+ end
@@ -1,5 +1,5 @@
1
- class User < ActiveRecord::Base
2
-
3
- has_many :posts, dependent: :destroy
4
-
5
- end
1
+ class User < ActiveRecord::Base
2
+
3
+ has_many :posts, dependent: :destroy
4
+
5
+ end
@@ -1,14 +1,14 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
- <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -1,3 +1,3 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
- load Gem.bin_path('bundler', 'bundle')
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
data/spec/dummy/bin/rails CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
data/spec/dummy/bin/rake CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -1,24 +1,24 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- Bundler.require(*Rails.groups)
6
- require "manage"
7
-
8
- module Dummy
9
- class Application < Rails::Application
10
- # Settings in config/environments/* take precedence over those specified here.
11
- # Application configuration should go into files in config/initializers
12
- # -- all .rb files in that directory are automatically loaded.
13
-
14
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
- # config.time_zone = 'Central Time (US & Canada)'
17
-
18
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
- # config.i18n.default_locale = :de
21
- I18n.enforce_available_locales = false
22
- end
23
- end
24
-
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "manage"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+ I18n.enforce_available_locales = false
22
+ end
23
+ end
24
+
@@ -1,5 +1,5 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
- $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,25 +1,25 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: ":memory:"
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: ":memory:"
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -1,5 +1,5 @@
1
- # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the Rails application.
5
- Dummy::Application.initialize!
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Dummy::Application.initialize!
@@ -1,29 +1,29 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Do not eager load code on boot.
10
- config.eager_load = false
11
-
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send.
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger.
20
- config.active_support.deprecation = :log
21
-
22
- # Raise an error on page load if there are pending migrations
23
- config.active_record.migration_error = :page_load
24
-
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.
28
- config.assets.debug = true
29
- end
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
+
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.
28
+ config.assets.debug = true
29
+ end