activeadmin-orderable 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11d1eaedd36412fc99cd65b824ce719e40ee750c
4
- data.tar.gz: f780e8ce592b8814247fc733b17ec63cde76a4b4
3
+ metadata.gz: 25c9e95dfc903fcd232ac199ceb1d4db527a1439
4
+ data.tar.gz: 6be807d4f4971c34c179b08091336736e339cb1a
5
5
  SHA512:
6
- metadata.gz: 62b7af3178da8fa5cac578f47a30dcc9118312162fa9e1e62026eefd591cd897eeacda2e4b6d65a2b5d45e33172c359d9fbe9c1b70c80d5e540976899ed667a9
7
- data.tar.gz: ddd4f1fe2e38ab76b91b1db3f0aec640fceffe421bf685d2b4b019650ca943d672578acb0bd77ff24d3de168dd39c4d2bbb1775eda4392533ecb95697f510e41
6
+ metadata.gz: 6ef17270997256799cea31fa18aecec225a116380cd46d6199ac2006de08d7b533f93cd9289c43119d8ead7ae859634b75ba27f413a5a2598a408625dbb79223
7
+ data.tar.gz: 08e99778d88548c80acf3caea96d318c1aec40e6afc5548d331d84750a83d9ba76528f7e15ae387705408d3f9ef3456ba2e9029dab64591548e96ea44cfddf19
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Active Admin Orderable
2
2
 
3
3
  This gem extends ActiveAdmin so that your index page's table rows can be
4
- sortable via a drag-and-drop interface.
4
+ orderable via a drag-and-drop interface.
5
5
 
6
6
  ## Prerequisites
7
7
 
@@ -55,14 +55,14 @@ ActiveAdmin.register Page do
55
55
  config.sort_order = 'position_asc' # assumes you are using 'position' for your acts_as_list column
56
56
  config.paginate = false # optional; drag-and-drop across pages is not supported
57
57
 
58
- sortable # creates the controller action which handles the sorting
58
+ orderable # creates the controller action which handles the sorting
59
59
 
60
60
  index do
61
- sortable_handle_column # inserts a drag handle
62
- # use a user-defined URL for sorting
63
- sortable_handle_column url: :sort_admin_section_path
61
+ orderable_handle_column # inserts a drag handle
62
+ # use a user-defined URL for ordering
63
+ orderable_handle_column url: :sort_admin_section_path
64
64
  # alternative form with lambda
65
- sortable_handle_column url: -> (resource) { compute_url_from_resource(resource) }
65
+ orderable_handle_column url: -> (resource) { compute_url_from_resource(resource) }
66
66
  # other columns...
67
67
  end
68
68
 
@@ -74,7 +74,7 @@ ActiveAdmin.register Page do
74
74
 
75
75
  panel 'Contents' do
76
76
  table_for c.collection_memberships do
77
- sortable_handle_column
77
+ orderable_handle_column
78
78
  column :position
79
79
  column :collectable
80
80
  end
@@ -5,7 +5,7 @@ require 'activeadmin-orderable/version'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "activeadmin-orderable"
8
- gem.version = Activeadmin::Sortable::VERSION
8
+ gem.version = Activeadmin::Orderable::VERSION
9
9
  gem.authors = ["Adam McCrea", "Jonathan Gertig"]
10
10
  gem.email = ["adam@adamlogic.com", "jcgertig@gmail.com"]
11
11
  gem.description = %q{Drag and drop reordering interface for ActiveAdmin tables}
@@ -1 +1 @@
1
- .activeadmin-sortable .handle { cursor: ns-resize; }
1
+ .activeadmin-orderable .handle { cursor: ns-resize; }
@@ -1,11 +1,11 @@
1
- require 'activeadmin-sortable/version'
1
+ require 'activeadmin-orderable/version'
2
2
  require 'activeadmin'
3
3
  require 'rails/engine'
4
4
 
5
5
  module ActiveAdmin
6
- module Sortable
6
+ module Orderable
7
7
  module ControllerActions
8
- def sortable
8
+ def orderable
9
9
  member_action :sort, :method => :post do
10
10
  if defined?(::Mongoid::Orderable) &&
11
11
  resource.class.included_modules.include?(::Mongoid::Orderable)
@@ -21,8 +21,8 @@ module ActiveAdmin
21
21
  module TableMethods
22
22
  HANDLE = '↕'.html_safe
23
23
 
24
- def sortable_handle_column options = {}
25
- column '', :class => "activeadmin-sortable" do |resource|
24
+ def orderable_handle_column options = {}
25
+ column '', :class => "activeadmin-orderable" do |resource|
26
26
  sort_url = if options[:url].is_a? Symbol
27
27
  send options[:url], resource
28
28
  elsif options[:url].respond_to? :call
@@ -1,5 +1,5 @@
1
1
  module Activeadmin
2
- module Sortable
3
- VERSION = "0.1.1"
2
+ module Orderable
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-orderable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam McCrea