administrate 1.0.0.beta1 → 1.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../stylesheets/administrate-internal/docs.scss"],"names":[],"mappings":"AAYA;AAAA;EAEE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;AAAA;AAAA;EAGE;EACA;;;AAGF;EACE,OAhCK;EAiCL;;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;;;AAIJ;EACE,kBA3DI;EA4DJ,OA1DM;EA2DN;;AAEA;EACE;EACA;EACA;;;AAIJ;EACE;EACA;EACA;;AAEA;EACE,kBAxES;EAyET,OAxES;EAyET;;AAEA;EAAe,OA1EN;;AA2ET;EAAc,OA5EL;;AA6ET;EAAiB,OA3ET;;AA4ER;EAAe,OA1ER;;AA2EP;EAAgB,OA5EN;;AA8EV;AAAA;EACe,OAhFP;;AAkFR;EAAY,OAjFF","file":"docs.css"}
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../stylesheets/administrate-internal/docs.scss"],"names":[],"mappings":"AAYA;AAAA;EAEE;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;AAAA;AAAA;EAGE;EACA;;;AAGF;EACE,OAhCK;EAiCL;;;AAGF;EACE;EACA;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEA;EACE;EACA;;AAIJ;EACE;EACA;;;AAIJ;EACE,kBA3DI;EA4DJ,OA1DM;EA2DN;;AAEA;EACE;EACA;EACA;;;AAIJ;EACE;EACA;EACA;;AAEA;EACE,kBAxES;EAyET,OAxES;EAyET;;AAEA;EAAe,OA1EN;;AA2ET;EAAc,OA5EL;;AA6ET;EAAiB,OA3ET;;AA4ER;EAAe,OA1ER;;AA2EP;EAAgB,OA5EN;;AA8EV;AAAA;EACe,OAhFP;;AAkFR;EAAY,OAjFF","file":"docs.css","sourcesContent":["$blue: #53adc6;\n$red: #cf726e;\n$green: #5bc89e;\n$white: #f0f0f0;\n\n$code-black: #202020;\n$code-white: #e0e0dc;\n$code-green: #b0bf82;\n$code-blue: #8fbdcc;\n$code-yellow: #f8d29d;\n$code-red: #b95c56;\n\nhtml,\nbody {\n font-family: 'Lato', serif;\n font-size: 18px;\n line-height: 1.62em;\n margin: 0;\n}\n\nimg {\n max-width: 100%;\n}\n\nh1,\nh2,\nh3 {\n font-family: 'Fjalla One', sans-serif;\n margin-top: 2em;\n}\n\na {\n color: $blue;\n text-decoration: none;\n}\n\n.content {\n margin-bottom: 2em;\n margin-left: auto;\n margin-right: auto;\n margin-top: 2em;\n width: 60em;\n\n .sidebar {\n float: left;\n width: 20em;\n\n &-links {\n list-style: none;\n padding-left: 0;\n }\n }\n\n .main {\n float: right;\n width: 40em;\n }\n}\n\n.flash-wrapper {\n background-color: $red;\n color: $white;\n padding: 1em;\n\n .flash {\n margin-left: auto;\n margin-right: auto;\n width: 40em;\n }\n}\n\ncode {\n font-family: \"Source Code Pro\";\n font-size: 0.8rem;\n padding: 0.4em 0.2em 0;\n\n &.hljs {\n background-color: $code-black;\n color: $code-white;\n padding-left: 1rem;\n\n .hljs-string { color: $code-green; }\n .hljs-subst { color: $code-white; }\n .hljs-constant { color: $code-blue; }\n .hljs-symbol { color: $code-red; }\n .hljs-keyword { color: $code-yellow; }\n\n .hljs-title,\n .hljs-parent { color: $code-blue; }\n\n .hljs-tag { color: $code-yellow; }\n }\n}\n"]}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import "./add_jquery";
|
2
|
+
import "trix";
|
3
|
+
import "@rails/actiontext";
|
2
4
|
|
3
|
-
import
|
5
|
+
import "@hotwired/turbo-rails";
|
4
6
|
import "selectize/dist/js/selectize.min.js";
|
5
7
|
|
6
|
-
import "./
|
7
|
-
import "./components/select";
|
8
|
-
import "./components/table";
|
8
|
+
import "./controllers";
|
data/app/assets/javascripts/administrate/{components/table.js → controllers/table_controller.js}
RENAMED
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import { Controller } from "@hotwired/stimulus";
|
2
|
+
import $ from "jquery";
|
3
3
|
|
4
|
-
|
4
|
+
var keycodes = { space: 32, enter: 13 };
|
5
|
+
|
6
|
+
export default class extends Controller {
|
7
|
+
visitDataUrl(event) {
|
5
8
|
if (event.type == "click" ||
|
6
9
|
event.keyCode == keycodes.space ||
|
7
10
|
event.keyCode == keycodes.enter) {
|
@@ -13,11 +16,8 @@ $(function() {
|
|
13
16
|
var dataUrl = $(event.target).closest("tr").data("url");
|
14
17
|
var selection = window.getSelection().toString();
|
15
18
|
if (selection.length === 0 && dataUrl) {
|
16
|
-
|
19
|
+
Turbo.visit(dataUrl);
|
17
20
|
}
|
18
21
|
}
|
19
|
-
}
|
20
|
-
|
21
|
-
$("table").on("click", ".js-table-row", visitDataUrl);
|
22
|
-
$("table").on("keydown", ".js-table-row", visitDataUrl);
|
23
|
-
});
|
22
|
+
}
|
23
|
+
};
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
@import "reset/normalize";
|
4
4
|
|
5
|
+
@import "trix/dist/trix";
|
5
6
|
@import "selectize/dist/css/selectize";
|
6
7
|
@import "selectize/dist/css/selectize.default";
|
7
8
|
|
@@ -26,5 +27,3 @@
|
|
26
27
|
@import "components/navigation";
|
27
28
|
@import "components/pagination";
|
28
29
|
@import "components/search";
|
29
|
-
|
30
|
-
@import "utilities/text-color";
|
@@ -21,11 +21,22 @@ p {
|
|
21
21
|
margin: 0 0 $small-spacing;
|
22
22
|
}
|
23
23
|
|
24
|
-
a
|
24
|
+
a,
|
25
|
+
.link:is(
|
26
|
+
button,
|
27
|
+
[type="button"],
|
28
|
+
[type="reset"],
|
29
|
+
[type="submit"]
|
30
|
+
) {
|
25
31
|
color: $action-color;
|
26
32
|
text-decoration-skip-ink: auto;
|
27
33
|
transition: color $base-duration $base-timing;
|
28
34
|
|
35
|
+
/* stylelint-disable selector-no-qualifying-type */
|
36
|
+
&.link--danger {
|
37
|
+
color: $red;
|
38
|
+
}
|
39
|
+
|
29
40
|
&:hover {
|
30
41
|
color: mix($black, $action-color, 25%);
|
31
42
|
}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
button,
|
2
|
-
|
2
|
+
[type="button"],
|
3
|
+
[type="reset"],
|
4
|
+
[type="submit"],
|
3
5
|
.button {
|
4
6
|
appearance: none;
|
5
7
|
background-color: $action-color;
|
@@ -20,23 +22,23 @@ input,
|
|
20
22
|
vertical-align: middle;
|
21
23
|
white-space: nowrap;
|
22
24
|
|
23
|
-
&:
|
25
|
+
&:disabled {
|
26
|
+
cursor: not-allowed;
|
27
|
+
opacity: 0.5;
|
28
|
+
}
|
29
|
+
|
30
|
+
&:not(.link):hover {
|
24
31
|
background-color: mix($black, $action-color, 20%);
|
25
32
|
color: $white;
|
26
33
|
}
|
27
34
|
|
28
|
-
&:focus {
|
35
|
+
&:not(.link):focus {
|
29
36
|
outline: $focus-outline;
|
30
37
|
outline-offset: $focus-outline-offset;
|
31
38
|
}
|
32
39
|
|
33
|
-
&:disabled {
|
34
|
-
|
35
|
-
opacity: 0.5;
|
36
|
-
|
37
|
-
&:hover {
|
38
|
-
background-color: $action-color;
|
39
|
-
}
|
40
|
+
&:not(.link):disabled:hover {
|
41
|
+
background-color: $action-color;
|
40
42
|
}
|
41
43
|
}
|
42
44
|
|
@@ -17,10 +17,9 @@
|
|
17
17
|
}
|
18
18
|
|
19
19
|
.field-unit__field {
|
20
|
+
flex-grow: 1;
|
20
21
|
float: left;
|
21
22
|
margin-left: 2rem;
|
22
|
-
max-width: 50rem;
|
23
|
-
width: 100%;
|
24
23
|
|
25
24
|
.optgroup-header {
|
26
25
|
font-weight: $bold-font-weight;
|
@@ -41,7 +40,7 @@
|
|
41
40
|
width: 100%;
|
42
41
|
|
43
42
|
.field-unit__field {
|
44
|
-
|
43
|
+
flex-grow: 1;
|
45
44
|
}
|
46
45
|
|
47
46
|
.field-unit__label {
|
@@ -100,7 +100,13 @@ pre {
|
|
100
100
|
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
|
101
101
|
*/
|
102
102
|
|
103
|
-
a
|
103
|
+
a,
|
104
|
+
.link:is(
|
105
|
+
button,
|
106
|
+
[type="button"],
|
107
|
+
[type="reset"],
|
108
|
+
[type="submit"]
|
109
|
+
) {
|
104
110
|
background-color: transparent; /* 1 */
|
105
111
|
-webkit-text-decoration-skip: objects; /* 2 */
|
106
112
|
}
|
@@ -60,7 +60,8 @@ module Administrate
|
|
60
60
|
if requested_resource.update(resource_params)
|
61
61
|
redirect_to(
|
62
62
|
after_resource_updated_path(requested_resource),
|
63
|
-
notice: translate_with_resource("update.success")
|
63
|
+
notice: translate_with_resource("update.success"),
|
64
|
+
status: :see_other
|
64
65
|
)
|
65
66
|
else
|
66
67
|
render :edit, locals: {
|
@@ -75,7 +76,7 @@ module Administrate
|
|
75
76
|
else
|
76
77
|
flash[:error] = requested_resource.errors.full_messages.join("<br/>")
|
77
78
|
end
|
78
|
-
redirect_to after_resource_destroyed_path(requested_resource)
|
79
|
+
redirect_to after_resource_destroyed_path(requested_resource), status: :see_other
|
79
80
|
end
|
80
81
|
|
81
82
|
private
|
@@ -18,7 +18,7 @@ to display a collection of resources in an HTML table.
|
|
18
18
|
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Page/Collection
|
19
19
|
%>
|
20
20
|
|
21
|
-
<table aria-labelledby="<%= table_title %>">
|
21
|
+
<table aria-labelledby="<%= table_title %>" data-controller="table" data-action="click->table#visitDataUrl keydown->table#visitDataUrl">
|
22
22
|
<thead>
|
23
23
|
<tr>
|
24
24
|
<% collection_presenter.attribute_types.each do |attr_name, attr_type| %>
|
@@ -7,11 +7,11 @@
|
|
7
7
|
<% end %>
|
8
8
|
|
9
9
|
<% if existing_action?(collection_presenter.resource_name, :destroy) %>
|
10
|
-
<td><%=
|
10
|
+
<td><%= button_to(
|
11
11
|
t("administrate.actions.destroy"),
|
12
12
|
[namespace, resource],
|
13
|
-
class: "
|
13
|
+
class: "link link--danger",
|
14
14
|
method: :delete,
|
15
|
-
data: {
|
15
|
+
data: { turbo_confirm: t("administrate.actions.confirm") }
|
16
16
|
) if accessible_action?(resource, :destroy) %></td>
|
17
17
|
<% end %>
|
@@ -7,6 +7,8 @@
|
|
7
7
|
<%= content_for(:title) %>
|
8
8
|
</h1>
|
9
9
|
|
10
|
+
<%= content_for(:header_middle) %>
|
11
|
+
|
10
12
|
<% if show_search_bar %>
|
11
13
|
<%= render(
|
12
14
|
"search",
|
@@ -25,4 +27,6 @@
|
|
25
27
|
class: "button",
|
26
28
|
) if accessible_action?(new_resource, :new) %>
|
27
29
|
</div>
|
30
|
+
|
31
|
+
<%= content_for(:header_last) %>
|
28
32
|
</header>
|
@@ -8,7 +8,7 @@ by providing a `content_for(:javascript)` block.
|
|
8
8
|
%>
|
9
9
|
|
10
10
|
<% Administrate::Engine.javascripts.each do |js_path| %>
|
11
|
-
<%= javascript_include_tag js_path %>
|
11
|
+
<%= javascript_include_tag js_path, "data-turbo-track": "reload", defer: true %>
|
12
12
|
<% end %>
|
13
13
|
|
14
14
|
<%= yield :javascript %>
|
@@ -22,6 +22,8 @@ It displays a header, and renders the `_form` partial to do the heavy lifting.
|
|
22
22
|
<%= content_for(:title) %>
|
23
23
|
</h1>
|
24
24
|
|
25
|
+
<%= content_for(:header_middle) %>
|
26
|
+
|
25
27
|
<div>
|
26
28
|
<%= link_to(
|
27
29
|
t("administrate.actions.show_resource", name: page.page_title),
|
@@ -29,8 +31,18 @@ It displays a header, and renders the `_form` partial to do the heavy lifting.
|
|
29
31
|
class: "button",
|
30
32
|
) if accessible_action?(page.resource, :show) %>
|
31
33
|
</div>
|
34
|
+
|
35
|
+
<%= content_for(:header_last) %>
|
32
36
|
</header>
|
33
37
|
|
34
|
-
|
35
|
-
|
36
|
-
|
38
|
+
<%= content_for(:before_main) %>
|
39
|
+
|
40
|
+
<% if content_for?(:main) %>
|
41
|
+
<%= content_for(:main) %>
|
42
|
+
<% else %>
|
43
|
+
<section class="main-content__body">
|
44
|
+
<%= render "form", page: page %>
|
45
|
+
</section>
|
46
|
+
<% end %>
|
47
|
+
|
48
|
+
<%= content_for(:after_main) %>
|
@@ -32,15 +32,23 @@ It renders the `_table` partial to display details about the resources.
|
|
32
32
|
)
|
33
33
|
%>
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
35
|
+
<%= content_for(:before_main) %>
|
36
|
+
|
37
|
+
<% if content_for?(:main) %>
|
38
|
+
<%= content_for(:main) %>
|
39
|
+
<% else %>
|
40
|
+
<section class="main-content__body main-content__body--flush">
|
41
|
+
<%= render(
|
42
|
+
"collection",
|
43
|
+
collection_presenter: page,
|
44
|
+
collection_field_name: resource_name,
|
45
|
+
page: page,
|
46
|
+
resources: resources,
|
47
|
+
table_title: "page-title"
|
48
|
+
) %>
|
49
|
+
|
50
|
+
<%= render("pagination", resources: resources) %>
|
51
|
+
</section>
|
52
|
+
<% end %>
|
44
53
|
|
45
|
-
|
46
|
-
</section>
|
54
|
+
<%= content_for(:after_main) %>
|
@@ -27,11 +27,23 @@ to do the heavy lifting.
|
|
27
27
|
<%= content_for(:title) %>
|
28
28
|
</h1>
|
29
29
|
|
30
|
+
<%= content_for(:header_middle) %>
|
31
|
+
|
30
32
|
<div>
|
31
33
|
<%= link_to t("administrate.actions.back"), :back, class: "button" %>
|
32
34
|
</div>
|
35
|
+
|
36
|
+
<%= content_for(:header_last) %>
|
33
37
|
</header>
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
<%= content_for(:before_main) %>
|
40
|
+
|
41
|
+
<% if content_for?(:main) %>
|
42
|
+
<%= content_for(:main) %>
|
43
|
+
<% else %>
|
44
|
+
<section class="main-content__body">
|
45
|
+
<%= render "form", page: page %>
|
46
|
+
</section>
|
47
|
+
<% end %>
|
48
|
+
|
49
|
+
<%= content_for(:after_main) %>
|
@@ -23,6 +23,8 @@ as well as a link to its edit page.
|
|
23
23
|
<%= content_for(:title) %>
|
24
24
|
</h1>
|
25
25
|
|
26
|
+
<%= content_for(:header_middle) %>
|
27
|
+
|
26
28
|
<div>
|
27
29
|
<%= link_to(
|
28
30
|
t("administrate.actions.edit_resource", name: page.page_title),
|
@@ -30,36 +32,46 @@ as well as a link to its edit page.
|
|
30
32
|
class: "button",
|
31
33
|
) if accessible_action?(page.resource, :edit) %>
|
32
34
|
|
33
|
-
<%=
|
35
|
+
<%= button_to(
|
34
36
|
t("administrate.actions.destroy"),
|
35
37
|
[namespace, page.resource],
|
36
38
|
class: "button button--danger",
|
37
39
|
method: :delete,
|
38
|
-
data: {
|
40
|
+
data: { turbo_confirm: t("administrate.actions.confirm") }
|
39
41
|
) if accessible_action?(page.resource, :destroy) %>
|
40
42
|
</div>
|
43
|
+
|
44
|
+
<%= content_for(:header_last) %>
|
41
45
|
</header>
|
42
46
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
<%= content_for(:before_main) %>
|
48
|
+
|
49
|
+
<% if content_for?(:main) %>
|
50
|
+
<%= content_for(:main) %>
|
51
|
+
<% else %>
|
52
|
+
<section class="main-content__body">
|
53
|
+
<dl>
|
54
|
+
<% page.attributes.each do |title, attributes| %>
|
55
|
+
<fieldset class="<%= "field-unit--nested" if title.present? %>">
|
56
|
+
<% if title.present? %>
|
57
|
+
<legend><%= t "helpers.label.#{page.resource_name}.#{title}", default: title %></legend>
|
58
|
+
<% end %>
|
59
|
+
|
60
|
+
<% attributes.each do |attribute| %>
|
61
|
+
<dt class="attribute-label" id="<%= attribute.name %>">
|
62
|
+
<%= t(
|
63
|
+
"helpers.label.#{resource_name}.#{attribute.name}",
|
64
|
+
default: page.resource.class.human_attribute_name(attribute.name),
|
65
|
+
) %>
|
66
|
+
</dt>
|
50
67
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
68
|
+
<dd class="attribute-data attribute-data--<%=attribute.html_class%>"
|
69
|
+
><%= render_field attribute, page: page %></dd>
|
70
|
+
<% end %>
|
71
|
+
</fieldset>
|
72
|
+
<% end %>
|
73
|
+
</dl>
|
74
|
+
</section>
|
75
|
+
<% end %>
|
58
76
|
|
59
|
-
|
60
|
-
><%= render_field attribute, page: page %></dd>
|
61
|
-
<% end %>
|
62
|
-
</fieldset>
|
63
|
-
<% end %>
|
64
|
-
</dl>
|
65
|
-
</section>
|
77
|
+
<%= content_for(:after_main) %>
|
@@ -17,10 +17,11 @@ that displays all possible records to associate with.
|
|
17
17
|
%>
|
18
18
|
|
19
19
|
<div class="field-unit__label">
|
20
|
-
<%= f.label field.permitted_attribute %>
|
20
|
+
<%= f.label field.attribute, for: "#{f.object_name}_#{field.permitted_attribute}" %>
|
21
21
|
</div>
|
22
22
|
<div class="field-unit__field">
|
23
23
|
<%= f.select(field.permitted_attribute,
|
24
24
|
options_for_select(field.associated_resource_options, field.selected_option),
|
25
|
-
include_blank: field.include_blank_option
|
25
|
+
{include_blank: field.include_blank_option},
|
26
|
+
data: {controller: field.html_controller}) %>
|
26
27
|
</div>
|
@@ -23,7 +23,7 @@ and is augmented with [Selectize].
|
|
23
23
|
<%= f.label field.attribute, for: "#{f.object_name}_#{field.attribute_key}" %>
|
24
24
|
</div>
|
25
25
|
<div class="field-unit__field">
|
26
|
-
<%= f.select(field.attribute_key, nil, {}, multiple: true) do %>
|
26
|
+
<%= f.select(field.attribute_key, nil, {}, multiple: true, data: {controller: field.html_controller}) do %>
|
27
27
|
<%= options_for_select(field.associated_resource_options, field.selected_options) %>
|
28
28
|
<% end %>
|
29
29
|
</div>
|
@@ -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) do %>
|
25
|
+
<%= pf.select(:value, {}, 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>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%#
|
2
|
+
# RichText Index Partial
|
3
|
+
|
4
|
+
This partial renders a rich_text attribute
|
5
|
+
to be displayed on a resource's index page.
|
6
|
+
|
7
|
+
By default, the attribute is rendered as a plain text truncated string.
|
8
|
+
|
9
|
+
## Local variables:
|
10
|
+
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::RichText][1].
|
13
|
+
A wrapper around the RichText pulled from the database.
|
14
|
+
|
15
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/RichText
|
16
|
+
%>
|
17
|
+
|
18
|
+
<%= field.truncate %>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<%#
|
2
|
+
# RichText Show Partial
|
3
|
+
|
4
|
+
This partial renders a rich_text attribute,
|
5
|
+
to be displayed on a resource's show page.
|
6
|
+
|
7
|
+
By default, the attribute is rendered as HTML.
|
8
|
+
|
9
|
+
## Local variables:
|
10
|
+
|
11
|
+
- `field`:
|
12
|
+
An instance of [Administrate::Field::RichText][1].
|
13
|
+
A wrapper around the RichText object pulled from the database.
|
14
|
+
|
15
|
+
[1]: http://www.rubydoc.info/gems/administrate/Administrate/Field/RichText
|
16
|
+
%>
|
17
|
+
|
18
|
+
<%= field.data %>
|
@@ -18,5 +18,5 @@ This partial renders a textarea element for a text attribute.
|
|
18
18
|
<%= f.label field.attribute %>
|
19
19
|
</div>
|
20
20
|
<div class="field-unit__field">
|
21
|
-
<%= f.text_area field.attribute %>
|
21
|
+
<%= f.text_area field.attribute, field.options.fetch(:input_options, {}) %>
|
22
22
|
</div>
|
@@ -24,6 +24,7 @@ By default, it renders:
|
|
24
24
|
<%= render "stylesheet" %>
|
25
25
|
<%= csrf_meta_tags %>
|
26
26
|
<%= csp_meta_tag if defined?(csp_meta_tag) %>
|
27
|
+
<%= render "javascript" %>
|
27
28
|
</head>
|
28
29
|
<body>
|
29
30
|
<%= render "icons" %>
|
@@ -36,7 +37,5 @@ By default, it renders:
|
|
36
37
|
<%= yield %>
|
37
38
|
</main>
|
38
39
|
</div>
|
39
|
-
|
40
|
-
<%= render "javascript" %>
|
41
40
|
</body>
|
42
41
|
</html>
|