administrate 1.0.0.beta1 → 1.0.0.beta2
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 +4 -4
- data/app/assets/builds/administrate/application.css +609 -27
- data/app/assets/builds/administrate/application.css.map +1 -1
- data/app/assets/builds/administrate/application.js +16295 -2236
- data/app/assets/builds/administrate/application.js.map +4 -4
- data/app/assets/builds/administrate-internal/docs.css.map +1 -1
- data/app/assets/javascripts/administrate/application.js +4 -4
- data/app/assets/javascripts/administrate/controllers/application.js +9 -0
- data/app/assets/javascripts/administrate/controllers/index.js +7 -0
- data/app/assets/javascripts/administrate/controllers/select_controller.js +8 -0
- data/app/assets/javascripts/administrate/{components/table.js → controllers/table_controller.js} +9 -9
- data/app/assets/stylesheets/administrate/application.scss +1 -2
- data/app/assets/stylesheets/administrate/base/_layout.scss +5 -0
- data/app/assets/stylesheets/administrate/base/_typography.scss +12 -1
- data/app/assets/stylesheets/administrate/components/_buttons.scss +12 -10
- data/app/assets/stylesheets/administrate/components/_field-unit.scss +2 -3
- data/app/assets/stylesheets/administrate/reset/_normalize.scss +7 -1
- data/app/controllers/administrate/application_controller.rb +3 -2
- data/app/views/administrate/application/_collection.html.erb +1 -1
- data/app/views/administrate/application/_collection_item_actions.html.erb +3 -3
- data/app/views/administrate/application/_index_header.html.erb +4 -0
- data/app/views/administrate/application/_javascript.html.erb +1 -1
- data/app/views/administrate/application/edit.html.erb +15 -3
- data/app/views/administrate/application/index.html.erb +19 -11
- data/app/views/administrate/application/new.html.erb +15 -3
- data/app/views/administrate/application/show.html.erb +35 -23
- data/app/views/fields/belongs_to/_form.html.erb +3 -2
- data/app/views/fields/has_many/_form.html.erb +1 -1
- data/app/views/fields/polymorphic/_form.html.erb +1 -1
- data/app/views/fields/rich_text/_form.html.erb +6 -0
- data/app/views/fields/rich_text/_index.html.erb +18 -0
- data/app/views/fields/rich_text/_show.html.erb +18 -0
- data/app/views/fields/select/_form.html.erb +2 -1
- data/app/views/fields/text/_form.html.erb +1 -1
- data/app/views/layouts/administrate/application.html.erb +1 -2
- data/docs/customizing_dashboards.md +138 -4
- data/docs/customizing_page_views.md +25 -0
- data/lib/administrate/base_dashboard.rb +1 -0
- data/lib/administrate/engine.rb +6 -0
- data/lib/administrate/field/associative.rb +4 -0
- data/lib/administrate/field/base.rb +19 -1
- data/lib/administrate/field/belongs_to.rb +6 -1
- data/lib/administrate/field/deferred.rb +9 -1
- data/lib/administrate/field/has_one.rb +4 -0
- data/lib/administrate/field/rich_text.rb +21 -0
- data/lib/administrate/field/select.rb +4 -0
- data/lib/administrate/order.rb +25 -21
- data/lib/administrate/page/base.rb +1 -6
- data/lib/administrate/version.rb +1 -1
- data/lib/generators/administrate/dashboard/dashboard_generator.rb +5 -2
- data/lib/generators/administrate/views/index_generator.rb +1 -0
- data/lib/generators/administrate/views/layout_generator.rb +1 -1
- metadata +13 -12
- data/app/assets/javascripts/administrate/components/associative.js +0 -5
- data/app/assets/javascripts/administrate/components/select.js +0 -3
- data/app/assets/stylesheets/administrate/utilities/_text-color.scss +0 -3
- data/lib/generators/administrate/assets/assets_generator.rb +0 -12
- data/lib/generators/administrate/assets/javascripts_generator.rb +0 -17
- data/lib/generators/administrate/assets/stylesheets_generator.rb +0 -17
@@ -82,7 +82,8 @@ the table views and in the dropdown menu on the record forms.
|
|
82
82
|
You can set multiple columns as well with direction. E.g.: `"name, email DESC"`.
|
83
83
|
|
84
84
|
`:scope` - Specifies a custom scope inside a callable. Useful for preloading.
|
85
|
-
Example: `.with_options(scope: -> { MyModel.includes(:rel).limit(5) })`
|
85
|
+
Example #1: `.with_options(scope: -> { MyModel.includes(:rel).limit(5) })`
|
86
|
+
Example #2: `.with_options(scope: -> (field) { field.resource.my_models.includes(:rel).limit(5) })`
|
86
87
|
|
87
88
|
`:include_blank` - Specifies if the select element to be rendered should include
|
88
89
|
blank option. Default is `true`.
|
@@ -113,7 +114,7 @@ association `belongs_to :country`, from your model.
|
|
113
114
|
|
114
115
|
**Field::HasMany**
|
115
116
|
|
116
|
-
`:collection_attributes` - Set the columns to display in the show view.
|
117
|
+
`:collection_attributes` - Set the columns to display in the show view.
|
117
118
|
Default is COLLECTION_ATTRIBUTES in dashboard.
|
118
119
|
|
119
120
|
`:limit` - The number of resources (paginated) to display in the show view. To disable pagination,
|
@@ -144,14 +145,14 @@ Default is `false`.
|
|
144
145
|
For example:
|
145
146
|
|
146
147
|
```ruby
|
147
|
-
|
148
|
+
city: Field::HasOne.with_options(
|
148
149
|
searchable: true,
|
149
150
|
searchable_fields: ['name'],
|
150
151
|
)
|
151
152
|
```
|
152
153
|
|
153
154
|
with this, you will be able to search through the column `name` from the
|
154
|
-
association `
|
155
|
+
association `has_one :city`, from your model.
|
155
156
|
|
156
157
|
`:class_name` (deprecated) - Specifies the name of the associated class.
|
157
158
|
|
@@ -266,6 +267,9 @@ Default is `false`.
|
|
266
267
|
`:truncate` - Set the number of characters to display in the index view.
|
267
268
|
Defaults to `50`.
|
268
269
|
|
270
|
+
`:input_options` - Options to customize the text area in form view.
|
271
|
+
Example: `.with_options(input_options: { rows: 20 })`
|
272
|
+
|
269
273
|
**Field::Url**
|
270
274
|
|
271
275
|
`:searchable` - Specify if the attribute should be considered when searching.
|
@@ -436,3 +440,133 @@ en:
|
|
436
440
|
```
|
437
441
|
|
438
442
|
If not defined (see `SHOW_PAGE_ATTRIBUTES` above), Administrate will default to the given strings.
|
443
|
+
|
444
|
+
## Virtual Attributes
|
445
|
+
|
446
|
+
For all field types, you can use the `getter` option to change where the data is retrieved from or to set the data directly.
|
447
|
+
|
448
|
+
By using this, you can define an attribute in `ATTRIBUTE_TYPES` that doesn’t exist in the model, and use it for various purposes.
|
449
|
+
|
450
|
+
### Attribute Aliases
|
451
|
+
|
452
|
+
You can create an alias for an attribute. For example:
|
453
|
+
|
454
|
+
```ruby
|
455
|
+
ATTRIBUTE_TYPES = {
|
456
|
+
shipped_at: Field::DateTime,
|
457
|
+
shipped_on: Field::Date.with_options(
|
458
|
+
getter: :shipped_at
|
459
|
+
)
|
460
|
+
}
|
461
|
+
COLLECTION_ATTRIBUTES = [
|
462
|
+
:shipped_on
|
463
|
+
}
|
464
|
+
SHOW_PAGE_ATTRIBUTES = [
|
465
|
+
:shipped_at
|
466
|
+
}
|
467
|
+
```
|
468
|
+
|
469
|
+
In this example, a virtual attribute `shipped_on` based on the value of `shipped_at` is defined as a `Date` type and used for display on the index page (this can help save table cell space).
|
470
|
+
|
471
|
+
### Decorated Attributes
|
472
|
+
|
473
|
+
You can also use this to decorate data. For example:
|
474
|
+
|
475
|
+
```ruby
|
476
|
+
ATTRIBUTE_TYPES = {
|
477
|
+
price: Field::Number,
|
478
|
+
price_including_tax: Field::Number.with_options(
|
479
|
+
getter: -> (field) {
|
480
|
+
field.resource.price * 1.1 if field.resource.price.present?
|
481
|
+
}
|
482
|
+
)
|
483
|
+
}
|
484
|
+
```
|
485
|
+
|
486
|
+
### Composite Attributes
|
487
|
+
|
488
|
+
You can dynamically create a virtual attribute by combining multiple attributes for display. For example:
|
489
|
+
|
490
|
+
```ruby
|
491
|
+
ATTRIBUTE_TYPES = {
|
492
|
+
first_name: Field::String,
|
493
|
+
last_name: Field::String,
|
494
|
+
full_name: Field::String.with_options(
|
495
|
+
getter: -> (field) {
|
496
|
+
[
|
497
|
+
field.resource.first_name,
|
498
|
+
field.resource.last_name
|
499
|
+
].compact_blank.join(' ')
|
500
|
+
}
|
501
|
+
)
|
502
|
+
}
|
503
|
+
```
|
504
|
+
|
505
|
+
## Virtual Fields
|
506
|
+
|
507
|
+
Custom fields can also be defined using virtual fields.
|
508
|
+
|
509
|
+
```ruby
|
510
|
+
ATTRIBUTE_TYPES = {
|
511
|
+
id: Field::Number,
|
512
|
+
receipt: Field::ReceiptLink
|
513
|
+
}
|
514
|
+
```
|
515
|
+
|
516
|
+
```ruby
|
517
|
+
module Administrate
|
518
|
+
module Field
|
519
|
+
class ReceiptLink < Base
|
520
|
+
def data
|
521
|
+
resource.id
|
522
|
+
end
|
523
|
+
|
524
|
+
def filename
|
525
|
+
"receipt-#{data}.pdf"
|
526
|
+
end
|
527
|
+
|
528
|
+
def url
|
529
|
+
"/files/receipts/#{filename}"
|
530
|
+
end
|
531
|
+
end
|
532
|
+
end
|
533
|
+
end
|
534
|
+
```
|
535
|
+
|
536
|
+
```erb
|
537
|
+
<%= link_to field.filename, field.url %>
|
538
|
+
```
|
539
|
+
|
540
|
+
### Custom Actions via Virtual Field
|
541
|
+
|
542
|
+
By creating custom fields that are not dependent on specific attributes, you can insert custom views into any screen.
|
543
|
+
For example, you can add custom buttons like this:
|
544
|
+
|
545
|
+
```ruby
|
546
|
+
ATTRIBUTE_TYPES = {
|
547
|
+
id: Field::Number,
|
548
|
+
custom_index_actions: Field::CustomActionButtons,
|
549
|
+
custom_show_actions: Field::CustomActionButtons,
|
550
|
+
}
|
551
|
+
```
|
552
|
+
|
553
|
+
```ruby
|
554
|
+
module Administrate
|
555
|
+
module Field
|
556
|
+
class CustomActionButtons < Base
|
557
|
+
def data
|
558
|
+
resource.id
|
559
|
+
end
|
560
|
+
end
|
561
|
+
end
|
562
|
+
end
|
563
|
+
```
|
564
|
+
|
565
|
+
```erb
|
566
|
+
<%# app/views/fields/custom_action_buttons/_index.html.erb %>
|
567
|
+
<% if field.data.present? %>
|
568
|
+
<%= button_to "some action 1", [:some_action_1, namespace, field.resource] %>
|
569
|
+
<%= button_to "some action 2", [:some_action_2, namespace, field.resource] %>
|
570
|
+
<%= button_to "some action 3", [:some_action_3, namespace, field.resource] %>
|
571
|
+
<% end %>
|
572
|
+
```
|
@@ -94,3 +94,28 @@ rails generate administrate:views:layout
|
|
94
94
|
# It only generates the sidebar partial
|
95
95
|
# -> app/views/admin/application/_navigation.html.erb
|
96
96
|
```
|
97
|
+
|
98
|
+
## Customizing for a specific layout
|
99
|
+
|
100
|
+
You can use several hook points to add elements to specific layouts or specific pages:
|
101
|
+
|
102
|
+
* header_middle
|
103
|
+
* header_last
|
104
|
+
* before_main
|
105
|
+
* main
|
106
|
+
* after_main
|
107
|
+
|
108
|
+
For example, you can add a button in the middle of the header as follows:
|
109
|
+
|
110
|
+
```eruby
|
111
|
+
<%# app/views/admin/customers/_index_header.html.erb %>
|
112
|
+
|
113
|
+
<% content_for(:header_middle) do %>
|
114
|
+
<div>
|
115
|
+
You are logged in as <em><%= pundit_user.name %></em>.
|
116
|
+
<%= link_to("Become the Admin", become_admin_customer_path("admin")) unless pundit_user.admin? %>
|
117
|
+
</div>
|
118
|
+
<% end %>
|
119
|
+
|
120
|
+
<%= render template: 'administrate/application/_index_header', locals: local_assigns %>
|
121
|
+
```
|
@@ -7,6 +7,7 @@ require "administrate/field/has_many"
|
|
7
7
|
require "administrate/field/has_one"
|
8
8
|
require "administrate/field/number"
|
9
9
|
require "administrate/field/polymorphic"
|
10
|
+
require "administrate/field/rich_text"
|
10
11
|
require "administrate/field/select"
|
11
12
|
require "administrate/field/string"
|
12
13
|
require "administrate/field/text"
|
data/lib/administrate/engine.rb
CHANGED
@@ -24,6 +24,12 @@ module Administrate
|
|
24
24
|
]
|
25
25
|
end
|
26
26
|
|
27
|
+
initializer "administrate.action_text" do
|
28
|
+
ActiveSupport.on_load :action_text_rich_text do
|
29
|
+
require "administrate/field/rich_text"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
27
33
|
def self.add_javascript(script)
|
28
34
|
@@javascripts << script
|
29
35
|
end
|
@@ -34,20 +34,38 @@ module Administrate
|
|
34
34
|
|
35
35
|
def initialize(attribute, data, page, options = {})
|
36
36
|
@attribute = attribute
|
37
|
-
@data = data
|
38
37
|
@page = page
|
39
38
|
@resource = options.delete(:resource)
|
40
39
|
@options = options
|
40
|
+
@data = read_value(data)
|
41
41
|
end
|
42
42
|
|
43
43
|
def html_class
|
44
44
|
self.class.html_class
|
45
45
|
end
|
46
46
|
|
47
|
+
def html_controller
|
48
|
+
nil
|
49
|
+
end
|
50
|
+
|
47
51
|
def name
|
48
52
|
attribute.to_s
|
49
53
|
end
|
50
54
|
|
55
|
+
def read_value(data)
|
56
|
+
if options.key?(:getter)
|
57
|
+
if options[:getter].respond_to?(:call)
|
58
|
+
options[:getter].call(self)
|
59
|
+
else
|
60
|
+
resource.try(options[:getter])
|
61
|
+
end
|
62
|
+
elsif data.nil?
|
63
|
+
resource.try(attribute)
|
64
|
+
else
|
65
|
+
data
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
51
69
|
def to_partial_path
|
52
70
|
"/fields/#{self.class.field_type}/#{page}"
|
53
71
|
end
|
@@ -41,7 +41,12 @@ module Administrate
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def candidate_resources
|
44
|
-
scope =
|
44
|
+
scope =
|
45
|
+
if options[:scope]
|
46
|
+
options[:scope].arity.positive? ? options[:scope].call(self) : options[:scope].call
|
47
|
+
else
|
48
|
+
associated_class.all
|
49
|
+
end
|
45
50
|
|
46
51
|
order = options.delete(:order)
|
47
52
|
order ? scope.reorder(order) : scope
|
@@ -21,6 +21,10 @@ module Administrate
|
|
21
21
|
options == other.options
|
22
22
|
end
|
23
23
|
|
24
|
+
def getter
|
25
|
+
options.fetch(:getter, nil)
|
26
|
+
end
|
27
|
+
|
24
28
|
def associative?
|
25
29
|
deferred_class.associative?
|
26
30
|
end
|
@@ -30,7 +34,11 @@ module Administrate
|
|
30
34
|
end
|
31
35
|
|
32
36
|
def searchable?
|
33
|
-
options.
|
37
|
+
if options.key?(:getter)
|
38
|
+
false
|
39
|
+
else
|
40
|
+
options.fetch(:searchable, deferred_class.searchable?)
|
41
|
+
end
|
34
42
|
end
|
35
43
|
|
36
44
|
def searchable_field
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require "administrate/field/base"
|
2
|
+
|
3
|
+
module Administrate
|
4
|
+
module Field
|
5
|
+
class RichText < Administrate::Field::Base
|
6
|
+
def to_s
|
7
|
+
data&.to_plain_text
|
8
|
+
end
|
9
|
+
|
10
|
+
def truncate
|
11
|
+
to_s.truncate(truncation_length)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def truncation_length
|
17
|
+
options.fetch(:truncate, 50)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/administrate/order.rb
CHANGED
@@ -75,7 +75,7 @@ module Administrate
|
|
75
75
|
|
76
76
|
def order_by_belongs_to(relation)
|
77
77
|
if ordering_by_association_column?(relation)
|
78
|
-
|
78
|
+
order_by_association_attribute(relation)
|
79
79
|
else
|
80
80
|
order_by_id(relation)
|
81
81
|
end
|
@@ -83,26 +83,16 @@ module Administrate
|
|
83
83
|
|
84
84
|
def order_by_has_one(relation)
|
85
85
|
if ordering_by_association_column?(relation)
|
86
|
-
|
86
|
+
order_by_association_attribute(relation)
|
87
87
|
else
|
88
88
|
order_by_association_id(relation)
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
def order_by_attribute(relation)
|
93
|
-
relation.joins(
|
94
|
-
attribute.to_sym
|
95
|
-
).reorder(order_by_attribute_query)
|
96
|
-
end
|
97
|
-
|
98
92
|
def order_by_id(relation)
|
99
93
|
relation.reorder(order_by_id_query(relation))
|
100
94
|
end
|
101
95
|
|
102
|
-
def order_by_association_id(relation)
|
103
|
-
relation.reorder(order_by_association_id_query)
|
104
|
-
end
|
105
|
-
|
106
96
|
def ordering_by_association_column?(relation)
|
107
97
|
association_attribute &&
|
108
98
|
column_exist?(
|
@@ -115,16 +105,26 @@ module Administrate
|
|
115
105
|
end
|
116
106
|
|
117
107
|
def order_by_id_query(relation)
|
118
|
-
relation.arel_table[
|
108
|
+
relation.arel_table[association_foreign_key(relation)].public_send(direction)
|
109
|
+
end
|
110
|
+
|
111
|
+
def order_by_association_id(relation)
|
112
|
+
order_by_association_column(relation, association_primary_key(relation))
|
113
|
+
end
|
114
|
+
|
115
|
+
def order_by_association_attribute(relation)
|
116
|
+
order_by_association_column(relation, association_attribute)
|
119
117
|
end
|
120
118
|
|
121
|
-
def
|
122
|
-
|
119
|
+
def order_by_association_column(relation, column_name)
|
120
|
+
relation.joins(
|
121
|
+
attribute.to_sym
|
122
|
+
).reorder(order_by_association_column_query(relation, column_name))
|
123
123
|
end
|
124
124
|
|
125
|
-
def
|
126
|
-
table = Arel::Table.new(association_table_name)
|
127
|
-
table[
|
125
|
+
def order_by_association_column_query(relation, column)
|
126
|
+
table = Arel::Table.new(association_table_name(relation))
|
127
|
+
table[column].public_send(direction)
|
128
128
|
end
|
129
129
|
|
130
130
|
def relation_type(relation)
|
@@ -135,12 +135,16 @@ module Administrate
|
|
135
135
|
relation.klass.reflect_on_association(attribute.to_s)
|
136
136
|
end
|
137
137
|
|
138
|
-
def
|
138
|
+
def association_foreign_key(relation)
|
139
139
|
reflect_association(relation).foreign_key
|
140
140
|
end
|
141
141
|
|
142
|
-
def
|
143
|
-
|
142
|
+
def association_primary_key(relation)
|
143
|
+
reflect_association(relation).association_primary_key
|
144
|
+
end
|
145
|
+
|
146
|
+
def association_table_name(relation)
|
147
|
+
reflect_association(relation).table_name
|
144
148
|
end
|
145
149
|
end
|
146
150
|
end
|
@@ -30,13 +30,8 @@ module Administrate
|
|
30
30
|
private
|
31
31
|
|
32
32
|
def attribute_field(dashboard, resource, attribute_name, page)
|
33
|
-
value = get_attribute_value(resource, attribute_name)
|
34
33
|
field = dashboard.attribute_type_for(attribute_name)
|
35
|
-
field.new(attribute_name,
|
36
|
-
end
|
37
|
-
|
38
|
-
def get_attribute_value(resource, attribute_name)
|
39
|
-
resource.public_send(attribute_name)
|
34
|
+
field.new(attribute_name, nil, page, resource: resource)
|
40
35
|
end
|
41
36
|
|
42
37
|
attr_reader :dashboard, :options
|
data/lib/administrate/version.rb
CHANGED
@@ -37,15 +37,18 @@ module Administrate
|
|
37
37
|
source_root File.expand_path("../templates", __FILE__)
|
38
38
|
|
39
39
|
def create_dashboard_definition
|
40
|
+
scope = regular_class_path.join("/")
|
41
|
+
|
40
42
|
template(
|
41
43
|
"dashboard.rb.erb",
|
42
|
-
Rails.root.join("app/dashboards/#{file_name}_dashboard.rb")
|
44
|
+
Rails.root.join("app/dashboards/#{scope}/#{file_name}_dashboard.rb")
|
43
45
|
)
|
44
46
|
end
|
45
47
|
|
46
48
|
def create_resource_controller
|
49
|
+
scope = "#{namespace}/#{regular_class_path.join("/")}"
|
47
50
|
destination = Rails.root.join(
|
48
|
-
"app/controllers/#{
|
51
|
+
"app/controllers/#{scope}/#{file_name.pluralize}_controller.rb"
|
49
52
|
)
|
50
53
|
|
51
54
|
template("controller.rb.erb", destination)
|
@@ -9,7 +9,7 @@ module Administrate
|
|
9
9
|
def copy_template
|
10
10
|
copy_file(
|
11
11
|
"../../layouts/administrate/application.html.erb",
|
12
|
-
"app/views/layouts/
|
12
|
+
"app/views/layouts/#{namespace}/application.html.erb"
|
13
13
|
)
|
14
14
|
|
15
15
|
call_generator("administrate:views:navigation")
|
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: 1.0.0.
|
4
|
+
version: 1.0.0.beta2
|
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: 2024-
|
12
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -115,9 +115,10 @@ files:
|
|
115
115
|
- app/assets/config/administrate_manifest.js
|
116
116
|
- app/assets/javascripts/administrate/add_jquery.js
|
117
117
|
- app/assets/javascripts/administrate/application.js
|
118
|
-
- app/assets/javascripts/administrate/
|
119
|
-
- app/assets/javascripts/administrate/
|
120
|
-
- app/assets/javascripts/administrate/
|
118
|
+
- app/assets/javascripts/administrate/controllers/application.js
|
119
|
+
- app/assets/javascripts/administrate/controllers/index.js
|
120
|
+
- app/assets/javascripts/administrate/controllers/select_controller.js
|
121
|
+
- app/assets/javascripts/administrate/controllers/table_controller.js
|
121
122
|
- app/assets/stylesheets/administrate-internal/docs.scss
|
122
123
|
- app/assets/stylesheets/administrate/application.scss
|
123
124
|
- app/assets/stylesheets/administrate/base/_forms.scss
|
@@ -140,7 +141,6 @@ files:
|
|
140
141
|
- app/assets/stylesheets/administrate/library/_data-label.scss
|
141
142
|
- app/assets/stylesheets/administrate/library/_variables.scss
|
142
143
|
- app/assets/stylesheets/administrate/reset/_normalize.scss
|
143
|
-
- app/assets/stylesheets/administrate/utilities/_text-color.scss
|
144
144
|
- app/controllers/administrate/application_controller.rb
|
145
145
|
- app/controllers/concerns/administrate/punditize.rb
|
146
146
|
- app/helpers/administrate/application_helper.rb
|
@@ -190,6 +190,9 @@ files:
|
|
190
190
|
- app/views/fields/polymorphic/_form.html.erb
|
191
191
|
- app/views/fields/polymorphic/_index.html.erb
|
192
192
|
- app/views/fields/polymorphic/_show.html.erb
|
193
|
+
- app/views/fields/rich_text/_form.html.erb
|
194
|
+
- app/views/fields/rich_text/_index.html.erb
|
195
|
+
- app/views/fields/rich_text/_show.html.erb
|
193
196
|
- app/views/fields/select/_form.html.erb
|
194
197
|
- app/views/fields/select/_index.html.erb
|
195
198
|
- app/views/fields/select/_show.html.erb
|
@@ -264,6 +267,7 @@ files:
|
|
264
267
|
- lib/administrate/field/number.rb
|
265
268
|
- lib/administrate/field/password.rb
|
266
269
|
- lib/administrate/field/polymorphic.rb
|
270
|
+
- lib/administrate/field/rich_text.rb
|
267
271
|
- lib/administrate/field/select.rb
|
268
272
|
- lib/administrate/field/string.rb
|
269
273
|
- lib/administrate/field/text.rb
|
@@ -283,9 +287,6 @@ files:
|
|
283
287
|
- lib/administrate/search.rb
|
284
288
|
- lib/administrate/version.rb
|
285
289
|
- lib/administrate/view_generator.rb
|
286
|
-
- lib/generators/administrate/assets/assets_generator.rb
|
287
|
-
- lib/generators/administrate/assets/javascripts_generator.rb
|
288
|
-
- lib/generators/administrate/assets/stylesheets_generator.rb
|
289
290
|
- lib/generators/administrate/dashboard/USAGE
|
290
291
|
- lib/generators/administrate/dashboard/dashboard_generator.rb
|
291
292
|
- lib/generators/administrate/dashboard/templates/controller.rb.erb
|
@@ -325,11 +326,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
325
326
|
version: '0'
|
326
327
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
327
328
|
requirements:
|
328
|
-
- - "
|
329
|
+
- - ">="
|
329
330
|
- !ruby/object:Gem::Version
|
330
|
-
version:
|
331
|
+
version: '0'
|
331
332
|
requirements: []
|
332
|
-
rubygems_version: 3.
|
333
|
+
rubygems_version: 3.5.6
|
333
334
|
signing_key:
|
334
335
|
specification_version: 4
|
335
336
|
summary: A Rails engine for creating super-flexible admin dashboards
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require "administrate/view_generator"
|
2
|
-
|
3
|
-
module Administrate
|
4
|
-
module Generators
|
5
|
-
class AssetsGenerator < Administrate::ViewGenerator
|
6
|
-
def copy_assets
|
7
|
-
call_generator("administrate:assets:javascripts")
|
8
|
-
call_generator("administrate:assets:stylesheets")
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require "rails/generators/base"
|
2
|
-
|
3
|
-
module Administrate
|
4
|
-
module Generators
|
5
|
-
module Assets
|
6
|
-
class JavascriptsGenerator < Rails::Generators::Base
|
7
|
-
JAVASCRIPTS_PATH = "app/assets/javascripts/administrate"
|
8
|
-
|
9
|
-
source_root File.expand_path("../../../../../", __FILE__)
|
10
|
-
|
11
|
-
def copy_javascripts
|
12
|
-
directory JAVASCRIPTS_PATH, JAVASCRIPTS_PATH
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require "rails/generators/base"
|
2
|
-
|
3
|
-
module Administrate
|
4
|
-
module Generators
|
5
|
-
module Assets
|
6
|
-
class StylesheetsGenerator < Rails::Generators::Base
|
7
|
-
STYLESHEETS_PATH = "app/assets/stylesheets/administrate"
|
8
|
-
|
9
|
-
source_root File.expand_path("../../../../../", __FILE__)
|
10
|
-
|
11
|
-
def copy_stylesheets
|
12
|
-
directory STYLESHEETS_PATH, STYLESHEETS_PATH
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|