administrate 1.0.0.beta3 → 1.0.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/builds/administrate/application.css +91 -19
  3. data/app/assets/builds/administrate/application.css.map +1 -1
  4. data/app/assets/builds/administrate/application.js +12576 -3114
  5. data/app/assets/builds/administrate/application.js.map +4 -4
  6. data/app/assets/builds/administrate-internal/docs.css +25 -12
  7. data/app/assets/builds/administrate-internal/docs.css.map +1 -1
  8. data/app/assets/javascripts/administrate/application.js +1 -0
  9. data/app/assets/javascripts/administrate/controllers/index.js +2 -0
  10. data/app/assets/javascripts/administrate/controllers/select_controller.js +18 -1
  11. data/app/assets/javascripts/administrate/controllers/tooltip_controller.js +24 -0
  12. data/app/assets/javascripts/administrate/vendor/css-anchor-positioning.js +9310 -0
  13. data/app/assets/stylesheets/administrate/base/_typography.scss +8 -5
  14. data/app/assets/stylesheets/administrate/components/_buttons.scss +26 -1
  15. data/app/assets/stylesheets/administrate/components/_cells.scss +8 -1
  16. data/app/assets/stylesheets/administrate/components/_search.scss +44 -3
  17. data/app/assets/stylesheets/administrate-internal/docs.scss +25 -23
  18. data/app/controllers/administrate/application_controller.rb +9 -22
  19. data/app/controllers/concerns/administrate/punditize.rb +1 -9
  20. data/app/helpers/administrate/application_helper.rb +9 -1
  21. data/app/views/administrate/application/_collection.html.erb +29 -19
  22. data/app/views/administrate/application/_collection_header_actions.html.erb +1 -1
  23. data/app/views/administrate/application/_collection_item_actions.html.erb +2 -2
  24. data/app/views/administrate/application/_form.html.erb +1 -1
  25. data/app/views/administrate/application/_icons.html.erb +14 -6
  26. data/app/views/administrate/application/_index_header.html.erb +19 -0
  27. data/app/views/administrate/application/index.html.erb +1 -0
  28. data/app/views/fields/has_many/_form.html.erb +1 -1
  29. data/app/views/fields/has_one/_form.html.erb +6 -0
  30. data/app/views/fields/polymorphic/_form.html.erb +1 -1
  31. data/docs/customizing_dashboards.md +75 -6
  32. data/docs/guides/switching_templates_with_view_variants.md +45 -0
  33. data/docs/guides.md +1 -0
  34. data/docs/migrating-to-v1.md +34 -0
  35. data/lib/administrate/base_dashboard.rb +0 -6
  36. data/lib/administrate/field/associative.rb +2 -21
  37. data/lib/administrate/field/base.rb +19 -2
  38. data/lib/administrate/field/belongs_to.rb +1 -6
  39. data/lib/administrate/field/date.rb +5 -1
  40. data/lib/administrate/field/date_time.rb +2 -3
  41. data/lib/administrate/field/deferred.rb +5 -17
  42. data/lib/administrate/field/has_many.rb +22 -3
  43. data/lib/administrate/field/has_one.rb +1 -9
  44. data/lib/administrate/field/password.rb +4 -0
  45. data/lib/administrate/field/polymorphic.rb +1 -1
  46. data/lib/administrate/field/time.rb +5 -4
  47. data/lib/administrate/namespace.rb +10 -10
  48. data/lib/administrate/order.rb +8 -8
  49. data/lib/administrate/search.rb +8 -9
  50. data/lib/administrate/version.rb +1 -1
  51. data/lib/administrate/view_generator.rb +1 -0
  52. data/lib/administrate.rb +0 -38
  53. data/lib/generators/administrate/install/install_generator.rb +1 -0
  54. data/lib/generators/administrate/routes/routes_generator.rb +1 -0
  55. metadata +12 -20
@@ -32,11 +32,6 @@ a,
32
32
  text-decoration-skip-ink: auto;
33
33
  transition: color $base-duration $base-timing;
34
34
 
35
- /* stylelint-disable selector-no-qualifying-type */
36
- &.link--danger {
37
- color: $red;
38
- }
39
-
40
35
  &:hover {
41
36
  color: mix($black, $action-color, 25%);
42
37
  }
@@ -45,6 +40,14 @@ a,
45
40
  outline: $focus-outline;
46
41
  outline-offset: $focus-outline-offset;
47
42
  }
43
+ /* stylelint-disable selector-no-qualifying-type */
44
+ &.link--danger {
45
+ color: $red;
46
+ }
47
+
48
+ &.link--danger:hover {
49
+ color: mix($black, $red, 20%);
50
+ }
48
51
  }
49
52
 
50
53
  hr {
@@ -42,6 +42,14 @@ button,
42
42
  }
43
43
  }
44
44
 
45
+
46
+ form.button_to { /* stylelint-disable selector-no-qualifying-type, selector-class-pattern */
47
+ .link {
48
+ padding-left: 0;
49
+ padding-right: 0;
50
+ }
51
+ }
52
+
45
53
  .button--alt {
46
54
  background-color: transparent;
47
55
  border: $base-border;
@@ -52,12 +60,29 @@ button,
52
60
  .button--danger {
53
61
  background-color: $red;
54
62
 
55
- &:hover {
63
+ &:not(.link):hover {
56
64
  background-color: mix($black, $red, 20%);
57
65
  color: $white;
58
66
  }
67
+
68
+ &:not(.link):disabled:hover {
69
+ background-color: mix($black, $red, 20%);
70
+ }
59
71
  }
60
72
 
61
73
  .button--nav {
62
74
  margin-bottom: $base-spacing;
63
75
  }
76
+
77
+ .button--tooltip {
78
+ background: none;
79
+ border: none;
80
+ color: inherit;
81
+ cursor: pointer;
82
+ padding: 0;
83
+
84
+ /* stylelint-disable declaration-no-important */
85
+ &:hover {
86
+ background-color: unset !important;
87
+ }
88
+ }
@@ -3,7 +3,7 @@
3
3
  margin-left: 5px;
4
4
 
5
5
  svg {
6
- fill: $hint-grey;
6
+ color: $hint-grey;
7
7
  height: 13px;
8
8
  transition: transform $base-duration $base-timing;
9
9
  width: 13px;
@@ -41,7 +41,14 @@
41
41
  transform: rotate(180deg);
42
42
  }
43
43
 
44
+ .cell-label--action-button {
45
+ white-space: nowrap;
46
+ width: 1rem;
47
+ }
48
+
44
49
  .cell-data--number,
45
50
  .cell-label--number {
46
51
  text-align: right;
52
+ white-space: nowrap;
53
+ width: 1rem;
47
54
  }
@@ -15,7 +15,6 @@ $search-icon-size: 1rem;
15
15
  }
16
16
 
17
17
  .search__eyeglass-icon {
18
- fill: $grey-7;
19
18
  height: $search-icon-size;
20
19
  left: $search-icon-size;
21
20
  position: absolute;
@@ -34,13 +33,55 @@ $search-icon-size: 1rem;
34
33
  }
35
34
 
36
35
  .search__clear-icon {
37
- fill: $grey-5;
36
+ color: $grey-5;
38
37
  height: $search-icon-size;
39
38
  position: absolute;
40
39
  transition: fill $base-duration $base-timing;
41
40
  width: $search-icon-size;
42
41
 
43
42
  &:hover {
44
- fill: $action-color;
43
+ color: $action-color;
45
44
  }
46
45
  }
46
+
47
+ .search__tooltip {
48
+ anchor-name: --tooltip-anchor;
49
+ margin-right: 2rem;
50
+
51
+ svg {
52
+ color: $grey-5;
53
+ height: 24px;
54
+ width: 24px;
55
+
56
+ &:hover {
57
+ color: $action-color;
58
+ }
59
+ }
60
+ }
61
+
62
+ .search__tooltip-popover {
63
+ background-color: $blue;
64
+ border-color: $blue;
65
+ border-radius: $base-border-radius;
66
+ color: $white;
67
+ padding: 2rem;
68
+ width: max-content;
69
+ }
70
+
71
+
72
+ /* We can remove this stylelint disable (and the css-anchor-positioning polyfill)
73
+ when position-anchor becomes widely available */
74
+
75
+ /* stylelint-disable property-no-unknown */
76
+ .search__tooltip-popover-positioning {
77
+ left: anchor(center);
78
+ margin: 1rem;
79
+ position: fixed;
80
+ position-anchor: --tooltip-anchor;
81
+ top: anchor(bottom);
82
+ transform: translateX(-50%);
83
+ }
84
+
85
+ .search__tooltip-popover-value {
86
+ opacity: 0.5;
87
+ }
@@ -1,14 +1,16 @@
1
- $blue: #53adc6;
2
- $red: #cf726e;
3
- $green: #5bc89e;
4
- $white: #f0f0f0;
5
-
6
- $code-black: #202020;
7
- $code-white: #e0e0dc;
8
- $code-green: #b0bf82;
9
- $code-blue: #8fbdcc;
10
- $code-yellow: #f8d29d;
11
- $code-red: #b95c56;
1
+ :root {
2
+ --blue: #53adc6;
3
+ --red: #cf726e;
4
+ --green: #5bc89e;
5
+ --white: #f0f0f0;
6
+
7
+ --code-black: #202020;
8
+ --code-white: #e0e0dc;
9
+ --code-green: #b0bf82;
10
+ --code-blue: #8fbdcc;
11
+ --code-yellow: #f8d29d;
12
+ --code-red: #b95c56;
13
+ }
12
14
 
13
15
  html,
14
16
  body {
@@ -30,7 +32,7 @@ h3 {
30
32
  }
31
33
 
32
34
  a {
33
- color: $blue;
35
+ color: var(--blue);
34
36
  text-decoration: none;
35
37
  }
36
38
 
@@ -58,8 +60,8 @@ a {
58
60
  }
59
61
 
60
62
  .flash-wrapper {
61
- background-color: $red;
62
- color: $white;
63
+ background-color: var(--red);
64
+ color: var(--white);
63
65
  padding: 1em;
64
66
 
65
67
  .flash {
@@ -75,19 +77,19 @@ code {
75
77
  padding: 0.4em 0.2em 0;
76
78
 
77
79
  &.hljs {
78
- background-color: $code-black;
79
- color: $code-white;
80
+ background-color: var(--code-black);
81
+ color: var(--code-white);
80
82
  padding-left: 1rem;
81
83
 
82
- .hljs-string { color: $code-green; }
83
- .hljs-subst { color: $code-white; }
84
- .hljs-constant { color: $code-blue; }
85
- .hljs-symbol { color: $code-red; }
86
- .hljs-keyword { color: $code-yellow; }
84
+ .hljs-string { color: var(--code-green); }
85
+ .hljs-subst { color: var(--code-white); }
86
+ .hljs-constant { color: var(--code-blue); }
87
+ .hljs-symbol { color: var(--code-red); }
88
+ .hljs-keyword { color: var(--code-yellow); }
87
89
 
88
90
  .hljs-title,
89
- .hljs-parent { color: $code-blue; }
91
+ .hljs-parent { color: var(--code-blue); }
90
92
 
91
- .hljs-tag { color: $code-yellow; }
93
+ .hljs-tag { color: var(--code-yellow); }
92
94
  }
93
95
  }
@@ -10,12 +10,14 @@ module Administrate
10
10
  resources = order.apply(resources)
11
11
  resources = paginate_resources(resources)
12
12
  page = Administrate::Page::Collection.new(dashboard, order: order)
13
+ filters = Administrate::Search.new(scoped_resource, dashboard, search_term).valid_filters
13
14
 
14
15
  render locals: {
15
16
  resources: resources,
16
17
  search_term: search_term,
17
18
  page: page,
18
- show_search_bar: show_search_bar?
19
+ show_search_bar: show_search_bar?,
20
+ filters: filters
19
21
  }
20
22
  end
21
23
 
@@ -120,15 +122,6 @@ module Administrate
120
122
  end
121
123
  helper_method :existing_action?
122
124
 
123
- # @deprecated Use {#existing_action} instead. Note that, in
124
- # {#existing_action}, the order of parameters is reversed and
125
- # there is no default value for the `resource` parameter.
126
- def valid_action?(action_name, resource = resource_class)
127
- Administrate.warn_of_deprecated_authorization_method(__method__)
128
- existing_action?(resource, action_name)
129
- end
130
- helper_method :valid_action?
131
-
132
125
  def routes
133
126
  @routes ||= Namespace.new(namespace).routes.to_set
134
127
  end
@@ -141,16 +134,18 @@ module Administrate
141
134
  @order ||= Administrate::Order.new(
142
135
  sorting_attribute,
143
136
  sorting_direction,
144
- association_attribute: order_by_field(
137
+ sorting_column: sorting_column(
145
138
  dashboard_attribute(sorting_attribute)
146
139
  )
147
140
  )
148
141
  end
149
142
 
150
- def order_by_field(dashboard)
151
- return unless dashboard.try(:options)
143
+ def sorting_column(dashboard_attribute)
144
+ return unless dashboard_attribute.try(:options)
152
145
 
153
- dashboard.options.fetch(:order, nil)
146
+ dashboard_attribute.options.fetch(:sorting_column) {
147
+ dashboard_attribute.options.fetch(:order, nil)
148
+ }
154
149
  end
155
150
 
156
151
  def dashboard_attribute(attribute)
@@ -261,14 +256,6 @@ module Administrate
261
256
  end
262
257
  helper_method :authorized_action?
263
258
 
264
- # @deprecated Use {#authorized_action} instead. Note that the order of
265
- # parameters is reversed in {#authorized_action}.
266
- def show_action?(action, resource)
267
- Administrate.warn_of_deprecated_authorization_method(__method__)
268
- authorized_action?(resource, action)
269
- end
270
- helper_method :show_action?
271
-
272
259
  def new_resource(params = {})
273
260
  resource_class.new(params)
274
261
  end
@@ -41,15 +41,7 @@ module Administrate
41
41
  "Invalid #<#{policy_scope_class}> constructor is called")
42
42
  end
43
43
 
44
- if policy_scope.respond_to? :resolve_admin
45
- Administrate.deprecator.warn(
46
- "Pundit policy scope `resolve_admin` method is deprecated. " \
47
- "Please use a namespaced pundit policy instead."
48
- )
49
- policy_scope.resolve_admin
50
- else
51
- policy_scope.resolve
52
- end
44
+ policy_scope.resolve
53
45
  end
54
46
 
55
47
  def pundit_model(record)
@@ -9,7 +9,15 @@ module Administrate
9
9
 
10
10
  def render_field(field, locals = {})
11
11
  locals[:field] = field
12
- render locals: locals, partial: field.to_partial_path
12
+ if (prefix = find_partial_prefix(field))
13
+ render locals: locals, partial: "#{prefix}/#{field.page}"
14
+ end
15
+ end
16
+
17
+ def find_partial_prefix(field)
18
+ field.partial_prefixes.detect do |prefix|
19
+ lookup_context.template_exists?(field.page, [prefix], true)
20
+ end
13
21
  end
14
22
 
15
23
  def requireness(field)
@@ -23,25 +23,35 @@ to display a collection of resources in an HTML table.
23
23
  <tr>
24
24
  <% collection_presenter.attribute_types.each do |attr_name, attr_type| %>
25
25
  <th class="cell-label
26
- cell-label--<%= attr_type.html_class %>
27
- cell-label--<%= collection_presenter.ordered_html_class(attr_name) %>
28
- cell-label--<%= "#{collection_presenter.resource_name}_#{attr_name}" %>"
29
- scope="col"
30
- aria-sort="<%= sort_order(collection_presenter.ordered_html_class(attr_name)) %>">
31
- <%= link_to(sanitized_order_params(page, collection_field_name).merge(
32
- collection_presenter.order_params_for(attr_name, key: collection_field_name)
33
- )) do %>
34
- <%= t(
35
- "helpers.label.#{collection_presenter.resource_name}.#{attr_name}",
36
- default: resource_class.human_attribute_name(attr_name).titleize,
37
- ) %>
38
- <% if collection_presenter.ordered_by?(attr_name) %>
39
- <span class="cell-label__sort-indicator cell-label__sort-indicator--<%= collection_presenter.ordered_html_class(attr_name) %>">
40
- <svg aria-hidden="true">
41
- <use xlink:href="#icon-up-caret" />
42
- </svg>
43
- </span>
26
+ cell-label--<%= attr_type.html_class %>
27
+ cell-label--<%= collection_presenter.ordered_html_class(attr_name) %>
28
+ cell-label--<%= "#{collection_presenter.resource_name}_#{attr_name}" %>"
29
+ scope="col"
30
+ <% if attr_type.sortable? %>
31
+ aria-sort="<%= sort_order(collection_presenter.ordered_html_class(attr_name)) %>"
32
+ <% end %>
33
+ >
34
+ <% if attr_type.sortable? %>
35
+ <%= link_to(params: sanitized_order_params(page, collection_field_name).merge(
36
+ collection_presenter.order_params_for(attr_name, key: collection_field_name)
37
+ )) do %>
38
+ <%= t(
39
+ "helpers.label.#{collection_presenter.resource_name}.#{attr_name}",
40
+ default: resource_class.human_attribute_name(attr_name).titleize,
41
+ ) %>
42
+ <% if collection_presenter.ordered_by?(attr_name) %>
43
+ <span class="cell-label__sort-indicator cell-label__sort-indicator--<%= collection_presenter.ordered_html_class(attr_name) %>">
44
+ <svg aria-hidden="true">
45
+ <use xlink:href="#icon-up-caret" />
46
+ </svg>
47
+ </span>
48
+ <% end %>
44
49
  <% end %>
50
+ <% else %>
51
+ <%= t(
52
+ "helpers.label.#{collection_presenter.resource_name}.#{attr_name}",
53
+ default: resource_class.human_attribute_name(attr_name).titleize,
54
+ ) %>
45
55
  <% end %>
46
56
  </th>
47
57
  <% end %>
@@ -59,7 +69,7 @@ to display a collection of resources in an HTML table.
59
69
  <% resources.each do |resource| %>
60
70
  <tr class="js-table-row"
61
71
  <% if accessible_action?(resource, :show) %>
62
- <%= %(tabindex=0 role=link data-url=#{polymorphic_path([namespace, resource])}) %>
72
+ <%= %(tabindex=0 data-url=#{polymorphic_path([namespace, resource])}) %>
63
73
  <% end %>
64
74
  >
65
75
  <% collection_presenter.attributes_for(resource).each do |attribute| %>
@@ -1,4 +1,4 @@
1
1
  <% [existing_action?(collection_presenter.resource_name, :edit),
2
2
  existing_action?(collection_presenter.resource_name, :destroy)].count(true).times do %>
3
- <th scope="col"></th>
3
+ <th scope="col" class="cell-label--action-button"></th>
4
4
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% if existing_action?(collection_presenter.resource_name, :edit) %>
2
- <td><%= link_to(
2
+ <td class="cell-label--action-button"><%= link_to(
3
3
  t("administrate.actions.edit"),
4
4
  [:edit, namespace, resource],
5
5
  class: "action-edit",
@@ -7,7 +7,7 @@
7
7
  <% end %>
8
8
 
9
9
  <% if existing_action?(collection_presenter.resource_name, :destroy) %>
10
- <td><%= button_to(
10
+ <td class="cell-label--action-button"><%= button_to(
11
11
  t("administrate.actions.destroy"),
12
12
  [namespace, resource],
13
13
  class: "link link--danger",
@@ -14,7 +14,7 @@ and renders all form fields for a resource's editable attributes.
14
14
  [1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Form
15
15
  %>
16
16
 
17
- <%= form_for([namespace, page.resource], html: { class: "form" }) do |f| %>
17
+ <%= form_with(model: page.resource, url: [namespace, page.resource], scope: page.resource, local: true, class: "form") do |f| %>
18
18
  <% if page.resource.errors.any? %>
19
19
  <div id="error_explanation">
20
20
  <h2>
@@ -1,13 +1,21 @@
1
1
  <svg hidden xmlns="http://www.w3.org/2000/svg">
2
- <symbol id="icon-cancel" viewBox="0 0 48 48">
3
- <path fill-rule="evenodd" d="M24 19.757l-8.485-8.485c-.784-.783-2.047-.782-2.827 0l-1.417 1.416c-.777.777-.78 2.046.002 2.827L19.757 24l-8.485 8.485c-.783.784-.782 2.047 0 2.827l1.416 1.417c.777.777 2.046.78 2.827-.002L24 28.243l8.485 8.485c.784.783 2.047.782 2.827 0l1.417-1.416c.777-.777.78-2.046-.002-2.827L28.243 24l8.485-8.485c.783-.784.782-2.047 0-2.827l-1.416-1.417c-.777-.777-2.046-.78-2.827.002L24 19.757zM24 47c12.703 0 23-10.297 23-23S36.703 1 24 1 1 11.297 1 24s10.297 23 23 23z" />
2
+ <symbol id="icon-cancel" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
3
+ <circle cx="12" cy="12" r="10"></circle>
4
+ <line x1="15" y1="9" x2="9" y2="15"></line><line x1="9" y1="9" x2="15" y2="15"></line>
4
5
  </symbol>
5
6
 
6
- <symbol id="icon-eyeglass" viewBox="0 0 48 48">
7
- <path d="M27.885 32.515c-2.864 1.966-6.333 3.116-10.07 3.116C7.976 35.63 0 27.656 0 17.817 0 7.976 7.976 0 17.816 0S35.63 7.976 35.63 17.816c0 3.736-1.15 7.205-3.115 10.07l14.53 14.53c1.278 1.277 1.275 3.352 0 4.628-1.28 1.278-3.353 1.278-4.63 0l-14.53-14.53zm-10.07-3.736c6.056 0 10.964-4.91 10.964-10.964 0-6.055-4.91-10.964-10.964-10.964-6.055 0-10.964 4.91-10.964 10.964 0 6.055 4.91 10.963 10.964 10.963z" />
7
+ <symbol id="icon-eyeglass" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
8
+ <circle cx="11" cy="11" r="8"></circle>
9
+ <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
8
10
  </symbol>
9
11
 
10
- <symbol id="icon-up-caret" viewBox="0 0 48 48">
11
- <path d="M2.988 33.02c-1.66 0-1.943-.81-.618-1.824l20-15.28c.878-.672 2.31-.67 3.188 0l20.075 15.288c1.316 1.003 1.048 1.816-.62 1.816H2.987z" />
12
+ <symbol id="icon-up-caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
13
+ <polyline points="18 15 12 9 6 15"></polyline>
12
14
  </symbol>
15
+
16
+ <symbol id="icon-question-mark" viewBox="0 0 24 24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
17
+ <circle cx="12" cy="12" r="10"></circle>
18
+ <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"></path>
19
+ <line x1="12" y1="17" x2="12.01" y2="17"></line>
20
+ <symbol>
13
21
  </svg>
@@ -15,6 +15,25 @@
15
15
  search_term: search_term,
16
16
  resource_name: display_resource_name(page.resource_name)
17
17
  ) %>
18
+
19
+ <% if filters.any? %>
20
+ <div data-controller="tooltip">
21
+ <button data-tooltip-target="tooltip" popovertarget="search-tooltip" class="button--tooltip search__tooltip">
22
+ <svg role="img">
23
+ <use xlink:href="#icon-question-mark" />
24
+ </svg>
25
+ </button>
26
+
27
+ <div data-tooltip-target="popover" popover id="search-tooltip" role="tooltip" class="search__tooltip-popover search__tooltip-popover-positioning">
28
+ <p><strong>Use filters to refine your search</strong></p>
29
+ <ul>
30
+ <% filters.keys.each do |filter_key| %>
31
+ <li><%= filter_key %>:<span class="search__tooltip-popover-value">&lt;value&gt;</span></li>
32
+ <% end %>
33
+ </ul>
34
+ </div>
35
+ </div>
36
+ <% end %>
18
37
  <% end %>
19
38
 
20
39
  <div>
@@ -29,6 +29,7 @@ It renders the `_table` partial to display details about the resources.
29
29
  search_term: search_term,
30
30
  page: page,
31
31
  show_search_bar: show_search_bar,
32
+ filters: filters,
32
33
  )
33
34
  %>
34
35
 
@@ -16,7 +16,7 @@ and is augmented with [Selectize].
16
16
  Contains helper methods for displaying a collection select box.
17
17
 
18
18
  [1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/HasMany
19
- [Selectize]: http://brianreavis.github.io/selectize.js
19
+ [Selectize]: https://github.com/selectize/selectize.js
20
20
  %>
21
21
 
22
22
  <div class="field-unit__label">
@@ -30,6 +30,12 @@ The form will be rendered as nested_from to parent relationship.
30
30
  <div class="field-unit field-unit--<%= attribute.html_class %>">
31
31
  <%= render_field attribute, f: has_one_f %>
32
32
  </div>
33
+ <% hint_key = "administrate.field_hints.#{field.name}.#{attribute.name}" %>
34
+ <% if I18n.exists?(hint_key) -%>
35
+ <div class="field-unit__hint">
36
+ <%= I18n.t(hint_key) %>
37
+ </div>
38
+ <% end -%>
33
39
  <% end %>
34
40
  </fieldset>
35
41
 
@@ -22,7 +22,7 @@ This partial renders an input element for polymorphic relationships.
22
22
 
23
23
  <div class="field-unit__field">
24
24
  <%= pf.hidden_field(:type, value: field.class.name) %>
25
- <%= pf.select(:value, {}, data: {controller: field.html_controller}) do %>
25
+ <%= pf.select(:value, nil, {}, data: {controller: field.html_controller}) do %>
26
26
  <%= grouped_options_for_select(field.associated_resource_grouped_options, field.selected_global_id, prompt: true) %>
27
27
  <% end %>
28
28
  </div>