activeadmin 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE.md +20 -0
- data/.mdlrc +1 -0
- data/.rubocop.yml +52 -3
- data/.simplecov +13 -0
- data/.travis.yml +9 -24
- data/.yardopts +0 -1
- data/CHANGELOG.md +85 -4
- data/CONTRIBUTING.md +33 -57
- data/Gemfile +26 -17
- data/Rakefile +1 -12
- data/activeadmin.gemspec +9 -11
- data/app/assets/javascripts/active_admin/base.js.coffee +6 -2
- data/app/assets/javascripts/active_admin/initializers/batch_actions.js.coffee +5 -1
- data/app/assets/javascripts/active_admin/initializers/datepicker.js.coffee +5 -1
- data/app/assets/javascripts/active_admin/initializers/filters.js.coffee +5 -1
- data/app/assets/javascripts/active_admin/initializers/tabs.js.coffee +5 -1
- data/app/assets/javascripts/active_admin/lib/batch_actions.js.coffee +6 -3
- data/app/assets/javascripts/active_admin/lib/checkbox-toggler.js.coffee +9 -7
- data/app/assets/javascripts/active_admin/lib/dropdown-menu.js.coffee +5 -2
- data/app/assets/javascripts/active_admin/lib/per_page.js.coffee +6 -2
- data/app/assets/javascripts/active_admin/lib/table-checkbox-toggler.js.coffee +3 -5
- data/app/assets/stylesheets/active_admin/_base.scss +2 -2
- data/app/assets/stylesheets/active_admin/_forms.scss +6 -12
- data/app/assets/stylesheets/active_admin/components/_batch_actions.scss +0 -5
- data/app/assets/stylesheets/active_admin/components/_pagination.scss +11 -0
- data/app/assets/stylesheets/active_admin/components/_status_tags.scss +1 -0
- data/app/assets/stylesheets/active_admin/components/_tables.scss +4 -1
- data/app/assets/stylesheets/active_admin/mixins/_all.scss +0 -2
- data/app/assets/stylesheets/active_admin/print.scss +2 -3
- data/app/views/active_admin/devise/sessions/new.html.erb +1 -1
- data/app/views/active_admin/devise/shared/_links.erb +12 -6
- data/app/views/kaminari/active_admin/_first_page.html.erb +11 -0
- data/app/views/kaminari/active_admin/_gap.html.erb +8 -0
- data/app/views/kaminari/active_admin/_last_page.html.erb +11 -0
- data/app/views/kaminari/active_admin/_next_page.html.erb +11 -0
- data/app/views/kaminari/active_admin/_page.html.erb +12 -0
- data/app/views/kaminari/active_admin/_paginator.html.erb +25 -0
- data/app/views/kaminari/active_admin/_prev_page.html.erb +11 -0
- data/codecov.yml +14 -12
- data/config/i18n-tasks.yml +26 -0
- data/config/locales/ar.yml +1 -3
- data/config/locales/bg.yml +0 -2
- data/config/locales/bs.yml +0 -2
- data/config/locales/ca.yml +0 -2
- data/config/locales/cs.yml +0 -2
- data/config/locales/da.yml +1 -3
- data/config/locales/de-CH.yml +1 -3
- data/config/locales/de.yml +1 -3
- data/config/locales/el.yml +1 -3
- data/config/locales/en-CA.yml +138 -0
- data/config/locales/en-GB.yml +43 -3
- data/config/locales/en.yml +8 -4
- data/config/locales/es-MX.yml +3 -2
- data/config/locales/es.yml +10 -4
- data/config/locales/fa.yml +0 -2
- data/config/locales/fi.yml +0 -2
- data/config/locales/fr.yml +9 -2
- data/config/locales/he.yml +53 -7
- data/config/locales/hr.yml +0 -2
- data/config/locales/hu.yml +0 -2
- data/config/locales/id.yml +1 -3
- data/config/locales/it.yml +2 -4
- data/config/locales/ja.yml +1 -3
- data/config/locales/ko.yml +0 -2
- data/config/locales/lt.yml +24 -4
- data/config/locales/lv.yml +0 -2
- data/config/locales/nb.yml +0 -2
- data/config/locales/nl.yml +1 -3
- data/config/locales/pl.yml +3 -2
- data/config/locales/pt-BR.yml +1 -3
- data/config/locales/pt-PT.yml +0 -2
- data/config/locales/ro.yml +0 -2
- data/config/locales/ru.yml +1 -3
- data/config/locales/sk.yml +0 -2
- data/config/locales/sv-SE.yml +1 -3
- data/config/locales/tr.yml +0 -2
- data/config/locales/uk.yml +1 -3
- data/config/locales/vi.yml +0 -2
- data/config/locales/zh-CN.yml +0 -2
- data/config/locales/zh-TW.yml +1 -3
- data/config/mdl_style.rb +9 -0
- data/cucumber.yml +3 -3
- data/docs/0-installation.md +15 -12
- data/docs/1-general-configuration.md +10 -3
- data/docs/10-custom-pages.md +10 -5
- data/docs/11-decorators.md +1 -0
- data/docs/12-arbre-components.md +7 -9
- data/docs/13-authorization-adapter.md +39 -24
- data/docs/14-gotchas.md +41 -22
- data/docs/2-resource-customization.md +41 -18
- data/docs/3-index-pages.md +30 -12
- data/docs/3-index-pages/custom-index.md +1 -0
- data/docs/3-index-pages/index-as-block.md +0 -5
- data/docs/3-index-pages/index-as-blog.md +0 -5
- data/docs/3-index-pages/index-as-grid.md +0 -5
- data/docs/3-index-pages/index-as-table.md +1 -9
- data/docs/4-csv-format.md +2 -1
- data/docs/5-forms.md +45 -21
- data/docs/6-show-pages.md +2 -1
- data/docs/7-sidebars.md +2 -1
- data/docs/8-custom-actions.md +4 -1
- data/docs/9-batch-actions.md +4 -2
- data/docs/documentation.md +19 -21
- data/features/comments/commenting.feature +20 -0
- data/features/index/filters.feature +41 -1
- data/features/index/format_as_csv.feature +17 -0
- data/features/index/index_scopes.feature +15 -0
- data/features/registering_assets.feature +8 -4
- data/features/show/attributes_table_title.feature +54 -0
- data/features/show/tabs.feature +10 -4
- data/features/step_definitions/action_link_steps.rb +0 -1
- data/features/step_definitions/attributes_table_title_steps.rb +11 -0
- data/features/step_definitions/batch_action_steps.rb +2 -2
- data/features/step_definitions/comment_steps.rb +21 -1
- data/features/step_definitions/configuration_steps.rb +1 -1
- data/features/step_definitions/filter_steps.rb +9 -0
- data/features/step_definitions/format_steps.rb +1 -1
- data/features/step_definitions/index_scope_steps.rb +4 -0
- data/features/support/env.rb +5 -4
- data/features/support/regular_env.rb +7 -0
- data/features/support/reload_env.rb +7 -0
- data/gemfiles/rails_42.gemfile +2 -37
- data/gemfiles/rails_50.gemfile +5 -40
- data/gemfiles/rails_51.gemfile +5 -40
- data/lib/active_admin.rb +0 -3
- data/lib/active_admin/application.rb +6 -4
- data/lib/active_admin/asset_registration.rb +8 -0
- data/lib/active_admin/authorization_adapter.rb +0 -3
- data/lib/active_admin/base_controller.rb +1 -2
- data/lib/active_admin/base_controller/authorization.rb +0 -1
- data/lib/active_admin/base_controller/menu.rb +9 -9
- data/lib/active_admin/batch_actions/controller.rb +1 -1
- data/lib/active_admin/batch_actions/views/selection_cells.rb +6 -5
- data/lib/active_admin/csv_builder.rb +3 -3
- data/lib/active_admin/dependency.rb +1 -1
- data/lib/active_admin/devise.rb +2 -2
- data/lib/active_admin/dsl.rb +2 -2
- data/lib/active_admin/filters.rb +2 -0
- data/lib/active_admin/filters/active.rb +13 -14
- data/lib/active_admin/filters/active_filter.rb +87 -0
- data/lib/active_admin/filters/active_sidebar.rb +50 -0
- data/lib/active_admin/filters/forms.rb +1 -2
- data/lib/active_admin/filters/resource_extension.rb +2 -30
- data/lib/active_admin/helpers/settings.rb +0 -1
- data/lib/active_admin/inputs/datepicker_input.rb +5 -5
- data/lib/active_admin/inputs/filters/date_range_input.rb +12 -4
- data/lib/active_admin/inputs/filters/text_input.rb +0 -1
- data/lib/active_admin/menu.rb +4 -4
- data/lib/active_admin/menu_collection.rb +0 -2
- data/lib/active_admin/namespace.rb +1 -1
- data/lib/active_admin/orm/active_record/comments/comment.rb +1 -5
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +4 -2
- data/lib/active_admin/page_controller.rb +1 -1
- data/lib/active_admin/resource/action_items.rb +4 -0
- data/lib/active_admin/resource/attributes.rb +1 -1
- data/lib/active_admin/resource/page_presenters.rb +1 -1
- data/lib/active_admin/resource/routes.rb +0 -1
- data/lib/active_admin/resource/scopes.rb +2 -1
- data/lib/active_admin/resource_controller.rb +1 -1
- data/lib/active_admin/resource_controller/data_access.rb +8 -9
- data/lib/active_admin/resource_dsl.rb +10 -10
- data/lib/active_admin/router.rb +1 -1
- data/lib/active_admin/scope.rb +3 -3
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_helpers.rb +1 -0
- data/lib/active_admin/view_helpers/display_helper.rb +1 -1
- data/lib/active_admin/view_helpers/form_helper.rb +1 -1
- data/lib/active_admin/view_helpers/scope_name_helper.rb +16 -0
- data/lib/active_admin/views/action_items.rb +1 -1
- data/lib/active_admin/views/components/active_admin_form.rb +1 -1
- data/lib/active_admin/views/components/dropdown_menu.rb +2 -2
- data/lib/active_admin/views/components/index_list.rb +0 -2
- data/lib/active_admin/views/components/paginated_collection.rb +1 -1
- data/lib/active_admin/views/components/scopes.rb +2 -10
- data/lib/active_admin/views/components/status_tag.rb +19 -11
- data/lib/active_admin/views/components/tabs.rb +2 -2
- data/lib/active_admin/views/header.rb +0 -1
- data/lib/active_admin/views/index_as_blog.rb +1 -2
- data/lib/active_admin/views/index_as_grid.rb +2 -2
- data/lib/active_admin/views/index_as_table.rb +19 -1
- data/lib/active_admin/views/pages/base.rb +4 -4
- data/lib/active_admin/views/pages/show.rb +6 -1
- data/lib/active_admin/views/title_bar.rb +4 -4
- data/lib/bug_report_templates/{rails_5_master.rb → active_admin_master.rb} +35 -40
- data/lib/generators/active_admin/devise/devise_generator.rb +1 -1
- data/lib/generators/active_admin/install/templates/admin_user.rb.erb +1 -1
- data/spec/bug_report_templates_spec.rb +2 -3
- data/spec/rails_helper.rb +0 -3
- data/spec/spec_helper.rb +1 -12
- data/spec/support/active_admin_integration_spec_helper.rb +1 -1
- data/spec/support/rails_template.rb +5 -37
- data/spec/support/rails_template_with_data.rb +262 -3
- data/spec/support/templates/policies/active_admin/comment_policy.rb +1 -1
- data/spec/support/templates/policies/active_admin/page_policy.rb +1 -1
- data/spec/support/templates/policies/application_policy.rb +1 -2
- data/spec/support/templates/post_decorator.rb +0 -1
- data/spec/unit/abstract_view_factory_spec.rb +0 -1
- data/spec/unit/application_spec.rb +4 -0
- data/spec/unit/asset_registration_spec.rb +29 -0
- data/spec/unit/belongs_to_spec.rb +1 -2
- data/spec/unit/config_shared_examples.rb +1 -1
- data/spec/unit/csv_builder_spec.rb +2 -4
- data/spec/unit/dependency_spec.rb +7 -7
- data/spec/unit/dsl_spec.rb +0 -2
- data/spec/unit/filters/active_filter_spec.rb +135 -0
- data/spec/unit/filters/active_spec.rb +11 -1
- data/spec/unit/filters/filter_form_builder_spec.rb +9 -7
- data/spec/unit/form_builder_spec.rb +14 -14
- data/spec/unit/helpers/scope_chain_spec.rb +0 -1
- data/spec/unit/i18n_spec.rb +17 -0
- data/spec/unit/menu_item_spec.rb +1 -3
- data/spec/unit/namespace/register_page_spec.rb +1 -1
- data/spec/unit/namespace_spec.rb +0 -1
- data/spec/unit/page_spec.rb +0 -3
- data/spec/unit/resource/action_items_spec.rb +5 -1
- data/spec/unit/resource/attributes_spec.rb +1 -2
- data/spec/unit/resource/ordering_spec.rb +0 -3
- data/spec/unit/resource/scopes_spec.rb +1 -1
- data/spec/unit/resource_controller/data_access_spec.rb +2 -2
- data/spec/unit/resource_controller_spec.rb +1 -2
- data/spec/unit/resource_spec.rb +9 -2
- data/spec/unit/routing_spec.rb +0 -2
- data/spec/unit/scope_spec.rb +3 -3
- data/spec/unit/settings_spec.rb +0 -1
- data/spec/unit/view_factory_spec.rb +1 -1
- data/spec/unit/view_helpers/flash_helper_spec.rb +0 -1
- data/spec/unit/view_helpers/form_helper_spec.rb +3 -4
- data/spec/unit/view_helpers/method_or_proc_helper_spec.rb +0 -1
- data/spec/unit/views/components/attributes_table_spec.rb +0 -1
- data/spec/unit/views/components/columns_spec.rb +0 -2
- data/spec/unit/views/components/site_title_spec.rb +0 -2
- data/spec/unit/views/components/status_tag_spec.rb +23 -7
- data/spec/unit/views/components/tabs_spec.rb +29 -1
- data/spec/unit/views/pages/index_spec.rb +1 -1
- data/tasks/docs.rake +37 -10
- data/tasks/lint.rake +14 -1
- data/tasks/local.rake +2 -2
- data/tasks/test.rake +8 -25
- data/vendor/assets/javascripts/jquery-ui/data.js +41 -0
- data/vendor/assets/javascripts/jquery-ui/disable-selection.js +48 -0
- data/vendor/assets/javascripts/jquery-ui/escape-selector.js +23 -0
- data/vendor/assets/javascripts/jquery-ui/focusable.js +86 -0
- data/vendor/assets/javascripts/jquery-ui/ie.js +17 -0
- data/vendor/assets/javascripts/jquery-ui/keycode.js +47 -0
- data/vendor/assets/javascripts/jquery-ui/plugin.js +46 -0
- data/vendor/assets/javascripts/jquery-ui/position.js +500 -0
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +42 -0
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +23 -0
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +47 -0
- data/vendor/assets/javascripts/jquery-ui/tabbable.js +38 -0
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +51 -0
- data/vendor/assets/javascripts/jquery-ui/version.js +17 -0
- data/vendor/assets/javascripts/jquery-ui/widget.js +735 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/button.js +391 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +300 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +300 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +2123 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +954 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +1259 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +230 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +1207 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +1561 -0
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +931 -0
- data/vendor/assets/stylesheets/active_admin/_normalize.scss +447 -0
- metadata +62 -51
- data/.hound.yml +0 -14
- data/Appraisals +0 -41
- data/app/assets/images/active_admin/datepicker/datepicker-input-icon.png +0 -0
- data/app/assets/javascripts/active_admin/jquery_ui.js.erb +0 -18
- data/app/assets/stylesheets/active_admin/mixins/_reset.scss +0 -165
- data/lib/active_admin/filters/humanized.rb +0 -68
- data/spec/requests/javascript_spec.rb +0 -22
- data/spec/support/jslint.yml +0 -80
- data/spec/unit/filters/humanized_spec.rb +0 -64
- data/tasks/yard.rake +0 -9
@@ -0,0 +1,11 @@
|
|
1
|
+
Then /^I should see the panel title "([^"]*)"$/ do |title|
|
2
|
+
expect(page).to have_css '.panel > h3', text: title
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /^I should not see the panel title "([^"]*)"$/ do |title|
|
6
|
+
expect(page).to_not have_css '.panel > h3', text: title
|
7
|
+
end
|
8
|
+
|
9
|
+
Then /^I should see the attributes table$/ do
|
10
|
+
expect(page).to have_css '.panel .attributes_table'
|
11
|
+
end
|
@@ -44,9 +44,9 @@ Then /^I should see the batch action popover exists$/ do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
Given /^I submit the batch action form with "([^"]*)"$/ do |action|
|
47
|
-
page.find("#batch_action").set action
|
47
|
+
page.find("#batch_action", visible: false).set action
|
48
48
|
form = page.find "#collection_selection"
|
49
|
-
params = page.all("#main_content input").each_with_object({}) do |input, obj|
|
49
|
+
params = page.all("#main_content input", visible: false).each_with_object({}) do |input, obj|
|
50
50
|
key, value = input['name'], input['value']
|
51
51
|
if key == 'collection_selection[]'
|
52
52
|
(obj[key] ||= []).push value if input.checked?
|
@@ -4,9 +4,29 @@ end
|
|
4
4
|
|
5
5
|
When /^I add a comment "([^"]*)"$/ do |comment|
|
6
6
|
step %{I fill in "active_admin_comment_body" with "#{comment}"}
|
7
|
-
step
|
7
|
+
step %{I press "Add Comment"}
|
8
8
|
end
|
9
9
|
|
10
10
|
Given /^a tag with the name "([^"]*)" exists$/ do |tag_name|
|
11
11
|
Tag.create(name: tag_name)
|
12
12
|
end
|
13
|
+
|
14
|
+
Given /^(a|\d+) comments added by admin with an email "([^"]+)"?$/ do |number, email|
|
15
|
+
number = number == 'a' ? 1 : number.to_i
|
16
|
+
admin_user = ensure_user_created(email)
|
17
|
+
|
18
|
+
comment_text = 'Comment %i'
|
19
|
+
|
20
|
+
number.times do |i|
|
21
|
+
ActiveAdmin::Comment.create!(namespace: 'admin',
|
22
|
+
body: comment_text % i,
|
23
|
+
resource_type: Post.to_s,
|
24
|
+
resource_id: Post.first.id,
|
25
|
+
author_type: admin_user.class.to_s,
|
26
|
+
author_id: admin_user.id)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
Then /^I should see (\d+) comments?$/ do |number|
|
31
|
+
expect(page).to have_selector('div.active_admin_comment', count: number.to_i)
|
32
|
+
end
|
@@ -2,7 +2,7 @@ module ActiveAdminReloading
|
|
2
2
|
def load_aa_config(config_content)
|
3
3
|
ActiveSupport::Notifications.publish ActiveAdmin::Application::BeforeLoadEvent, ActiveAdmin.application
|
4
4
|
eval(config_content)
|
5
|
-
ActiveSupport::Notifications.publish ActiveAdmin::Application::AfterLoadEvent,
|
5
|
+
ActiveSupport::Notifications.publish ActiveAdmin::Application::AfterLoadEvent, ActiveAdmin.application
|
6
6
|
Rails.application.reload_routes!
|
7
7
|
ActiveAdmin.application.namespaces.each &:reset_menu!
|
8
8
|
end
|
@@ -37,3 +37,12 @@ Then(/^I should( not)? have parameter "([^"]*)"( with value "([^"]*)")?$/) do |n
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
|
+
|
41
|
+
Then /^I should see current filter "([^"]*)" equal to "([^"]*)"( with label "([^"]*)")?$/ do |name, value, label_block, label|
|
42
|
+
expect(page).to have_css "li.current_filter_#{name} span", text: label if label_block
|
43
|
+
expect(page).to have_css "li.current_filter_#{name} b", text: value
|
44
|
+
end
|
45
|
+
|
46
|
+
Then /^I should see link "([^"]*)" in current filters/ do |label|
|
47
|
+
expect(page).to have_css "li.current_filter b a", text: label
|
48
|
+
end
|
@@ -18,6 +18,10 @@ Then /^I should see the scope with label "([^"]*)"$/ do |label|
|
|
18
18
|
expect(page).to have_link(label)
|
19
19
|
end
|
20
20
|
|
21
|
+
Then /^I should see the current scope with label "([^"]*)"$/ do |label|
|
22
|
+
expect(page).to have_css '.current_scope_name', text: label
|
23
|
+
end
|
24
|
+
|
21
25
|
Then /^I should see the scope "([^"]*)" with no count$/ do |name|
|
22
26
|
name = name.tr(" ", "").underscore.downcase
|
23
27
|
expect(page).to have_css ".scopes .#{name}"
|
data/features/support/env.rb
CHANGED
@@ -6,7 +6,11 @@
|
|
6
6
|
|
7
7
|
ENV['RAILS_ENV'] = 'test'
|
8
8
|
|
9
|
-
require
|
9
|
+
require 'simplecov' if ENV["COVERAGE"] == "true"
|
10
|
+
|
11
|
+
Dir["#{File.expand_path('../../step_definitions', __FILE__)}/*.rb"].each do |f|
|
12
|
+
require f
|
13
|
+
end
|
10
14
|
|
11
15
|
require 'rails'
|
12
16
|
ENV['RAILS_ROOT'] = File.expand_path("../../../spec/rails/rails-#{Rails.version}", __FILE__)
|
@@ -57,9 +61,6 @@ Capybara.javascript_driver = :poltergeist
|
|
57
61
|
# steps to use the XPath syntax.
|
58
62
|
Capybara.default_selector = :css
|
59
63
|
|
60
|
-
# Make input type=hidden visible
|
61
|
-
Capybara.ignore_hidden_elements = false
|
62
|
-
|
63
64
|
# If you set this to false, any error raised from within your app will bubble
|
64
65
|
# up to your step definition and out to cucumber unless you catch it somewhere
|
65
66
|
# on the way. You can make Rails rescue errors and render error pages on a
|
data/gemfiles/rails_42.gemfile
CHANGED
@@ -1,45 +1,10 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
1
|
source "https://rubygems.org"
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
gem "rake"
|
8
|
-
gem "parallel_tests"
|
9
|
-
gem "pry"
|
10
|
-
gem "rubocop", "0.48.1"
|
3
|
+
eval_gemfile(File.expand_path(File.join("..", "Gemfile"), __dir__))
|
4
|
+
|
11
5
|
gem "rails", "4.2.8"
|
12
|
-
gem "jquery-ui-rails", "~> 5.0"
|
13
6
|
gem "devise", "~> 3.5"
|
14
7
|
gem "draper", "~> 2.1"
|
15
8
|
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
|
16
9
|
|
17
|
-
group :development do
|
18
|
-
gem "better_errors"
|
19
|
-
gem "binding_of_caller", platforms: :mri
|
20
|
-
gem "rack-mini-profiler"
|
21
|
-
gem "yard"
|
22
|
-
gem "redcarpet", platforms: :mri
|
23
|
-
gem "kramdown", platforms: :jruby
|
24
|
-
gem "appraisal", "~> 2.2", require: false
|
25
|
-
end
|
26
|
-
|
27
|
-
group :test do
|
28
|
-
gem "capybara"
|
29
|
-
gem "simplecov", require: false
|
30
|
-
gem "codecov", require: false
|
31
|
-
gem "cucumber-rails", require: false
|
32
|
-
gem "cucumber", "1.3.20"
|
33
|
-
gem "database_cleaner", git: "https://github.com/DatabaseCleaner/database_cleaner.git"
|
34
|
-
gem "jasmine"
|
35
|
-
gem "jslint_on_rails"
|
36
|
-
gem "launchy"
|
37
|
-
gem "rails-i18n"
|
38
|
-
gem "rspec-rails"
|
39
|
-
gem "i18n-spec"
|
40
|
-
gem "shoulda-matchers", "<= 2.8.0"
|
41
|
-
gem "sqlite3", platforms: :mri
|
42
|
-
gem "poltergeist"
|
43
|
-
end
|
44
|
-
|
45
10
|
gemspec path: "../"
|
data/gemfiles/rails_50.gemfile
CHANGED
@@ -1,45 +1,10 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
1
|
source "https://rubygems.org"
|
4
2
|
|
5
|
-
|
6
|
-
gem "pundit"
|
7
|
-
gem "rake"
|
8
|
-
gem "parallel_tests"
|
9
|
-
gem "pry"
|
10
|
-
gem "rubocop", "0.48.1"
|
11
|
-
gem "rails", "5.0.2"
|
12
|
-
gem "jquery-ui-rails", "~> 5.0"
|
13
|
-
gem "devise", "> 4.x"
|
14
|
-
gem "draper", "> 3.x"
|
15
|
-
gem "activerecord-jdbcsqlite3-adapter", git: "https://github.com/jruby/activerecord-jdbc-adapter", branch: "rails-5", platforms: :jruby
|
16
|
-
|
17
|
-
group :development do
|
18
|
-
gem "better_errors"
|
19
|
-
gem "binding_of_caller", platforms: :mri
|
20
|
-
gem "rack-mini-profiler"
|
21
|
-
gem "yard"
|
22
|
-
gem "redcarpet", platforms: :mri
|
23
|
-
gem "kramdown", platforms: :jruby
|
24
|
-
gem "appraisal", "~> 2.2", require: false
|
25
|
-
end
|
3
|
+
eval_gemfile(File.expand_path(File.join("..", "Gemfile"), __dir__))
|
26
4
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
gem "cucumber-rails", require: false
|
32
|
-
gem "cucumber", "1.3.20"
|
33
|
-
gem "database_cleaner", git: "https://github.com/DatabaseCleaner/database_cleaner.git"
|
34
|
-
gem "jasmine"
|
35
|
-
gem "jslint_on_rails"
|
36
|
-
gem "launchy"
|
37
|
-
gem "rails-i18n"
|
38
|
-
gem "rspec-rails"
|
39
|
-
gem "i18n-spec"
|
40
|
-
gem "shoulda-matchers", "<= 2.8.0"
|
41
|
-
gem "sqlite3", platforms: :mri
|
42
|
-
gem "poltergeist"
|
43
|
-
end
|
5
|
+
gem "rails", "5.0.3"
|
6
|
+
gem "devise", "~> 4.0"
|
7
|
+
gem "draper", "~> 3.0"
|
8
|
+
gem "activerecord-jdbcsqlite3-adapter", github: "jruby/activerecord-jdbc-adapter", branch: "rails-5", platforms: :jruby
|
44
9
|
|
45
10
|
gemspec path: "../"
|
data/gemfiles/rails_51.gemfile
CHANGED
@@ -1,45 +1,10 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
1
|
source "https://rubygems.org"
|
4
2
|
|
5
|
-
|
6
|
-
gem "pundit"
|
7
|
-
gem "rake"
|
8
|
-
gem "parallel_tests"
|
9
|
-
gem "pry"
|
10
|
-
gem "rubocop", "0.48.1"
|
11
|
-
gem "rails", "~> 5.1.x"
|
12
|
-
gem "jquery-ui-rails", "~> 5.0"
|
13
|
-
gem "devise", "> 4.x"
|
14
|
-
gem "draper", "> 3.x"
|
15
|
-
gem "activerecord-jdbcsqlite3-adapter", git: "https://github.com/jruby/activerecord-jdbc-adapter", branch: "rails-5", platforms: :jruby
|
16
|
-
|
17
|
-
group :development do
|
18
|
-
gem "better_errors"
|
19
|
-
gem "binding_of_caller", platforms: :mri
|
20
|
-
gem "rack-mini-profiler"
|
21
|
-
gem "yard"
|
22
|
-
gem "redcarpet", platforms: :mri
|
23
|
-
gem "kramdown", platforms: :jruby
|
24
|
-
gem "appraisal", "~> 2.2", require: false
|
25
|
-
end
|
3
|
+
eval_gemfile(File.expand_path(File.join("..", "Gemfile"), __dir__))
|
26
4
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
gem "cucumber-rails", require: false
|
32
|
-
gem "cucumber", "1.3.20"
|
33
|
-
gem "database_cleaner", git: "https://github.com/DatabaseCleaner/database_cleaner.git"
|
34
|
-
gem "jasmine"
|
35
|
-
gem "jslint_on_rails"
|
36
|
-
gem "launchy"
|
37
|
-
gem "rails-i18n"
|
38
|
-
gem "rspec-rails"
|
39
|
-
gem "i18n-spec"
|
40
|
-
gem "shoulda-matchers", "<= 2.8.0"
|
41
|
-
gem "sqlite3", platforms: :mri
|
42
|
-
gem "poltergeist"
|
43
|
-
end
|
5
|
+
gem "rails", "5.1.1"
|
6
|
+
gem "devise", "~> 4.3"
|
7
|
+
gem "draper", "~> 3.0"
|
8
|
+
gem "activerecord-jdbcsqlite3-adapter", github: "jruby/activerecord-jdbc-adapter", branch: "rails-5", platforms: :jruby
|
44
9
|
|
45
10
|
gemspec path: "../"
|
data/lib/active_admin.rb
CHANGED
@@ -3,14 +3,11 @@ require 'set'
|
|
3
3
|
|
4
4
|
require 'ransack'
|
5
5
|
require 'ransack_ext'
|
6
|
-
require 'bourbon'
|
7
6
|
require 'kaminari'
|
8
7
|
require 'formtastic'
|
9
8
|
require 'formtastic_i18n'
|
10
|
-
require 'sass-rails'
|
11
9
|
require 'inherited_resources'
|
12
10
|
require 'jquery-rails'
|
13
|
-
require 'jquery-ui-rails'
|
14
11
|
require 'coffee-rails'
|
15
12
|
require 'arbre'
|
16
13
|
|
@@ -114,6 +114,9 @@ module ActiveAdmin
|
|
114
114
|
# class to handle ordering
|
115
115
|
inheritable_setting :order_clause, ActiveAdmin::OrderClause
|
116
116
|
|
117
|
+
# default show_count for scopes
|
118
|
+
inheritable_setting :scopes_show_count, true
|
119
|
+
|
117
120
|
# Request parameters that are permitted by default
|
118
121
|
inheritable_setting :permitted_params, [
|
119
122
|
:utf8, :_method, :authenticity_token, :commit, :id
|
@@ -268,10 +271,9 @@ module ActiveAdmin
|
|
268
271
|
private
|
269
272
|
|
270
273
|
def register_default_assets
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
register_javascript 'active_admin.js'
|
274
|
+
stylesheets['active_admin.css'] = { media: 'screen' }
|
275
|
+
stylesheets['active_admin/print.css'] = { media: 'print' }
|
276
|
+
javascripts.add 'active_admin.js'
|
275
277
|
end
|
276
278
|
|
277
279
|
# Since app/admin is alphabetically before app/models, we have to remove it
|
@@ -2,6 +2,10 @@ module ActiveAdmin
|
|
2
2
|
module AssetRegistration
|
3
3
|
|
4
4
|
def register_stylesheet(path, options = {})
|
5
|
+
Deprecation.warn <<-MSG.strip_heredoc
|
6
|
+
The `register_stylesheet` config is deprecated and will be removed
|
7
|
+
in v2. Import your "#{path}" stylesheet in the active_admin.scss.
|
8
|
+
MSG
|
5
9
|
stylesheets[path] = options
|
6
10
|
end
|
7
11
|
|
@@ -14,6 +18,10 @@ module ActiveAdmin
|
|
14
18
|
end
|
15
19
|
|
16
20
|
def register_javascript(name)
|
21
|
+
Deprecation.warn <<-MSG.strip_heredoc
|
22
|
+
The `register_javascript` config is deprecated and will be removed
|
23
|
+
in v2. Import your "#{name}" javascript in the active_admin.js.
|
24
|
+
MSG
|
17
25
|
javascripts.add name
|
18
26
|
end
|
19
27
|
|
@@ -10,7 +10,6 @@ module ActiveAdmin
|
|
10
10
|
|
11
11
|
Auth = Authorization
|
12
12
|
|
13
|
-
|
14
13
|
# Active Admin's default authorization adapter. This adapter returns true
|
15
14
|
# for all requests to `#authorized?`. It should be the starting point for
|
16
15
|
# implementing your own authorization adapter.
|
@@ -19,7 +18,6 @@ module ActiveAdmin
|
|
19
18
|
class AuthorizationAdapter
|
20
19
|
attr_reader :resource, :user
|
21
20
|
|
22
|
-
|
23
21
|
# Initialize a new authorization adapter. This happens on each and
|
24
22
|
# every request to a controller.
|
25
23
|
#
|
@@ -54,7 +52,6 @@ module ActiveAdmin
|
|
54
52
|
true
|
55
53
|
end
|
56
54
|
|
57
|
-
|
58
55
|
# A hook method for authorization libraries to scope the collection. By
|
59
56
|
# default, we just return the same collection. The returned scope is used
|
60
57
|
# as the starting point for all queries to the db in the controller.
|
@@ -29,8 +29,8 @@ module ActiveAdmin
|
|
29
29
|
raise AbstractController::ActionNotFound unless action_methods.include?(params[:action])
|
30
30
|
end
|
31
31
|
|
32
|
-
include Menu
|
33
32
|
include Authorization
|
33
|
+
include Menu
|
34
34
|
|
35
35
|
private
|
36
36
|
|
@@ -59,7 +59,6 @@ module ActiveAdmin
|
|
59
59
|
end
|
60
60
|
helper_method :active_admin_namespace
|
61
61
|
|
62
|
-
|
63
62
|
ACTIVE_ADMIN_ACTIONS = [:index, :show, :new, :create, :edit, :update, :destroy]
|
64
63
|
|
65
64
|
# Determine which layout to use.
|
@@ -38,7 +38,6 @@ module ActiveAdmin
|
|
38
38
|
active_admin_authorization.authorized?(action, subject)
|
39
39
|
end
|
40
40
|
|
41
|
-
|
42
41
|
# Authorize the action and subject. Available in the controller
|
43
42
|
# as well as all the views. If the action is not allowd, it raises
|
44
43
|
# an ActiveAdmin::AccessDenied exception.
|
@@ -18,15 +18,15 @@ module ActiveAdmin
|
|
18
18
|
# Get's called through a before filter
|
19
19
|
def set_current_tab
|
20
20
|
@current_tab = if current_menu && active_admin_config.belongs_to? && parent?
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
21
|
+
parent_item = active_admin_config.belongs_to_config.target.menu_item
|
22
|
+
if current_menu.include? parent_item
|
23
|
+
parent_item
|
24
|
+
else
|
25
|
+
active_admin_config.menu_item
|
26
|
+
end
|
27
|
+
else
|
28
|
+
active_admin_config.menu_item
|
29
|
+
end
|
30
30
|
end
|
31
31
|
|
32
32
|
end
|
@@ -5,7 +5,7 @@ module ActiveAdmin
|
|
5
5
|
# Controller action that is called when submitting the batch action form
|
6
6
|
def batch_action
|
7
7
|
if action_present?
|
8
|
-
selection = params[:collection_selection] ||
|
8
|
+
selection = params[:collection_selection] || []
|
9
9
|
inputs = JSON.parse params[:batch_action_inputs] || '{}'
|
10
10
|
valid_keys = render_in_context(self, current_batch_action.inputs).try(:keys)
|
11
11
|
inputs = inputs.with_indifferent_access.slice *valid_keys
|
@@ -7,8 +7,11 @@ module ActiveAdmin
|
|
7
7
|
class ResourceSelectionToggleCell < ActiveAdmin::Component
|
8
8
|
builder_method :resource_selection_toggle_cell
|
9
9
|
|
10
|
-
def build
|
11
|
-
|
10
|
+
def build(label_text = '')
|
11
|
+
label do
|
12
|
+
input type: "checkbox", id: "collection_selection_toggle_all", name: "collection_selection_toggle_all", class: "toggle_all"
|
13
|
+
text_node label_text if label_text.present?
|
14
|
+
end
|
12
15
|
end
|
13
16
|
end
|
14
17
|
|
@@ -27,10 +30,8 @@ module ActiveAdmin
|
|
27
30
|
|
28
31
|
def build
|
29
32
|
super(id: "collection_selection_toggle_panel")
|
30
|
-
resource_selection_toggle_cell
|
31
|
-
div(id: "collection_selection_toggle_explaination" ) { I18n.t('active_admin.batch_actions.selection_toggle_explanation', default: "(Toggle Selection)") }
|
33
|
+
resource_selection_toggle_cell(I18n.t('active_admin.batch_actions.selection_toggle_explanation', default: "(Toggle Selection)"))
|
32
34
|
end
|
33
|
-
|
34
35
|
end
|
35
36
|
|
36
37
|
end
|