administrate 0.17.0 → 0.20.0

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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -2
  3. data/app/assets/javascripts/administrate/application.js +0 -2
  4. data/app/assets/javascripts/administrate/components/select.js +3 -0
  5. data/app/assets/stylesheets/administrate/application.scss +0 -1
  6. data/app/assets/stylesheets/administrate/base/_forms.scss +1 -1
  7. data/app/assets/stylesheets/administrate/components/_buttons.scss +9 -0
  8. data/app/assets/stylesheets/administrate/components/_field-unit.scss +7 -0
  9. data/app/assets/stylesheets/administrate/components/_flashes.scss +2 -2
  10. data/app/assets/stylesheets/administrate/library/_variables.scss +1 -1
  11. data/app/controllers/administrate/application_controller.rb +85 -17
  12. data/app/controllers/concerns/administrate/punditize.rb +44 -20
  13. data/app/helpers/administrate/application_helper.rb +24 -6
  14. data/app/views/administrate/application/_collection.html.erb +5 -6
  15. data/app/views/administrate/application/_collection_header_actions.html.erb +2 -2
  16. data/app/views/administrate/application/_collection_item_actions.html.erb +4 -4
  17. data/app/views/administrate/application/_form.html.erb +19 -4
  18. data/app/views/administrate/application/_index_header.html.erb +2 -2
  19. data/app/views/administrate/application/_navigation.html.erb +2 -2
  20. data/app/views/administrate/application/_pagination.html.erb +1 -0
  21. data/app/views/administrate/application/edit.html.erb +2 -2
  22. data/app/views/administrate/application/index.html.erb +1 -1
  23. data/app/views/administrate/application/new.html.erb +1 -1
  24. data/app/views/administrate/application/show.html.erb +28 -12
  25. data/app/views/fields/belongs_to/_index.html.erb +1 -1
  26. data/app/views/fields/belongs_to/_show.html.erb +1 -1
  27. data/app/views/fields/date/_form.html.erb +1 -3
  28. data/app/views/fields/date_time/_form.html.erb +1 -3
  29. data/app/views/fields/has_many/_index.html.erb +1 -1
  30. data/app/views/fields/has_many/_show.html.erb +2 -1
  31. data/app/views/fields/has_one/_form.html.erb +15 -5
  32. data/app/views/fields/has_one/_index.html.erb +2 -1
  33. data/app/views/fields/has_one/_show.html.erb +20 -13
  34. data/app/views/fields/polymorphic/_index.html.erb +2 -1
  35. data/app/views/fields/polymorphic/_show.html.erb +1 -1
  36. data/app/views/fields/select/_form.html.erb +5 -18
  37. data/app/views/fields/time/_form.html.erb +2 -3
  38. data/app/views/fields/url/_index.html.erb +1 -1
  39. data/app/views/fields/url/_show.html.erb +1 -1
  40. data/app/views/layouts/administrate/application.html.erb +1 -1
  41. data/config/locales/administrate.de.yml +2 -2
  42. data/config/locales/administrate.ja.yml +5 -5
  43. data/config/locales/administrate.sl.yml +30 -0
  44. data/docs/adding_controllers_without_related_model.md +2 -2
  45. data/docs/authorization.md +43 -20
  46. data/docs/customizing_controller_actions.md +25 -6
  47. data/docs/customizing_dashboards.md +88 -10
  48. data/docs/getting_started.md +1 -1
  49. data/docs/guides/customising_search.md +149 -0
  50. data/docs/guides/hiding_dashboards_from_sidebar.md +4 -2
  51. data/docs/guides/scoping_has_many_relations.md +27 -0
  52. data/docs/guides.md +3 -1
  53. data/lib/administrate/base_dashboard.rb +39 -3
  54. data/lib/administrate/engine.rb +2 -2
  55. data/lib/administrate/field/associative.rb +18 -8
  56. data/lib/administrate/field/base.rb +4 -0
  57. data/lib/administrate/field/belongs_to.rb +9 -2
  58. data/lib/administrate/field/deferred.rb +5 -1
  59. data/lib/administrate/field/has_many.rb +20 -6
  60. data/lib/administrate/field/has_one.rb +4 -0
  61. data/lib/administrate/field/number.rb +2 -8
  62. data/lib/administrate/field/polymorphic.rb +2 -1
  63. data/lib/administrate/field/select.rb +19 -9
  64. data/lib/administrate/field/url.rb +4 -0
  65. data/lib/administrate/not_authorized_error.rb +20 -0
  66. data/lib/administrate/order.rb +73 -17
  67. data/lib/administrate/page/base.rb +4 -0
  68. data/lib/administrate/page/collection.rb +1 -0
  69. data/lib/administrate/page/form.rb +9 -8
  70. data/lib/administrate/page/show.rb +10 -2
  71. data/lib/administrate/resource_resolver.rb +2 -1
  72. data/lib/administrate/search.rb +1 -1
  73. data/lib/administrate/version.rb +1 -1
  74. data/lib/administrate/view_generator.rb +6 -1
  75. data/lib/administrate.rb +24 -2
  76. data/lib/generators/administrate/dashboard/dashboard_generator.rb +20 -2
  77. data/lib/generators/administrate/dashboard/templates/controller.rb.erb +2 -2
  78. data/lib/generators/administrate/install/install_generator.rb +6 -1
  79. data/lib/generators/administrate/routes/routes_generator.rb +11 -2
  80. data/lib/generators/administrate/test_record.rb +21 -0
  81. metadata +39 -46
  82. data/app/assets/javascripts/administrate/components/date_time_picker.js +0 -14
  83. data/config/i18n-tasks.yml +0 -18
  84. data/config/routes.rb +0 -2
  85. data/config/unicorn.rb +0 -25
@@ -1,18 +1,19 @@
1
1
  module Administrate
2
2
  class Order
3
- def initialize(attribute = nil, direction = nil)
3
+ def initialize(attribute = nil, direction = nil, association_attribute: nil)
4
4
  @attribute = attribute
5
5
  @direction = sanitize_direction(direction)
6
+ @association_attribute = association_attribute
6
7
  end
7
8
 
8
9
  def apply(relation)
9
10
  return order_by_association(relation) unless
10
11
  reflect_association(relation).nil?
11
12
 
12
- order = "#{relation.table_name}.#{attribute} #{direction}"
13
+ order = relation.arel_table[attribute].public_send(direction)
13
14
 
14
- return relation.reorder(Arel.sql(order)) if
15
- relation.columns_hash.keys.include?(attribute.to_s)
15
+ return relation.reorder(order) if
16
+ column_exist?(relation, attribute)
16
17
 
17
18
  relation
18
19
  end
@@ -32,7 +33,7 @@ module Administrate
32
33
 
33
34
  private
34
35
 
35
- attr_reader :attribute
36
+ attr_reader :attribute, :association_attribute
36
37
 
37
38
  def sanitize_direction(direction)
38
39
  %w[asc desc].include?(direction.to_s) ? direction.to_sym : :asc
@@ -51,32 +52,83 @@ module Administrate
51
52
  end
52
53
 
53
54
  def order_by_association(relation)
54
- return order_by_count(relation) if has_many_attribute?(relation)
55
-
56
- return order_by_id(relation) if belongs_to_attribute?(relation)
57
-
58
- relation
55
+ case relation_type(relation)
56
+ when :has_many
57
+ order_by_count(relation)
58
+ when :belongs_to
59
+ order_by_belongs_to(relation)
60
+ when :has_one
61
+ order_by_has_one(relation)
62
+ else
63
+ relation
64
+ end
59
65
  end
60
66
 
61
67
  def order_by_count(relation)
62
68
  klass = reflect_association(relation).klass
63
- query = "COUNT(#{klass.table_name}.#{klass.primary_key}) #{direction}"
69
+ query = klass.arel_table[klass.primary_key].count.public_send(direction)
64
70
  relation.
65
71
  left_joins(attribute.to_sym).
66
72
  group(:id).
67
- reorder(Arel.sql(query))
73
+ reorder(query)
74
+ end
75
+
76
+ def order_by_belongs_to(relation)
77
+ if ordering_by_association_column?(relation)
78
+ order_by_attribute(relation)
79
+ else
80
+ order_by_id(relation)
81
+ end
82
+ end
83
+
84
+ def order_by_has_one(relation)
85
+ if ordering_by_association_column?(relation)
86
+ order_by_attribute(relation)
87
+ else
88
+ order_by_association_id(relation)
89
+ end
90
+ end
91
+
92
+ def order_by_attribute(relation)
93
+ relation.joins(
94
+ attribute.to_sym,
95
+ ).reorder(order_by_attribute_query)
68
96
  end
69
97
 
70
98
  def order_by_id(relation)
71
- relation.reorder("#{foreign_key(relation)} #{direction}")
99
+ relation.reorder(order_by_id_query(relation))
100
+ end
101
+
102
+ def order_by_association_id(relation)
103
+ relation.reorder(order_by_association_id_query)
104
+ end
105
+
106
+ def ordering_by_association_column?(relation)
107
+ association_attribute &&
108
+ column_exist?(
109
+ reflect_association(relation).klass, association_attribute.to_sym
110
+ )
111
+ end
112
+
113
+ def column_exist?(table, column_name)
114
+ table.columns_hash.key?(column_name.to_s)
72
115
  end
73
116
 
74
- def has_many_attribute?(relation)
75
- reflect_association(relation).macro == :has_many
117
+ def order_by_id_query(relation)
118
+ relation.arel_table[foreign_key(relation)].public_send(direction)
76
119
  end
77
120
 
78
- def belongs_to_attribute?(relation)
79
- reflect_association(relation).macro == :belongs_to
121
+ def order_by_association_id_query
122
+ Arel::Table.new(association_table_name)[:id].public_send(direction)
123
+ end
124
+
125
+ def order_by_attribute_query
126
+ table = Arel::Table.new(association_table_name)
127
+ table[association_attribute].public_send(direction)
128
+ end
129
+
130
+ def relation_type(relation)
131
+ reflect_association(relation).macro
80
132
  end
81
133
 
82
134
  def reflect_association(relation)
@@ -86,5 +138,9 @@ module Administrate
86
138
  def foreign_key(relation)
87
139
  reflect_association(relation).foreign_key
88
140
  end
141
+
142
+ def association_table_name
143
+ attribute.tableize
144
+ end
89
145
  end
90
146
  end
@@ -23,6 +23,10 @@ module Administrate
23
23
  dashboard.try(:item_includes) || []
24
24
  end
25
25
 
26
+ def item_associations
27
+ dashboard.try(:item_associations) || []
28
+ end
29
+
26
30
  private
27
31
 
28
32
  def attribute_field(dashboard, resource, attribute_name, page)
@@ -4,6 +4,7 @@ module Administrate
4
4
  module Page
5
5
  class Collection < Page::Base
6
6
  def attribute_names
7
+ options.fetch(:collection_attributes, nil) ||
7
8
  dashboard.collection_attributes
8
9
  end
9
10
 
@@ -11,15 +11,16 @@ module Administrate
11
11
  attr_reader :resource
12
12
 
13
13
  def attributes(action = nil)
14
- action =
15
- case action
16
- when "update" then "edit"
17
- when "create" then "new"
18
- else action
19
- end
14
+ attributes = dashboard.form_attributes(action)
15
+
16
+ if attributes.is_a? Array
17
+ attributes = { "" => attributes }
18
+ end
20
19
 
21
- dashboard.form_attributes(action).map do |attribute|
22
- attribute_field(dashboard, resource, attribute, :form)
20
+ attributes.transform_values do |attrs|
21
+ attrs.map do |attribute|
22
+ attribute_field(dashboard, resource, attribute, :form)
23
+ end
23
24
  end
24
25
  end
25
26
 
@@ -15,8 +15,16 @@ module Administrate
15
15
  end
16
16
 
17
17
  def attributes
18
- dashboard.show_page_attributes.map do |attr_name|
19
- attribute_field(dashboard, resource, attr_name, :show)
18
+ attributes = dashboard.show_page_attributes
19
+
20
+ if attributes.is_a? Array
21
+ attributes = { "" => attributes }
22
+ end
23
+
24
+ attributes.transform_values do |attrs|
25
+ attrs.map do |attr_name|
26
+ attribute_field(dashboard, resource, attr_name, :show)
27
+ end
20
28
  end
21
29
  end
22
30
  end
@@ -35,7 +35,8 @@ module Administrate
35
35
  end
36
36
 
37
37
  def controller_path_parts
38
- controller_path.split("/")[1..-1].map(&:singularize)
38
+ path_parts = controller_path.split("/")[1..-1]
39
+ path_parts << path_parts.pop.singularize
39
40
  end
40
41
 
41
42
  attr_reader :controller_path
@@ -31,7 +31,7 @@ module Administrate
31
31
  private
32
32
 
33
33
  def filter?(word)
34
- valid_filters&.any? { |filter| word.match?(/^#{filter}:\w*$/) }
34
+ valid_filters&.any? { |filter| word.match?(/^#{filter}:/) }
35
35
  end
36
36
 
37
37
  def parse_query(query)
@@ -1,3 +1,3 @@
1
1
  module Administrate
2
- VERSION = "0.17.0".freeze
2
+ VERSION = "0.20.0".freeze
3
3
  end
@@ -5,7 +5,12 @@ require "administrate/namespace"
5
5
  module Administrate
6
6
  class ViewGenerator < Rails::Generators::Base
7
7
  include Administrate::GeneratorHelpers
8
- class_option :namespace, type: :string, default: :admin
8
+ class_option(
9
+ :namespace,
10
+ type: :string,
11
+ desc: "Namespace where the admin dashboards live",
12
+ default: "admin",
13
+ )
9
14
 
10
15
  def self.template_source_path
11
16
  File.expand_path(
data/lib/administrate.rb CHANGED
@@ -2,7 +2,7 @@ require "administrate/engine"
2
2
 
3
3
  module Administrate
4
4
  def self.warn_of_missing_resource_class
5
- ActiveSupport::Deprecation.warn(
5
+ deprecator.warn(
6
6
  "Calling Field::Base.permitted_attribute without the option " +
7
7
  ":resource_class is deprecated. If you are seeing this " +
8
8
  "message, you are probably using a custom field type that" +
@@ -12,7 +12,7 @@ module Administrate
12
12
  end
13
13
 
14
14
  def self.warn_of_deprecated_option(name)
15
- ActiveSupport::Deprecation.warn(
15
+ deprecator.warn(
16
16
  "The option :#{name} is deprecated. " +
17
17
  "Administrate should detect it automatically. " +
18
18
  "Please file an issue at " +
@@ -20,4 +20,26 @@ module Administrate
20
20
  "if you think otherwise.",
21
21
  )
22
22
  end
23
+
24
+ def self.warn_of_deprecated_method(klass, method)
25
+ deprecator.warn(
26
+ "The method #{klass}##{method} is deprecated. " +
27
+ "If you are seeing this message you are probably " +
28
+ "using a dashboard that depends explicitly on it. " +
29
+ "Please make sure you update it to a version that " +
30
+ "does not use a deprecated API",
31
+ )
32
+ end
33
+
34
+ def self.warn_of_deprecated_authorization_method(method)
35
+ deprecator.warn(
36
+ "The method `#{method}` is deprecated. " +
37
+ "Please use `accessible_action?` instead, " +
38
+ "or see the documentation for other options.",
39
+ )
40
+ end
41
+
42
+ def self.deprecator
43
+ @deprecator ||= ActiveSupport::Deprecation.new(VERSION, "Administrate")
44
+ end
23
45
  end
@@ -27,7 +27,12 @@ module Administrate
27
27
  COLLECTION_ATTRIBUTE_LIMIT = 4
28
28
  READ_ONLY_ATTRIBUTES = %w[id created_at updated_at]
29
29
 
30
- class_option :namespace, type: :string, default: :admin
30
+ class_option(
31
+ :namespace,
32
+ type: :string,
33
+ desc: "Namespace where the admin dashboards live",
34
+ default: "admin",
35
+ )
31
36
 
32
37
  source_root File.expand_path("../templates", __FILE__)
33
38
 
@@ -53,9 +58,22 @@ module Administrate
53
58
  end
54
59
 
55
60
  def attributes
56
- klass.reflections.keys +
61
+ attrs = (
62
+ klass.reflections.keys +
57
63
  klass.columns.map(&:name) -
58
64
  redundant_attributes
65
+ )
66
+
67
+ primary_key = attrs.delete(klass.primary_key)
68
+ created_at = attrs.delete("created_at")
69
+ updated_at = attrs.delete("updated_at")
70
+
71
+ [
72
+ primary_key,
73
+ *attrs.sort,
74
+ created_at,
75
+ updated_at,
76
+ ].compact
59
77
  end
60
78
 
61
79
  def form_attributes
@@ -36,11 +36,11 @@ module <%= namespace.to_s.camelize %>
36
36
  #
37
37
  # def resource_params
38
38
  # params.require(resource_class.model_name.param_key).
39
- # permit(dashboard.permitted_attributes).
39
+ # permit(dashboard.permitted_attributes(action_name)).
40
40
  # transform_values { |value| value == "" ? nil : value }
41
41
  # end
42
42
 
43
- # See https://administrate-prototype.herokuapp.com/customizing_controller_actions
43
+ # See https://administrate-demo.herokuapp.com/customizing_controller_actions
44
44
  # for more information
45
45
  end
46
46
  end
@@ -14,7 +14,12 @@ module Administrate
14
14
  include Administrate::GeneratorHelpers
15
15
  source_root File.expand_path("../templates", __FILE__)
16
16
 
17
- class_option :namespace, type: :string, default: "admin"
17
+ class_option(
18
+ :namespace,
19
+ type: :string,
20
+ desc: "Namespace where the admin dashboards will live",
21
+ default: "admin",
22
+ )
18
23
 
19
24
  def run_routes_generator
20
25
  if dashboard_resources.none?
@@ -7,13 +7,19 @@ end
7
7
  require "rails/generators/base"
8
8
  require "administrate/generator_helpers"
9
9
  require "administrate/namespace"
10
+ require "generators/administrate/test_record"
10
11
 
11
12
  module Administrate
12
13
  module Generators
13
14
  class RoutesGenerator < Rails::Generators::Base
14
15
  include Administrate::GeneratorHelpers
15
16
  source_root File.expand_path("../templates", __FILE__)
16
- class_option :namespace, type: :string, default: "admin"
17
+ class_option(
18
+ :namespace,
19
+ type: :string,
20
+ desc: "Namespace where the admin dashboards live",
21
+ default: "admin",
22
+ )
17
23
 
18
24
  def insert_dashboard_routes
19
25
  if valid_dashboard_models.any?
@@ -55,7 +61,10 @@ module Administrate
55
61
  end
56
62
 
57
63
  def database_models
58
- ActiveRecord::Base.descendants.reject(&:abstract_class?)
64
+ ActiveRecord::Base.descendants.
65
+ reject(&:abstract_class?).
66
+ reject { |k| k < Administrate::Generators::TestRecord }.
67
+ sort_by(&:to_s)
59
68
  end
60
69
 
61
70
  def invalid_dashboard_models
@@ -0,0 +1,21 @@
1
+ module Administrate
2
+ module Generators
3
+ # This class serves only to work around a strange behaviour in Rails 7
4
+ # with Ruby 3.
5
+ #
6
+ # After running the spec for DashboardGenerator, the fake models that
7
+ # it generates (eg: Foo, Shipment) linger around despite being removed
8
+ # explicitly. This causes RouteGenerator to take them into
9
+ # account and generate routes for them, which its spec doesn't expect,
10
+ # causing a spec failure.
11
+ #
12
+ # To avoid this, the spec for DashboardGenerator defines its fake models
13
+ # as children of TestRecord. Then RoutesGenerator explicitly filters
14
+ # child classes of TestRecord when figuring out what models exist.
15
+ #
16
+ # Discussion at https://github.com/thoughtbot/administrate/pull/2324
17
+ class TestRecord < ApplicationRecord
18
+ self.abstract_class = true
19
+ end
20
+ end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: administrate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Charlton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-02-02 00:00:00.000000000 Z
12
+ date: 2024-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -17,98 +17,88 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '5.0'
20
+ version: '6.0'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '8.0'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
28
  - - ">="
26
29
  - !ruby/object:Gem::Version
27
- version: '5.0'
30
+ version: '6.0'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '8.0'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: actionview
30
36
  requirement: !ruby/object:Gem::Requirement
31
37
  requirements:
32
38
  - - ">="
33
39
  - !ruby/object:Gem::Version
34
- version: '5.0'
40
+ version: '6.0'
41
+ - - "<"
42
+ - !ruby/object:Gem::Version
43
+ version: '8.0'
35
44
  type: :runtime
36
45
  prerelease: false
37
46
  version_requirements: !ruby/object:Gem::Requirement
38
47
  requirements:
39
48
  - - ">="
40
49
  - !ruby/object:Gem::Version
41
- version: '5.0'
50
+ version: '6.0'
51
+ - - "<"
52
+ - !ruby/object:Gem::Version
53
+ version: '8.0'
42
54
  - !ruby/object:Gem::Dependency
43
55
  name: activerecord
44
56
  requirement: !ruby/object:Gem::Requirement
45
57
  requirements:
46
58
  - - ">="
47
59
  - !ruby/object:Gem::Version
48
- version: '5.0'
60
+ version: '6.0'
61
+ - - "<"
62
+ - !ruby/object:Gem::Version
63
+ version: '8.0'
49
64
  type: :runtime
50
65
  prerelease: false
51
66
  version_requirements: !ruby/object:Gem::Requirement
52
67
  requirements:
53
68
  - - ">="
54
69
  - !ruby/object:Gem::Version
55
- version: '5.0'
56
- - !ruby/object:Gem::Dependency
57
- name: datetime_picker_rails
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: 0.0.7
63
- type: :runtime
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
70
+ version: '6.0'
71
+ - - "<"
68
72
  - !ruby/object:Gem::Version
69
- version: 0.0.7
73
+ version: '8.0'
70
74
  - !ruby/object:Gem::Dependency
71
75
  name: jquery-rails
72
76
  requirement: !ruby/object:Gem::Requirement
73
77
  requirements:
74
- - - ">="
78
+ - - "~>"
75
79
  - !ruby/object:Gem::Version
76
- version: '4.0'
80
+ version: 4.6.0
77
81
  type: :runtime
78
82
  prerelease: false
79
83
  version_requirements: !ruby/object:Gem::Requirement
80
84
  requirements:
81
- - - ">="
85
+ - - "~>"
82
86
  - !ruby/object:Gem::Version
83
- version: '4.0'
87
+ version: 4.6.0
84
88
  - !ruby/object:Gem::Dependency
85
89
  name: kaminari
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: '1.0'
91
- type: :runtime
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: '1.0'
98
- - !ruby/object:Gem::Dependency
99
- name: momentjs-rails
100
90
  requirement: !ruby/object:Gem::Requirement
101
91
  requirements:
102
92
  - - "~>"
103
93
  - !ruby/object:Gem::Version
104
- version: '2.8'
94
+ version: 1.2.2
105
95
  type: :runtime
106
96
  prerelease: false
107
97
  version_requirements: !ruby/object:Gem::Requirement
108
98
  requirements:
109
99
  - - "~>"
110
100
  - !ruby/object:Gem::Version
111
- version: '2.8'
101
+ version: 1.2.2
112
102
  - !ruby/object:Gem::Dependency
113
103
  name: sassc-rails
114
104
  requirement: !ruby/object:Gem::Requirement
@@ -160,7 +150,7 @@ files:
160
150
  - Rakefile
161
151
  - app/assets/javascripts/administrate/application.js
162
152
  - app/assets/javascripts/administrate/components/associative.js
163
- - app/assets/javascripts/administrate/components/date_time_picker.js
153
+ - app/assets/javascripts/administrate/components/select.js
164
154
  - app/assets/javascripts/administrate/components/table.js
165
155
  - app/assets/stylesheets/administrate/application.scss
166
156
  - app/assets/stylesheets/administrate/base/_forms.scss
@@ -197,6 +187,7 @@ files:
197
187
  - app/views/administrate/application/_index_header.html.erb
198
188
  - app/views/administrate/application/_javascript.html.erb
199
189
  - app/views/administrate/application/_navigation.html.erb
190
+ - app/views/administrate/application/_pagination.html.erb
200
191
  - app/views/administrate/application/_search.html.erb
201
192
  - app/views/administrate/application/_stylesheet.html.erb
202
193
  - app/views/administrate/application/edit.html.erb
@@ -249,7 +240,6 @@ files:
249
240
  - app/views/fields/url/_index.html.erb
250
241
  - app/views/fields/url/_show.html.erb
251
242
  - app/views/layouts/administrate/application.html.erb
252
- - config/i18n-tasks.yml
253
243
  - config/locales/administrate.ar.yml
254
244
  - config/locales/administrate.bs.yml
255
245
  - config/locales/administrate.ca.yml
@@ -268,6 +258,7 @@ files:
268
258
  - config/locales/administrate.pt-BR.yml
269
259
  - config/locales/administrate.pt.yml
270
260
  - config/locales/administrate.ru.yml
261
+ - config/locales/administrate.sl.yml
271
262
  - config/locales/administrate.sq.yml
272
263
  - config/locales/administrate.sv.yml
273
264
  - config/locales/administrate.tr.yml
@@ -275,8 +266,6 @@ files:
275
266
  - config/locales/administrate.vi.yml
276
267
  - config/locales/administrate.zh-CN.yml
277
268
  - config/locales/administrate.zh-TW.yml
278
- - config/routes.rb
279
- - config/unicorn.rb
280
269
  - docs/adding_controllers_without_related_model.md
281
270
  - docs/adding_custom_field_types.md
282
271
  - docs/authentication.md
@@ -288,7 +277,9 @@ files:
288
277
  - docs/extending_administrate.md
289
278
  - docs/getting_started.md
290
279
  - docs/guides.md
280
+ - docs/guides/customising_search.md
291
281
  - docs/guides/hiding_dashboards_from_sidebar.md
282
+ - docs/guides/scoping_has_many_relations.md
292
283
  - docs/rails_api.md
293
284
  - lib/administrate.rb
294
285
  - lib/administrate/base_dashboard.rb
@@ -315,6 +306,7 @@ files:
315
306
  - lib/administrate/generator_helpers.rb
316
307
  - lib/administrate/namespace.rb
317
308
  - lib/administrate/namespace/resource.rb
309
+ - lib/administrate/not_authorized_error.rb
318
310
  - lib/administrate/order.rb
319
311
  - lib/administrate/page.rb
320
312
  - lib/administrate/page/base.rb
@@ -341,6 +333,7 @@ files:
341
333
  - lib/generators/administrate/install/templates/application_controller.rb.erb
342
334
  - lib/generators/administrate/routes/routes_generator.rb
343
335
  - lib/generators/administrate/routes/templates/routes.rb.erb
336
+ - lib/generators/administrate/test_record.rb
344
337
  - lib/generators/administrate/views/edit_generator.rb
345
338
  - lib/generators/administrate/views/field_generator.rb
346
339
  - lib/generators/administrate/views/form_generator.rb
@@ -370,7 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
370
363
  - !ruby/object:Gem::Version
371
364
  version: '0'
372
365
  requirements: []
373
- rubygems_version: 3.1.6
366
+ rubygems_version: 3.4.20
374
367
  signing_key:
375
368
  specification_version: 4
376
369
  summary: A Rails engine for creating super-flexible admin dashboards
@@ -1,14 +0,0 @@
1
- $(function () {
2
- $('[data-type="time"]').datetimepicker({
3
- debug: false,
4
- format: 'HH:mm:ss',
5
- });
6
- $('[data-type="datetime"]').datetimepicker({
7
- debug: false,
8
- format: 'YYYY-MM-DD HH:mm:ss',
9
- });
10
- $('[data-type="date"]').datetimepicker({
11
- debug: false,
12
- format: 'YYYY-MM-DD',
13
- });
14
- });
@@ -1,18 +0,0 @@
1
- search:
2
- paths:
3
- - "app/controllers"
4
- - "app/helpers"
5
- - "app/pages"
6
- - "app/views"
7
-
8
- data:
9
- read:
10
- - config/locales/administrate.%{locale}.yml
11
-
12
- ignore_unused:
13
- - activerecord.*
14
- - administrate.*
15
- - date.*
16
- - simple_form.*
17
- - time.*
18
- - titles.*
data/config/routes.rb DELETED
@@ -1,2 +0,0 @@
1
- Administrate::Engine.routes.draw do
2
- end