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.
- checksums.yaml +4 -4
- data/app/assets/builds/administrate/application.css +91 -19
- data/app/assets/builds/administrate/application.css.map +1 -1
- data/app/assets/builds/administrate/application.js +12576 -3114
- data/app/assets/builds/administrate/application.js.map +4 -4
- data/app/assets/builds/administrate-internal/docs.css +25 -12
- data/app/assets/builds/administrate-internal/docs.css.map +1 -1
- data/app/assets/javascripts/administrate/application.js +1 -0
- data/app/assets/javascripts/administrate/controllers/index.js +2 -0
- data/app/assets/javascripts/administrate/controllers/select_controller.js +18 -1
- data/app/assets/javascripts/administrate/controllers/tooltip_controller.js +24 -0
- data/app/assets/javascripts/administrate/vendor/css-anchor-positioning.js +9310 -0
- data/app/assets/stylesheets/administrate/base/_typography.scss +8 -5
- data/app/assets/stylesheets/administrate/components/_buttons.scss +26 -1
- data/app/assets/stylesheets/administrate/components/_cells.scss +8 -1
- data/app/assets/stylesheets/administrate/components/_search.scss +44 -3
- data/app/assets/stylesheets/administrate-internal/docs.scss +25 -23
- data/app/controllers/administrate/application_controller.rb +9 -22
- data/app/controllers/concerns/administrate/punditize.rb +1 -9
- data/app/helpers/administrate/application_helper.rb +9 -1
- data/app/views/administrate/application/_collection.html.erb +29 -19
- data/app/views/administrate/application/_collection_header_actions.html.erb +1 -1
- data/app/views/administrate/application/_collection_item_actions.html.erb +2 -2
- data/app/views/administrate/application/_form.html.erb +1 -1
- data/app/views/administrate/application/_icons.html.erb +14 -6
- data/app/views/administrate/application/_index_header.html.erb +19 -0
- data/app/views/administrate/application/index.html.erb +1 -0
- data/app/views/fields/has_many/_form.html.erb +1 -1
- data/app/views/fields/has_one/_form.html.erb +6 -0
- data/app/views/fields/polymorphic/_form.html.erb +1 -1
- data/docs/customizing_dashboards.md +75 -6
- data/docs/guides/switching_templates_with_view_variants.md +45 -0
- data/docs/guides.md +1 -0
- data/docs/migrating-to-v1.md +34 -0
- data/lib/administrate/base_dashboard.rb +0 -6
- data/lib/administrate/field/associative.rb +2 -21
- data/lib/administrate/field/base.rb +19 -2
- data/lib/administrate/field/belongs_to.rb +1 -6
- data/lib/administrate/field/date.rb +5 -1
- data/lib/administrate/field/date_time.rb +2 -3
- data/lib/administrate/field/deferred.rb +5 -17
- data/lib/administrate/field/has_many.rb +22 -3
- data/lib/administrate/field/has_one.rb +1 -9
- data/lib/administrate/field/password.rb +4 -0
- data/lib/administrate/field/polymorphic.rb +1 -1
- data/lib/administrate/field/time.rb +5 -4
- data/lib/administrate/namespace.rb +10 -10
- data/lib/administrate/order.rb +8 -8
- data/lib/administrate/search.rb +8 -9
- data/lib/administrate/version.rb +1 -1
- data/lib/administrate/view_generator.rb +1 -0
- data/lib/administrate.rb +0 -38
- data/lib/generators/administrate/install/install_generator.rb +1 -0
- data/lib/generators/administrate/routes/routes_generator.rb +1 -0
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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:
|
|
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:
|
|
62
|
-
color:
|
|
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:
|
|
79
|
-
color:
|
|
80
|
+
background-color: var(--code-black);
|
|
81
|
+
color: var(--code-white);
|
|
80
82
|
padding-left: 1rem;
|
|
81
83
|
|
|
82
|
-
.hljs-string { color:
|
|
83
|
-
.hljs-subst { color:
|
|
84
|
-
.hljs-constant { color:
|
|
85
|
-
.hljs-symbol { color:
|
|
86
|
-
.hljs-keyword { color:
|
|
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:
|
|
91
|
+
.hljs-parent { color: var(--code-blue); }
|
|
90
92
|
|
|
91
|
-
.hljs-tag { color:
|
|
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
|
-
|
|
137
|
+
sorting_column: sorting_column(
|
|
145
138
|
dashboard_attribute(sorting_attribute)
|
|
146
139
|
)
|
|
147
140
|
)
|
|
148
141
|
end
|
|
149
142
|
|
|
150
|
-
def
|
|
151
|
-
return unless
|
|
143
|
+
def sorting_column(dashboard_attribute)
|
|
144
|
+
return unless dashboard_attribute.try(:options)
|
|
152
145
|
|
|
153
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
|
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,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
|
-
<%=
|
|
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
|
|
3
|
-
<
|
|
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
|
|
7
|
-
<
|
|
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
|
|
11
|
-
<
|
|
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"><value></span></li>
|
|
32
|
+
<% end %>
|
|
33
|
+
</ul>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<% end %>
|
|
18
37
|
<% end %>
|
|
19
38
|
|
|
20
39
|
<div>
|
|
@@ -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]:
|
|
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>
|