acts_as_data_table 0.0.1
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.
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +55 -0
- data/Rakefile +11 -0
- data/acts_as_data_table.gemspec +25 -0
- data/app/coffeescripts/acts_as_data_table.coffee +47 -0
- data/app/helpers/acts_as_data_table_helper.rb +170 -0
- data/config/locales/acts_as_data_table.en.yml +11 -0
- data/generators/acts_as_data_table/acts_as_data_table_generator.rb +13 -0
- data/generators/acts_as_data_table/templates/assets/js/acts_as_data_table.js +37 -0
- data/init.rb +1 -0
- data/lib/acts_as_data_table/multi_column_scopes.rb +116 -0
- data/lib/acts_as_data_table/scope_filters/action_controller.rb +139 -0
- data/lib/acts_as_data_table/scope_filters/active_record.rb +264 -0
- data/lib/acts_as_data_table/scope_filters/form_helper.rb +67 -0
- data/lib/acts_as_data_table/scope_filters/validator.rb +144 -0
- data/lib/acts_as_data_table/session_helper.rb +193 -0
- data/lib/acts_as_data_table/shared/action_controller.rb +25 -0
- data/lib/acts_as_data_table/shared/session.rb +312 -0
- data/lib/acts_as_data_table/sortable_columns/action_controller.rb +111 -0
- data/lib/acts_as_data_table/sortable_columns/active_record.rb +34 -0
- data/lib/acts_as_data_table/sortable_columns/renderers/bootstrap2.rb +17 -0
- data/lib/acts_as_data_table/sortable_columns/renderers/default.rb +82 -0
- data/lib/acts_as_data_table/version.rb +3 -0
- data/lib/acts_as_data_table.rb +71 -0
- data/lib/acts_as_data_table_helper.rb.bak +165 -0
- data/lib/named_scope_filters.rb +273 -0
- data/lib/tasks/acts_as_data_table.rake +4 -0
- data/rails/init.rb +4 -0
- data/test/acts_as_searchable_test.rb +8 -0
- data/test/test_helper.rb +4 -0
- metadata +142 -0
@@ -0,0 +1,165 @@
|
|
1
|
+
module ActsAsDataTableHelper
|
2
|
+
|
3
|
+
def scope_filter_link(group, filter, options = {})
|
4
|
+
|
5
|
+
end
|
6
|
+
#
|
7
|
+
# #----------------------------------------------------------------
|
8
|
+
# # Filters
|
9
|
+
# #----------------------------------------------------------------
|
10
|
+
#
|
11
|
+
# # Generates a link to to add or remove a certain filter to the
|
12
|
+
# # current controller/action.
|
13
|
+
# # Parameters:
|
14
|
+
# # +group+:: The group name the filter belongs to
|
15
|
+
# #
|
16
|
+
# # ===Options
|
17
|
+
# # +:filter+:: The filter name to be applied
|
18
|
+
# # +:caption+:: The link caption, defaults to a localization
|
19
|
+
# # +:remove+:: If set to +true+, the filter will be removed instead of (re-)added
|
20
|
+
# # +:args+:: Args to be used when applying the filter
|
21
|
+
# # +:auto_remove+:: If set to true, a click on an active filter will remove it again.
|
22
|
+
# #
|
23
|
+
# # All other options will be used as html_options for the resulting link
|
24
|
+
# #--------------------------------------------------------------
|
25
|
+
# def scope_filter_link(group, options = {})
|
26
|
+
# filter_name = options.delete(:filter)
|
27
|
+
# caption = options.delete(:caption) || t("activerecord.scopes.#{searchable_session.model.table_name}.#{filter_name}")
|
28
|
+
# args = options.delete(:args)
|
29
|
+
# surrounding_tag = options.delete(:surrounding)
|
30
|
+
# auto_remove = options.delete(:auto_remove) && searchable_session.active_filter?(group, filter_name, args)
|
31
|
+
# remove = options.delete(:remove)
|
32
|
+
#
|
33
|
+
# if remove || auto_remove
|
34
|
+
# url = {:scope_filters => {:remove => group}}
|
35
|
+
# else
|
36
|
+
# url = {:scope_filters => {:group => group, :name => filter_name, :args => args}}
|
37
|
+
# end
|
38
|
+
#
|
39
|
+
# classes = options[:class].try(:split, ' ') || []
|
40
|
+
# classes << 'active' if searchable_session.active_filter?(group, filter_name, args)
|
41
|
+
# options[:class] = classes.join(' ')
|
42
|
+
# link = link_to_remote caption, :url => url, :method => :get, :html => options
|
43
|
+
# surrounding_tag ? content_tag(surrounding_tag, link, :class => options[:class]) : link
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# # Generates the URL to remove all filters from the current action
|
47
|
+
# #--------------------------------------------------------------
|
48
|
+
# def remove_all_scope_filters_url
|
49
|
+
# {:scope_filters => {:remove_all => true}}
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# # Generates the URL to be used as form action to add a new filter
|
53
|
+
# #--------------------------------------------------------------
|
54
|
+
# def scope_filter_form_url(group, filter_name)
|
55
|
+
# {:scope_filters => {:group => group, :name => filter_name}}
|
56
|
+
# end
|
57
|
+
#
|
58
|
+
# # Generates the form element name for filter args inside
|
59
|
+
# # a form
|
60
|
+
# #--------------------------------------------------------------
|
61
|
+
# def scope_filter_field_name(arg_name)
|
62
|
+
# "scope_filters[args][#{arg_name}]"
|
63
|
+
# end
|
64
|
+
#
|
65
|
+
# # Generates a form field id for the given scope and arg
|
66
|
+
# #--------------------------------------------------------------
|
67
|
+
# def scope_filter_field_id(scope, arg_name)
|
68
|
+
# [scope, arg_name].join('_')
|
69
|
+
# end
|
70
|
+
#
|
71
|
+
# # Builds the caption for an active filter
|
72
|
+
# #--------------------------------------------------------------
|
73
|
+
# def scope_filter_caption(active_filter)
|
74
|
+
# searchable_session.model.scope_caption(active_filter[:filter], active_filter[:args])
|
75
|
+
# end
|
76
|
+
#
|
77
|
+
# # Returns the arguments for a currently active filter or nil
|
78
|
+
# # if the given filter is currently not active.
|
79
|
+
# #-------------------------------------------------------------
|
80
|
+
# def scope_filter_arg(filter_name, arg_name)
|
81
|
+
# @filter_args ||= {}
|
82
|
+
# @filter_args[filter_name.to_s] ||= {}
|
83
|
+
#
|
84
|
+
# unless @filter_args[filter_name.to_s].has_key? arg_name.to_s
|
85
|
+
# filter = active_scope_filters.select{|f| f[:filter].to_s == filter_name.to_s}.first
|
86
|
+
# if filter
|
87
|
+
# @filter_args[filter_name.to_s] = filter[:args]
|
88
|
+
# else
|
89
|
+
# #If the filter is currently not active, cache the argument anyway with nil
|
90
|
+
# @filter_args[filter_name.to_s] ||= {}
|
91
|
+
# @filter_args[filter_name.to_s][arg_name.to_s] = nil
|
92
|
+
# end
|
93
|
+
# end
|
94
|
+
#
|
95
|
+
# @filter_args[filter_name.to_s][arg_name.to_s]
|
96
|
+
# end
|
97
|
+
#
|
98
|
+
# # Returns all active filters in a format which is easier to
|
99
|
+
# # process than the original hash structure. Each element of the
|
100
|
+
# # returned array contains the following properties:
|
101
|
+
# #
|
102
|
+
# # +:delete_url+:: A url hash which contains the necessary parameters to
|
103
|
+
# # remove the current filter from the active list
|
104
|
+
# #
|
105
|
+
# # +:group+:: The filter group this filter is in (in case you want to
|
106
|
+
# # user the +filter_link+ helper method)
|
107
|
+
# #
|
108
|
+
# # +:filter+:: The filter name
|
109
|
+
# #
|
110
|
+
# # +:args+:: The arguments the filter was applied to (for display reasons)
|
111
|
+
# #--------------------------------------------------------------
|
112
|
+
# def active_scope_filters
|
113
|
+
# return @active_filters if @active_filters
|
114
|
+
#
|
115
|
+
# @active_filters = []
|
116
|
+
# searchable_session.active_filters.each do |group, filters|
|
117
|
+
# filters.each do |filter, args|
|
118
|
+
# @active_filters << {:delete_url => {:scope_filters => {:remove => group}},
|
119
|
+
# :group => group,
|
120
|
+
# :filter => filter,
|
121
|
+
# :args => HashWithIndifferentAccess.new(args)}
|
122
|
+
# end
|
123
|
+
# end
|
124
|
+
# @active_filters
|
125
|
+
# end
|
126
|
+
#
|
127
|
+
# # Returns the active scope filter for a given filter group
|
128
|
+
# # If you hand in a block, the filter will be available inside
|
129
|
+
# # If there is no active filter for the given group,
|
130
|
+
# # the block is not executed.
|
131
|
+
# #--------------------------------------------------------------
|
132
|
+
# def active_scope_filter(group, &proc)
|
133
|
+
# filter = active_scope_filters.select {|sf| sf[:group].to_s == group.to_s}.first
|
134
|
+
# if block_given?
|
135
|
+
# yield filter if filter
|
136
|
+
# else
|
137
|
+
# filter
|
138
|
+
# end
|
139
|
+
# end
|
140
|
+
#
|
141
|
+
# #----------------------------------------------------------------
|
142
|
+
# # Sorting Columns
|
143
|
+
# #----------------------------------------------------------------
|
144
|
+
#
|
145
|
+
# def sortable_column(model_name, column_name, caption = nil, &proc)
|
146
|
+
# sortable = Struct.new(:caption, :direction, :active, :url_replace, :url_add_toggle, :url_remove).new
|
147
|
+
#
|
148
|
+
# sortable.direction = searchable_session.sorting_direction(model_name, column_name)
|
149
|
+
# sortable.active = sortable.direction.present?
|
150
|
+
#
|
151
|
+
# sortable.url_replace = {:sorting_columns => {:replace => true, :model_name => model_name, :column_name => column_name}}
|
152
|
+
# sortable.url_add_toggle = {:sorting_columns => {:add => true, :model_name => model_name, :column_name => column_name}}
|
153
|
+
# sortable.url_remove = {:sorting_columns => {:remove => true, :model_name => model_name, :column_name => column_name}}
|
154
|
+
# sortable.caption = caption
|
155
|
+
#
|
156
|
+
#
|
157
|
+
# #If a block is given, we let the user handle the content of the table
|
158
|
+
# #header himself. Otherwise, we'll generate the default links.
|
159
|
+
# if block_given?
|
160
|
+
# yield sortable
|
161
|
+
# else
|
162
|
+
# render :partial => 'shared/sortable_column', :object => sortable
|
163
|
+
# end
|
164
|
+
# end
|
165
|
+
end
|
@@ -0,0 +1,273 @@
|
|
1
|
+
module Stex
|
2
|
+
module Acts
|
3
|
+
module DataTable
|
4
|
+
module NamedScopeFilters
|
5
|
+
module ActiveRecord
|
6
|
+
def self.included(base)
|
7
|
+
base.send :extend, ClassMethods
|
8
|
+
end
|
9
|
+
|
10
|
+
module ClassMethods
|
11
|
+
# Generates methods to automatically combine named scopes
|
12
|
+
# based on the given input
|
13
|
+
# Arguments are all named scopes you'd like to include into
|
14
|
+
# The parameter includes all filters which may be used by the automatic
|
15
|
+
# data filtering later.
|
16
|
+
# {:group_name => [scope1, scope2, [scope_with_arguments, arg1, arg2], scope4]}
|
17
|
+
#--------------------------------------------------------------
|
18
|
+
def has_named_scope_filters(filter_groups = {})
|
19
|
+
if filter_groups.empty? #No groups given, no filters created
|
20
|
+
throw 'is_named_scope_filterable needs arguments to run.'
|
21
|
+
end
|
22
|
+
|
23
|
+
#Convert filters
|
24
|
+
filter_groups.each do |group_name, filters|
|
25
|
+
filters = Array(filters)
|
26
|
+
filters.map! {|f| Array(f)}
|
27
|
+
|
28
|
+
#Check if all given named scopes actually exist
|
29
|
+
filters.each do |ns|
|
30
|
+
scope_name = ns.first
|
31
|
+
logger.warn "The scope '#{scope_name}' in group '#{group_name}' does not exist." unless scopes.has_key?(scope_name)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
#Create a method to test if a given filter is valid
|
36
|
+
define_singleton_method 'named_scope_filter?' do |group, name, args|
|
37
|
+
filter_groups[group] && filter_groups[group].assoc(name).present?
|
38
|
+
end
|
39
|
+
|
40
|
+
#Generate a method to actually apply the various filters to the current
|
41
|
+
#model.
|
42
|
+
define_singleton_method(:apply_scope_filters) do |scope_filter_groups|
|
43
|
+
result = self
|
44
|
+
scope_filter_groups.each do |group_name, scope_filters|
|
45
|
+
set_scopes = filter_groups[group_name.to_sym]
|
46
|
+
scope_filters.each do |filter, args|
|
47
|
+
set_filter = set_scopes.assoc(filter.to_sym)
|
48
|
+
arg_names = set_filter.drop(1)
|
49
|
+
scope_args = arg_names.map {|a| args[a.to_s]}
|
50
|
+
result = result.send(set_filter.first, *scope_args)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
result
|
54
|
+
end
|
55
|
+
|
56
|
+
#Generate a method to label applied filters.
|
57
|
+
#This method only does default labelling and will most likely be
|
58
|
+
#overridden in the actual model
|
59
|
+
define_singleton_method(:scope_caption) do |scope_name, args|
|
60
|
+
options = {:scope => "activerecord.scopes.#{table_name}", :default => scope_name}
|
61
|
+
symbol_args = {}
|
62
|
+
args.each do |k,v|
|
63
|
+
symbol_args[k.to_sym] = v
|
64
|
+
end
|
65
|
+
I18n.t(scope_name, options.merge(symbol_args))
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
#def is_named_scope_sortable(*args)
|
70
|
+
# options = args.pop if args.last.is_a?(Hash)
|
71
|
+
# processed_args = args.map {|a| generate_sortable_columns_and_includes(a)}.flatten
|
72
|
+
#
|
73
|
+
# column_names = []
|
74
|
+
# unfiltered_includes = []
|
75
|
+
#
|
76
|
+
# processed_args.each do |arg|
|
77
|
+
# column_names += arg[:columns]
|
78
|
+
# unfiltered_includes += arg[:includes]
|
79
|
+
# end
|
80
|
+
#
|
81
|
+
# #TODO: filter longer include chains, have to get a real example first.
|
82
|
+
#
|
83
|
+
#
|
84
|
+
# 1
|
85
|
+
#end
|
86
|
+
|
87
|
+
|
88
|
+
## Processes arguments for the sortable generator
|
89
|
+
## Returns column names and necessary includes
|
90
|
+
##--------------------------------------------------------------
|
91
|
+
#def generate_sortable_columns_and_includes(arg, model = self)
|
92
|
+
# columns = []
|
93
|
+
# includes = []
|
94
|
+
# #Associations from the current model
|
95
|
+
# if arg.is_a?(Hash)
|
96
|
+
# arg.each do |association_name, columns_and_associations|
|
97
|
+
# association_endpoint = Stex::Acts::Searchable::DataHolder.graph.associations_for(model)[association_name.to_s]
|
98
|
+
# Array(columns_and_associations).each do |new_arg|
|
99
|
+
# processed_arg = generate_sortable_columns_and_includes(new_arg, association_endpoint)
|
100
|
+
# columns += processed_arg[:columns]
|
101
|
+
# if processed_arg[:includes].any?
|
102
|
+
# includes << {association_name => processed_arg[:includes]}
|
103
|
+
# else
|
104
|
+
# includes << association_name if processed_arg[:columns].any?
|
105
|
+
# end
|
106
|
+
# end
|
107
|
+
# end
|
108
|
+
# else
|
109
|
+
# columns << "#{model.table_name}.#{arg}" if model.column_names.include?(arg.to_s)
|
110
|
+
# end
|
111
|
+
#
|
112
|
+
# {:columns => columns, :includes => includes}
|
113
|
+
#end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
module ActionController
|
118
|
+
def self.included(base)
|
119
|
+
base.send :extend, ClassMethods
|
120
|
+
end
|
121
|
+
|
122
|
+
module ClassMethods
|
123
|
+
# Generates the necessary controller methods to add and remove filters
|
124
|
+
# Expects the model name and a list of methods the filters will be used for
|
125
|
+
# Important: Do not use the model constant (e.g. User), it might break
|
126
|
+
# your database setup.
|
127
|
+
#
|
128
|
+
# == Examples
|
129
|
+
# scope_filters :user, :index
|
130
|
+
#--------------------------------------------------------------
|
131
|
+
def scope_filters(model_name, *args)
|
132
|
+
helper_method :searchable_session
|
133
|
+
|
134
|
+
before_filter :add_scope_filter, :only => args
|
135
|
+
before_filter :remove_scope_filter, :only => args
|
136
|
+
before_filter :remove_all_scope_filters, :only => args
|
137
|
+
before_filter :load_active_scope_filters, :only => args
|
138
|
+
|
139
|
+
helper :acts_as_data_table
|
140
|
+
|
141
|
+
# Adds a filter to the current data table. Works with the
|
142
|
+
# named scope filterable plugin.
|
143
|
+
# Expects the following params to be set:
|
144
|
+
# :scope_filters =>
|
145
|
+
# :group -- The group the named scope belongs to
|
146
|
+
# :name -- The named scope name inside the group
|
147
|
+
# :args -- Array of arguments to be passed to the named scope
|
148
|
+
# If any of these params (except filter_args which is optional)
|
149
|
+
# is not set, the filter will not be added.
|
150
|
+
#--------------------------------------------------------------
|
151
|
+
define_method(:add_scope_filter) do
|
152
|
+
return if params[:scope_filters].blank?
|
153
|
+
return if [:group, :name].any? { |p| params[:scope_filters][p].blank? }
|
154
|
+
|
155
|
+
group = params[:scope_filters][:group].to_sym
|
156
|
+
name = params[:scope_filters][:name].to_sym
|
157
|
+
args = params[:scope_filters][:args]
|
158
|
+
args = nil if args.blank? #No empty string here
|
159
|
+
|
160
|
+
model = model_name.to_s.classify.constantize
|
161
|
+
|
162
|
+
#If the given filter is not valid, do not add it to the filters list
|
163
|
+
return unless model.named_scope_filter?(group, name, args)
|
164
|
+
searchable_session.add_filter(group, name, args)
|
165
|
+
end
|
166
|
+
|
167
|
+
# Removes a filter from the current data table.
|
168
|
+
# Expects the following params to be set:
|
169
|
+
# :scope_filters =>
|
170
|
+
# :group -- The group the named scope belongs to
|
171
|
+
# :remove => true
|
172
|
+
#--------------------------------------------------------------
|
173
|
+
define_method(:remove_scope_filter) do
|
174
|
+
return if params[:scope_filters].blank?
|
175
|
+
return if params[:scope_filters][:remove].blank?
|
176
|
+
searchable_session.remove_filter(params[:scope_filters][:remove])
|
177
|
+
end
|
178
|
+
|
179
|
+
# Removes all filters from the current controller and action
|
180
|
+
#--------------------------------------------------------------
|
181
|
+
define_method(:remove_all_scope_filters) do
|
182
|
+
return if params[:scope_filters].blank?
|
183
|
+
return if params[:scope_filters][:remove_all].blank?
|
184
|
+
searchable_session.remove_all_filters
|
185
|
+
end
|
186
|
+
|
187
|
+
# Session Helper instance accessor
|
188
|
+
#--------------------------------------------------------------
|
189
|
+
define_method(:searchable_session) do
|
190
|
+
@searchable_session = Stex::Acts::DataTable::SessionHelper.new(session, controller_path, action_name, model_name)
|
191
|
+
end
|
192
|
+
|
193
|
+
# Loads the active filters into an instance variable, just in case
|
194
|
+
# that naming changes later
|
195
|
+
#--------------------------------------------------------------
|
196
|
+
define_method(:load_active_scope_filters) do
|
197
|
+
@loaded_scope_filters = searchable_session.active_filters
|
198
|
+
end
|
199
|
+
|
200
|
+
#Make the helper methods private so rails does not handle them as actions
|
201
|
+
private :add_scope_filter, :remove_scope_filter, :searchable_session, :load_active_scope_filters
|
202
|
+
end
|
203
|
+
|
204
|
+
# Adds methods for automatic column sorting to the controller
|
205
|
+
# Parameters:
|
206
|
+
# actions_and_defaults:: Hash of actions which will be used to
|
207
|
+
# display sortable content and their initial sorting
|
208
|
+
# columns.
|
209
|
+
#
|
210
|
+
# == Example
|
211
|
+
# column_sorting :index => [['users.last_name', 'ASC'], ['users.first_name', 'ASC']]
|
212
|
+
#--------------------------------------------------------------
|
213
|
+
def column_sorting(actions_and_defaults = {})
|
214
|
+
|
215
|
+
before_filter :add_or_toggle_sorting_column, :only => actions_and_defaults.keys
|
216
|
+
before_filter :replace_sorting_column, :only => actions_and_defaults.keys
|
217
|
+
before_filter :remove_sorting_column, :only => actions_and_defaults.keys
|
218
|
+
before_filter :load_sorting_columns, :only => actions_and_defaults.keys
|
219
|
+
|
220
|
+
param_namespace = :sorting_columns
|
221
|
+
|
222
|
+
# Adds a sorting column to the current sorting columns or
|
223
|
+
# toggles its direction if it is already part of the
|
224
|
+
# active sorting.
|
225
|
+
#
|
226
|
+
# Parameters
|
227
|
+
# :sorting_columns => {
|
228
|
+
# :model_name => 'sale',
|
229
|
+
# :column_name => 'reference'
|
230
|
+
# }
|
231
|
+
#--------------------------------------------------------------
|
232
|
+
define_method(:add_or_toggle_sorting_column) do
|
233
|
+
return if params[param_namespace].blank?
|
234
|
+
return if [:add, :model_name, :column_name].select {|p| params[param_namespace][p].blank?}.any?
|
235
|
+
searchable_session.add_or_toggle_sorting_column(params[param_namespace][:model_name], params[param_namespace][:column_name])
|
236
|
+
end
|
237
|
+
|
238
|
+
# Replaces all current sorting columsn with the given one
|
239
|
+
#--------------------------------------------------------------
|
240
|
+
define_method(:replace_sorting_column) do
|
241
|
+
return if params[param_namespace].blank?
|
242
|
+
return if [:replace, :model_name, :column_name].select {|p| params[param_namespace][p].blank?}.any?
|
243
|
+
searchable_session.replace_sorting_column(params[param_namespace][:model_name], params[param_namespace][:column_name])
|
244
|
+
end
|
245
|
+
|
246
|
+
# Removes a column from the current sorting columns
|
247
|
+
#--------------------------------------------------------------
|
248
|
+
define_method(:remove_sorting_column) do
|
249
|
+
return if params[param_namespace].blank?
|
250
|
+
return if [:remove, :model_name, :column_name].select {|p| params[param_namespace][p].blank?}.any?
|
251
|
+
searchable_session.remove_sorting_column(params[param_namespace][:model_name], params[param_namespace][:column_name])
|
252
|
+
end
|
253
|
+
|
254
|
+
# Loads the current sorting string into an instance variable
|
255
|
+
#--------------------------------------------------------------
|
256
|
+
define_method(:load_sorting_columns) do
|
257
|
+
@current_sorting_string = searchable_session.sorting_columns_string
|
258
|
+
|
259
|
+
#If there is no user-set sorting, load the default sorting into the session.
|
260
|
+
if @current_sorting_string.blank?
|
261
|
+
searchable_session.load_sorting_defaults(actions_and_defaults[action_name.to_sym])
|
262
|
+
end
|
263
|
+
|
264
|
+
@current_sorting_string = searchable_session.sorting_columns_string
|
265
|
+
end
|
266
|
+
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
data/rails/init.rb
ADDED
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: acts_as_data_table
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Stefan Exner
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2015-04-30 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: bundler
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 1
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 7
|
32
|
+
version: "1.7"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rake
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 35
|
44
|
+
segments:
|
45
|
+
- 10
|
46
|
+
- 0
|
47
|
+
version: "10.0"
|
48
|
+
type: :development
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rails
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 5
|
59
|
+
segments:
|
60
|
+
- 2
|
61
|
+
- 3
|
62
|
+
version: "2.3"
|
63
|
+
type: :runtime
|
64
|
+
version_requirements: *id003
|
65
|
+
description: Adds methods to models and controllers to perform automatic filtering, sorting and multi-column-queries without having to worry about the implementation.
|
66
|
+
email:
|
67
|
+
- stex@sterex.de
|
68
|
+
executables: []
|
69
|
+
|
70
|
+
extensions: []
|
71
|
+
|
72
|
+
extra_rdoc_files: []
|
73
|
+
|
74
|
+
files:
|
75
|
+
- .gitignore
|
76
|
+
- Gemfile
|
77
|
+
- LICENSE.txt
|
78
|
+
- README.md
|
79
|
+
- Rakefile
|
80
|
+
- acts_as_data_table.gemspec
|
81
|
+
- app/coffeescripts/acts_as_data_table.coffee
|
82
|
+
- app/helpers/acts_as_data_table_helper.rb
|
83
|
+
- config/locales/acts_as_data_table.en.yml
|
84
|
+
- generators/acts_as_data_table/acts_as_data_table_generator.rb
|
85
|
+
- generators/acts_as_data_table/templates/assets/js/acts_as_data_table.js
|
86
|
+
- init.rb
|
87
|
+
- lib/acts_as_data_table.rb
|
88
|
+
- lib/acts_as_data_table/multi_column_scopes.rb
|
89
|
+
- lib/acts_as_data_table/scope_filters/action_controller.rb
|
90
|
+
- lib/acts_as_data_table/scope_filters/active_record.rb
|
91
|
+
- lib/acts_as_data_table/scope_filters/form_helper.rb
|
92
|
+
- lib/acts_as_data_table/scope_filters/validator.rb
|
93
|
+
- lib/acts_as_data_table/session_helper.rb
|
94
|
+
- lib/acts_as_data_table/shared/action_controller.rb
|
95
|
+
- lib/acts_as_data_table/shared/session.rb
|
96
|
+
- lib/acts_as_data_table/sortable_columns/action_controller.rb
|
97
|
+
- lib/acts_as_data_table/sortable_columns/active_record.rb
|
98
|
+
- lib/acts_as_data_table/sortable_columns/renderers/bootstrap2.rb
|
99
|
+
- lib/acts_as_data_table/sortable_columns/renderers/default.rb
|
100
|
+
- lib/acts_as_data_table/version.rb
|
101
|
+
- lib/acts_as_data_table_helper.rb.bak
|
102
|
+
- lib/named_scope_filters.rb
|
103
|
+
- lib/tasks/acts_as_data_table.rake
|
104
|
+
- rails/init.rb
|
105
|
+
- test/acts_as_searchable_test.rb
|
106
|
+
- test/test_helper.rb
|
107
|
+
homepage: https://www.github.com/stex/acts_as_data_table
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
post_install_message:
|
111
|
+
rdoc_options: []
|
112
|
+
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
hash: 3
|
121
|
+
segments:
|
122
|
+
- 0
|
123
|
+
version: "0"
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
none: false
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
hash: 3
|
130
|
+
segments:
|
131
|
+
- 0
|
132
|
+
version: "0"
|
133
|
+
requirements: []
|
134
|
+
|
135
|
+
rubyforge_project:
|
136
|
+
rubygems_version: 1.8.22
|
137
|
+
signing_key:
|
138
|
+
specification_version: 3
|
139
|
+
summary: Adds automatic scope based filtering and column sorting to controllers and models.
|
140
|
+
test_files:
|
141
|
+
- test/acts_as_searchable_test.rb
|
142
|
+
- test/test_helper.rb
|