activeadmin 2.6.1 → 2.9.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/CHANGELOG.md +119 -8
- data/CONTRIBUTING.md +8 -24
- data/README.md +4 -4
- data/app/assets/javascripts/active_admin/base.js +14 -16
- data/app/assets/stylesheets/active_admin/_header.scss +37 -3
- data/app/assets/stylesheets/active_admin/components/_comments.scss +2 -2
- data/app/assets/stylesheets/active_admin/mixins/_variables.scss +3 -0
- data/app/javascript/active_admin/initializers/per-page.js +1 -1
- data/app/javascript/active_admin/lib/checkbox-toggler.js +3 -3
- data/app/javascript/active_admin/lib/dropdown-menu.js +1 -1
- data/app/javascript/active_admin/lib/modal-dialog.js +7 -7
- data/app/javascript/active_admin/lib/per-page.js +1 -1
- data/app/javascript/active_admin/lib/table-checkbox-toggler.js +1 -1
- data/app/views/active_admin/devise/mailer/reset_password_instructions.html.erb +1 -1
- data/app/views/active_admin/devise/mailer/unlock_instructions.html.erb +2 -2
- data/app/views/layouts/active_admin_logged_out.html.erb +15 -5
- data/config/locales/ar.yml +6 -6
- data/config/locales/es-MX.yml +2 -1
- data/config/locales/es.yml +2 -2
- data/config/locales/it.yml +18 -0
- data/config/locales/ja.yml +3 -3
- data/config/locales/vi.yml +5 -5
- data/docs/0-installation.md +26 -2
- data/docs/11-decorators.md +16 -5
- data/docs/2-resource-customization.md +10 -1
- data/docs/5-forms.md +6 -1
- data/docs/6-show-pages.md +12 -0
- data/docs/Gemfile +2 -2
- data/docs/Gemfile.lock +52 -41
- data/docs/_includes/top-menu.html +1 -1
- data/docs/documentation.md +1 -1
- data/docs/index.html +6 -6
- data/lib/active_admin.rb +59 -60
- data/lib/active_admin/application.rb +13 -13
- data/lib/active_admin/application_settings.rb +3 -3
- data/lib/active_admin/authorization_adapter.rb +3 -3
- data/lib/active_admin/base_controller.rb +4 -4
- data/lib/active_admin/base_controller/authorization.rb +13 -12
- data/lib/active_admin/batch_actions/controller.rb +3 -3
- data/lib/active_admin/batch_actions/resource_extension.rb +9 -8
- data/lib/active_admin/batch_actions/views/batch_action_form.rb +3 -3
- data/lib/active_admin/batch_actions/views/batch_action_selector.rb +6 -6
- data/lib/active_admin/batch_actions/views/selection_cells.rb +3 -3
- data/lib/active_admin/cancan_adapter.rb +1 -1
- data/lib/active_admin/collection_decorator.rb +31 -0
- data/lib/active_admin/csv_builder.rb +4 -4
- data/lib/active_admin/dependency.rb +11 -11
- data/lib/active_admin/devise.rb +5 -5
- data/lib/active_admin/dsl.rb +1 -1
- data/lib/active_admin/dynamic_settings_node.rb +2 -2
- data/lib/active_admin/engine.rb +10 -8
- data/lib/active_admin/error.rb +0 -2
- data/lib/active_admin/filters.rb +7 -7
- data/lib/active_admin/filters/active.rb +1 -1
- data/lib/active_admin/filters/active_filter.rb +5 -6
- data/lib/active_admin/filters/active_sidebar.rb +5 -5
- data/lib/active_admin/filters/forms.rb +6 -6
- data/lib/active_admin/filters/formtastic_addons.rb +1 -6
- data/lib/active_admin/filters/resource_extension.rb +1 -1
- data/lib/active_admin/form_builder.rb +24 -20
- data/lib/active_admin/generators/boilerplate.rb +1 -1
- data/lib/active_admin/helpers/optional_display.rb +2 -2
- data/lib/active_admin/inputs/datepicker_input.rb +1 -1
- data/lib/active_admin/inputs/filters/base.rb +1 -1
- data/lib/active_admin/inputs/filters/base/search_method_select.rb +4 -4
- data/lib/active_admin/inputs/filters/boolean_input.rb +1 -1
- data/lib/active_admin/inputs/filters/check_boxes_input.rb +1 -1
- data/lib/active_admin/inputs/filters/select_input.rb +2 -2
- data/lib/active_admin/localizers.rb +1 -1
- data/lib/active_admin/localizers/resource_localizer.rb +3 -3
- data/lib/active_admin/menu.rb +6 -3
- data/lib/active_admin/menu_item.rb +7 -7
- data/lib/active_admin/namespace.rb +12 -12
- data/lib/active_admin/namespace_settings.rb +8 -5
- data/lib/active_admin/order_clause.rb +1 -1
- data/lib/active_admin/orm/active_record.rb +1 -1
- data/lib/active_admin/orm/active_record/comments.rb +19 -19
- data/lib/active_admin/orm/active_record/comments/comment.rb +3 -3
- data/lib/active_admin/orm/active_record/comments/views.rb +2 -2
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +19 -19
- data/lib/active_admin/page.rb +1 -1
- data/lib/active_admin/pundit_adapter.rb +5 -5
- data/lib/active_admin/resource.rb +17 -17
- data/lib/active_admin/resource/action_items.rb +5 -5
- data/lib/active_admin/resource/attributes.rb +1 -1
- data/lib/active_admin/resource/belongs_to.rb +2 -2
- data/lib/active_admin/resource/controllers.rb +1 -1
- data/lib/active_admin/resource/menu.rb +4 -4
- data/lib/active_admin/resource/naming.rb +4 -4
- data/lib/active_admin/resource/routes.rb +5 -7
- data/lib/active_admin/resource/scope_to.rb +7 -7
- data/lib/active_admin/resource/sidebars.rb +1 -1
- data/lib/active_admin/resource_controller.rb +12 -11
- data/lib/active_admin/resource_controller/data_access.rb +1 -1
- data/lib/active_admin/resource_controller/decorators.rb +6 -28
- data/lib/active_admin/resource_controller/streaming.rb +7 -6
- data/lib/active_admin/resource_dsl.rb +5 -5
- data/lib/active_admin/scope.rb +6 -6
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_factory.rb +17 -17
- data/lib/active_admin/view_helpers.rb +1 -1
- data/lib/active_admin/view_helpers/breadcrumb_helper.rb +3 -3
- data/lib/active_admin/view_helpers/display_helper.rb +5 -5
- data/lib/active_admin/view_helpers/download_format_links_helper.rb +1 -1
- data/lib/active_admin/view_helpers/fields_for.rb +2 -2
- data/lib/active_admin/views.rb +1 -1
- data/lib/active_admin/views/components/active_admin_form.rb +5 -5
- data/lib/active_admin/views/components/attributes_table.rb +5 -5
- data/lib/active_admin/views/components/blank_slate.rb +1 -1
- data/lib/active_admin/views/components/dropdown_menu.rb +8 -8
- data/lib/active_admin/views/components/index_list.rb +3 -3
- data/lib/active_admin/views/components/menu.rb +1 -1
- data/lib/active_admin/views/components/menu_item.rb +4 -4
- data/lib/active_admin/views/components/paginated_collection.rb +18 -18
- data/lib/active_admin/views/components/panel.rb +1 -1
- data/lib/active_admin/views/components/scopes.rb +7 -5
- data/lib/active_admin/views/components/site_title.rb +1 -1
- data/lib/active_admin/views/components/status_tag.rb +11 -11
- data/lib/active_admin/views/components/table_for.rb +17 -17
- data/lib/active_admin/views/components/tabs.rb +3 -3
- data/lib/active_admin/views/footer.rb +2 -1
- data/lib/active_admin/views/header.rb +2 -2
- data/lib/active_admin/views/index_as_blog.rb +1 -1
- data/lib/active_admin/views/index_as_grid.rb +1 -1
- data/lib/active_admin/views/index_as_table.rb +16 -16
- data/lib/active_admin/views/pages/base.rb +10 -8
- data/lib/active_admin/views/pages/index.rb +14 -13
- data/lib/active_admin/views/tabbed_navigation.rb +2 -2
- data/lib/active_admin/views/title_bar.rb +1 -1
- data/lib/activeadmin.rb +1 -1
- data/lib/generators/active_admin/assets/assets_generator.rb +2 -2
- data/lib/generators/active_admin/assets/templates/active_admin.scss +2 -2
- data/lib/generators/active_admin/devise/devise_generator.rb +5 -5
- data/lib/generators/active_admin/install/install_generator.rb +14 -8
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +9 -2
- data/lib/generators/active_admin/page/page_generator.rb +1 -1
- data/lib/generators/active_admin/resource/resource_generator.rb +3 -3
- data/lib/generators/active_admin/webpacker/plugins/jquery.js +7 -0
- data/lib/generators/active_admin/webpacker/templates/active_admin.js +5 -0
- data/lib/generators/active_admin/webpacker/templates/active_admin.scss +17 -0
- data/lib/generators/active_admin/webpacker/templates/print.scss +2 -0
- data/lib/generators/active_admin/webpacker/webpacker_generator.rb +26 -0
- data/lib/ransack_ext.rb +8 -8
- metadata +22 -44
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
// Images
|
|
6
6
|
$menu-arrow-light-icon-url: 'data:image/png;base64,R0lGODlhBwAEAKIAAL6+vry8vIiIiJWVlf///3t7ewAAAAAAACH5BAEAAAUALAAAAAAHAAQAAAMLWLol80MoF5mQKgEAOw==' !default;
|
|
7
7
|
$menu-arrow-dark-icon-url: 'data:image/png;base64,R0lGODlhBwAEAKIAAG1tbWxsbElJSVBQUP///0JCQgAAAAAAACH5BAEAAAUALAAAAAAHAAQAAAMLWLol80MoF5mQKgEAOw==' !default;
|
|
8
|
+
$menu-arrow-right-light-icon-url: 'data:image/gif;base64,R0lGODlhBAAHAKECAKqqqszMzPkVFfkVFSH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAIALAAAAAAEAAcAAAIJlA0XKbH9nmAFADs=' !default;
|
|
9
|
+
$menu-arrow-right-dark-icon-url: 'data:image/gif;base64,R0lGODlhBAAHAMIEAG1tbWxsbElJSVBQUPkVFfkVFfkVFfkVFSH+EUNyZWF0ZWQgd2l0aCBHSU1QACH5BAEKAAEALAAAAAAEAAcAAAMKGKqy02G8OGeACQA7' !default;
|
|
10
|
+
|
|
8
11
|
$orderable-icon-url: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAABGCAYAAAAAVo4aAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAH5JREFUeNpi3LhlOwMU1AExGxDXwARYoHQLEFdD2cxAXAliMKFJgEAFEHfBJEHGMKLhMpgkTsAEdch/NNwCk2xCdiEQtML4LEgCf6EubUX3Cgh0oNvJ+P//f7wOGpUclRwYSZb41CyidNbB8giNM+9oXhmVHHm5bJjUSAABBgDKKiwMMUxPwgAAAABJRU5ErkJggg==' !default;
|
|
9
12
|
|
|
10
13
|
// Colors
|
|
@@ -6,7 +6,7 @@ class CheckboxToggler {
|
|
|
6
6
|
this._bind();
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
option(
|
|
9
|
+
option(_key, _value) {
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
_init() {
|
|
@@ -30,7 +30,7 @@ class CheckboxToggler {
|
|
|
30
30
|
this.toggle_all_checkbox.change(() => this._didChangeToggleAllCheckbox());
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
_didChangeCheckbox(
|
|
33
|
+
_didChangeCheckbox(_checkbox){
|
|
34
34
|
const numChecked = this.checkboxes.filter(':checked').length;
|
|
35
35
|
|
|
36
36
|
const allChecked = numChecked === this.checkboxes.length;
|
|
@@ -44,6 +44,6 @@ class CheckboxToggler {
|
|
|
44
44
|
this.checkboxes.prop({ checked: setting });
|
|
45
45
|
return setting;
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
|
|
49
49
|
export default CheckboxToggler;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
function ModalDialog(message, inputs, callback){
|
|
2
2
|
let html = `<form id="dialog_confirm" title="${message}"><ul>`;
|
|
3
3
|
for (let name in inputs) {
|
|
4
|
-
var
|
|
4
|
+
var opts, wrapper;
|
|
5
5
|
let type = inputs[name];
|
|
6
6
|
if (/^(datepicker|checkbox|text|number)$/.test(type)) {
|
|
7
7
|
wrapper = 'input';
|
|
8
8
|
} else if (type === 'textarea') {
|
|
9
9
|
wrapper = 'textarea';
|
|
10
10
|
} else if ($.isArray(type)) {
|
|
11
|
-
[wrapper,
|
|
11
|
+
[wrapper, opts, type] = ['select', type, ''];
|
|
12
12
|
} else {
|
|
13
13
|
throw new Error(`Unsupported input type: {${name}: ${type}}`);
|
|
14
14
|
}
|
|
@@ -21,20 +21,20 @@ function ModalDialog(message, inputs, callback){
|
|
|
21
21
|
const result = [];
|
|
22
22
|
|
|
23
23
|
opts.forEach(v => {
|
|
24
|
-
const $elem = $(
|
|
24
|
+
const $elem = $('<option></option>');
|
|
25
25
|
if ($.isArray(v)) {
|
|
26
26
|
$elem.text(v[0]).val(v[1]);
|
|
27
27
|
} else {
|
|
28
28
|
$elem.text(v);
|
|
29
29
|
}
|
|
30
|
-
result.push($elem.wrap('<div>').parent().html());
|
|
30
|
+
result.push($elem.wrap('<div></div>').parent().html());
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
return result;
|
|
34
34
|
})()).join('') : '') +
|
|
35
35
|
`</${wrapper}>` +
|
|
36
36
|
"</li>";
|
|
37
|
-
[wrapper,
|
|
37
|
+
[wrapper, opts, type, klass] = []; // unset any temporary variables
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
html += "</ul></form>";
|
|
@@ -44,7 +44,7 @@ function ModalDialog(message, inputs, callback){
|
|
|
44
44
|
|
|
45
45
|
form.dialog({
|
|
46
46
|
modal: true,
|
|
47
|
-
open(
|
|
47
|
+
open(_event, _ui) {
|
|
48
48
|
$('body').trigger('modal_dialog:after_open', [form]);
|
|
49
49
|
},
|
|
50
50
|
dialogClass: 'active_admin_dialog',
|
|
@@ -58,6 +58,6 @@ function ModalDialog(message, inputs, callback){
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
}
|
|
61
|
+
}
|
|
62
62
|
|
|
63
63
|
export default ModalDialog;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<p>Someone has requested a link to change your password, and you can do this through the link below.</p>
|
|
4
4
|
|
|
5
|
-
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @
|
|
5
|
+
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
|
|
6
6
|
|
|
7
7
|
<p>If you didn't request this, please ignore this email.</p>
|
|
8
8
|
<p>Your password won't change until you access the link above and create a new one.</p>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<p>Hello <%= @resource.email %>!</p>
|
|
2
2
|
|
|
3
|
-
<p>Your account has been locked due to an excessive
|
|
3
|
+
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
|
4
4
|
|
|
5
5
|
<p>Click the link below to unlock your account:</p>
|
|
6
6
|
|
|
7
|
-
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @
|
|
7
|
+
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
|
|
@@ -6,10 +6,18 @@
|
|
|
6
6
|
<title><%= [@page_title, ActiveAdmin.application.site_title(self)].compact.join(" | ") %></title>
|
|
7
7
|
|
|
8
8
|
<% ActiveAdmin.application.stylesheets.each do |style, options| %>
|
|
9
|
-
|
|
9
|
+
<% if ActiveAdmin.application.use_webpacker %>
|
|
10
|
+
<%= stylesheet_pack_tag style, **options %>
|
|
11
|
+
<% else %>
|
|
12
|
+
<%= stylesheet_link_tag style, **options %>
|
|
13
|
+
<% end %>
|
|
10
14
|
<% end %>
|
|
11
15
|
<% ActiveAdmin.application.javascripts.each do |path| %>
|
|
12
|
-
|
|
16
|
+
<% if ActiveAdmin.application.use_webpacker %>
|
|
17
|
+
<%= javascript_pack_tag path %>
|
|
18
|
+
<% else %>
|
|
19
|
+
<%= javascript_include_tag path %>
|
|
20
|
+
<% end %>
|
|
13
21
|
<% end %>
|
|
14
22
|
|
|
15
23
|
<%= favicon_link_tag ActiveAdmin.application.favicon if ActiveAdmin.application.favicon %>
|
|
@@ -24,9 +32,11 @@
|
|
|
24
32
|
<div id="wrapper">
|
|
25
33
|
|
|
26
34
|
<div id="content_wrapper">
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
<div class="flashes">
|
|
36
|
+
<% flash_messages.each do |type, message| %>
|
|
37
|
+
<%= content_tag :div, message, class: "flash flash_#{type}" %>
|
|
38
|
+
<% end %>
|
|
39
|
+
</div>
|
|
30
40
|
<div id="active_admin_content">
|
|
31
41
|
<%= yield %>
|
|
32
42
|
</div>
|
data/config/locales/ar.yml
CHANGED
|
@@ -8,7 +8,7 @@ ar:
|
|
|
8
8
|
edit: "تعديل"
|
|
9
9
|
delete: "حذف"
|
|
10
10
|
delete_confirmation: "هل تريد تأكيد الحذف؟"
|
|
11
|
-
new_model: "
|
|
11
|
+
new_model: "%{model} جديد"
|
|
12
12
|
edit_model: "تعديل %{model}"
|
|
13
13
|
delete_model: "حذف %{model}"
|
|
14
14
|
details: "تفاصيل %{model}"
|
|
@@ -97,12 +97,12 @@ ar:
|
|
|
97
97
|
password:
|
|
98
98
|
title: "كلمة المرور"
|
|
99
99
|
sign_up:
|
|
100
|
-
title: "تسجيل
|
|
101
|
-
submit: "تسجيل
|
|
100
|
+
title: "تسجيل"
|
|
101
|
+
submit: "تسجيل"
|
|
102
102
|
login:
|
|
103
|
-
title: "
|
|
103
|
+
title: "تسجيل الدخول"
|
|
104
104
|
remember_me: "تذكرني"
|
|
105
|
-
submit: "
|
|
105
|
+
submit: "تسجيل الدخول"
|
|
106
106
|
reset_password:
|
|
107
107
|
title: "هل نسيت كلمة المرور؟"
|
|
108
108
|
submit: "استرجاع كلمة المرور"
|
|
@@ -117,7 +117,7 @@ ar:
|
|
|
117
117
|
submit: "إعادة ارسال تعليمات التأكيد"
|
|
118
118
|
links:
|
|
119
119
|
sign_up: "التسجيل"
|
|
120
|
-
sign_in: "
|
|
120
|
+
sign_in: "تسجيل الدخول"
|
|
121
121
|
forgot_your_password: "هل نسيت كلمة المرور؟"
|
|
122
122
|
sign_in_with_omniauth_provider: "تسجيل الدخول بـ %{provider}"
|
|
123
123
|
resend_unlock_instructions: "إعادة إرسال تعليمات تنشيط الحساب"
|
data/config/locales/es-MX.yml
CHANGED
|
@@ -86,7 +86,8 @@ es-MX:
|
|
|
86
86
|
title: "Cambie su contraseña"
|
|
87
87
|
submit: "Cambiar mi contraseña"
|
|
88
88
|
links:
|
|
89
|
-
sign_in: "
|
|
89
|
+
sign_in: "Iniciar Sesión"
|
|
90
|
+
sign_up: "Registrarse"
|
|
90
91
|
forgot_your_password: "¿Olvidó su contraseña?"
|
|
91
92
|
sign_in_with_omniauth_provider: "Conéctate con %{provider}"
|
|
92
93
|
index_list:
|
data/config/locales/es.yml
CHANGED
|
@@ -143,8 +143,8 @@ es:
|
|
|
143
143
|
title: "Reenviar instrucciones de confirmación"
|
|
144
144
|
submit: "Reenviar instrucciones de confirmación"
|
|
145
145
|
links:
|
|
146
|
-
sign_up: "
|
|
147
|
-
sign_in: "
|
|
146
|
+
sign_up: "Registrarse"
|
|
147
|
+
sign_in: "Iniciar Sesión"
|
|
148
148
|
forgot_your_password: "¿Olvidó su contraseña?"
|
|
149
149
|
sign_in_with_omniauth_provider: "Conéctate con %{provider}"
|
|
150
150
|
resend_unlock_instructions: "Reenviar instrucciones de desbloqueo"
|
data/config/locales/it.yml
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
it:
|
|
2
|
+
activerecord:
|
|
3
|
+
models:
|
|
4
|
+
comment:
|
|
5
|
+
one: "Commento"
|
|
6
|
+
other: "Commenti"
|
|
7
|
+
active_admin/comment:
|
|
8
|
+
one: "Commento"
|
|
9
|
+
other: "Commenti"
|
|
10
|
+
attributes:
|
|
11
|
+
active_admin/comment:
|
|
12
|
+
author_type: "Tipo di Autore"
|
|
13
|
+
body: "Corpo"
|
|
14
|
+
created_at: "Creato il"
|
|
15
|
+
namespace: "Namespace"
|
|
16
|
+
resource_type: "Tipo di risorsa"
|
|
17
|
+
updated_at: "Aggiornato il"
|
|
2
18
|
active_admin:
|
|
3
19
|
dashboard: Dashboard
|
|
4
20
|
dashboard_welcome:
|
|
@@ -37,6 +53,8 @@ it:
|
|
|
37
53
|
lteq_datetime: "Minore o uguale a"
|
|
38
54
|
from: "Da"
|
|
39
55
|
to: "A"
|
|
56
|
+
scopes:
|
|
57
|
+
all: "Tutti"
|
|
40
58
|
search_status:
|
|
41
59
|
headline: "Situazione filtri:"
|
|
42
60
|
current_scope: "Contesto selezionato:"
|
data/config/locales/ja.yml
CHANGED
|
@@ -8,7 +8,7 @@ ja:
|
|
|
8
8
|
edit: "編集"
|
|
9
9
|
delete: "削除"
|
|
10
10
|
delete_confirmation: "本当に削除しますか?"
|
|
11
|
-
create_another: "%{model}
|
|
11
|
+
create_another: "%{model} を続けて作成する"
|
|
12
12
|
new_model: "%{model} を作成する"
|
|
13
13
|
edit_model: "%{model} を編集する"
|
|
14
14
|
delete_model: "%{model} を削除する"
|
|
@@ -18,7 +18,7 @@ ja:
|
|
|
18
18
|
previous: "前"
|
|
19
19
|
next: "次"
|
|
20
20
|
download: "ダウンロード:"
|
|
21
|
-
has_many_new: "
|
|
21
|
+
has_many_new: "%{model} を追加する"
|
|
22
22
|
has_many_delete: "削除する"
|
|
23
23
|
has_many_remove: "削除する"
|
|
24
24
|
filters:
|
|
@@ -26,7 +26,7 @@ ja:
|
|
|
26
26
|
filter: "絞り込む"
|
|
27
27
|
clear: "条件を削除する"
|
|
28
28
|
predicates:
|
|
29
|
-
contains: "
|
|
29
|
+
contains: "を含む"
|
|
30
30
|
equals: "等しい"
|
|
31
31
|
starts_with: "で始まる"
|
|
32
32
|
ends_with: "で終わる"
|
data/config/locales/vi.yml
CHANGED
|
@@ -3,11 +3,11 @@ vi:
|
|
|
3
3
|
dashboard: Bảng điều khiển
|
|
4
4
|
dashboard_welcome:
|
|
5
5
|
welcome: "Chào mừng bạn đến với Active Admin. Đây là trang điều khiển mặc định."
|
|
6
|
-
call_to_action: "Để thêm
|
|
6
|
+
call_to_action: "Để thêm thành phần cho trang điều khiển hãy chỉnh sửa 'app/admin/dashboard.rb'"
|
|
7
7
|
view: "Xem"
|
|
8
8
|
edit: "Chỉnh sửa"
|
|
9
9
|
delete: "Xóa"
|
|
10
|
-
delete_confirmation: "Bạn có chắc chắn rằng mình muốn xóa
|
|
10
|
+
delete_confirmation: "Bạn có chắc chắn rằng mình muốn xóa không?"
|
|
11
11
|
new_model: "Tạo mới %{model}"
|
|
12
12
|
edit_model: "Chỉnh sửa %{model}"
|
|
13
13
|
delete_model: "Xóa %{model}"
|
|
@@ -16,8 +16,8 @@ vi:
|
|
|
16
16
|
cancel: "Hủy"
|
|
17
17
|
empty: "Trống"
|
|
18
18
|
previous: "Trước"
|
|
19
|
-
next: "
|
|
20
|
-
download: "
|
|
19
|
+
next: "Sau"
|
|
20
|
+
download: "Tải về:"
|
|
21
21
|
has_many_new: "Thêm mới %{model}"
|
|
22
22
|
has_many_delete: "Xóa"
|
|
23
23
|
has_many_remove: "Hủy bỏ"
|
|
@@ -29,7 +29,7 @@ vi:
|
|
|
29
29
|
contains: "Có chứa"
|
|
30
30
|
equals: "Bằng"
|
|
31
31
|
starts_with: "Bắt đầu với"
|
|
32
|
-
ends_with: "Kết thúc
|
|
32
|
+
ends_with: "Kết thúc bởi"
|
|
33
33
|
greater_than: "Lớn hơn"
|
|
34
34
|
less_than: "Nhỏ hơn"
|
|
35
35
|
gteq_datetime: "Lớn hơn hoặc bằng"
|
data/docs/0-installation.md
CHANGED
|
@@ -51,8 +51,8 @@ The generator adds these core files, among others:
|
|
|
51
51
|
Now, migrate and seed your database before starting the server:
|
|
52
52
|
|
|
53
53
|
```sh
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
rails db:migrate
|
|
55
|
+
rails db:seed
|
|
56
56
|
rails server
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -112,6 +112,30 @@ Draper::CollectionDecorator.send :delegate, :per_page_kaminari
|
|
|
112
112
|
|
|
113
113
|
If you're getting the error `wrong number of arguments (6 for 4..5)`, [read #2703].
|
|
114
114
|
|
|
115
|
+
## webpacker
|
|
116
|
+
|
|
117
|
+
For new apps starting with Rails 6.0, Webpacker has become the default asset generator. You can **opt-in to using Webpacker for ActiveAdmin assets** as well by updating your configuration to turn on the `use_webpacker` option, either at installation time or manually.
|
|
118
|
+
|
|
119
|
+
* at active_admin installation:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
rails g active_admin:install --use_webpacker
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
* manually:
|
|
126
|
+
|
|
127
|
+
```ruby
|
|
128
|
+
ActiveAdmin.setup do |config|
|
|
129
|
+
config.use_webpacker = true
|
|
130
|
+
end
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
And run the generator to get default Active Admin assets:
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
rails g active_admin:webpacker
|
|
137
|
+
```
|
|
138
|
+
|
|
115
139
|
[CHANGELOG]: https://github.com/activeadmin/activeadmin/blob/master/CHANGELOG.md
|
|
116
140
|
[dashboard.rb]: https://github.com/activeadmin/activeadmin/blob/master/lib/generators/active_admin/install/templates/dashboard.rb
|
|
117
141
|
[active_admin.rb]: https://github.com/activeadmin/activeadmin/blob/master/lib/generators/active_admin/install/templates/active_admin.rb.erb
|
data/docs/11-decorators.md
CHANGED
|
@@ -8,11 +8,6 @@ Active Admin allows you to use the decorator pattern to provide view-specific
|
|
|
8
8
|
versions of a resource. [Draper](https://github.com/drapergem/draper) is
|
|
9
9
|
recommended but not required.
|
|
10
10
|
|
|
11
|
-
To use decorator support without Draper, your decorator must support a variety
|
|
12
|
-
of collection methods to support pagination, filtering, etc. See
|
|
13
|
-
[this github issue discussion](https://github.com/activeadmin/activeadmin/issues/3600)
|
|
14
|
-
and [this gem](https://github.com/kiote/activeadmin-poro-decorator) for more details.
|
|
15
|
-
|
|
16
11
|
## Example usage
|
|
17
12
|
|
|
18
13
|
```ruby
|
|
@@ -42,6 +37,22 @@ ActiveAdmin.register Post do
|
|
|
42
37
|
end
|
|
43
38
|
```
|
|
44
39
|
|
|
40
|
+
You can pass any decorator class as an argument to `decorate_with`
|
|
41
|
+
as long as it accepts the record to be decorated as a parameter in
|
|
42
|
+
the initializer, and responds to all the necessary methods.
|
|
43
|
+
|
|
44
|
+
```ruby
|
|
45
|
+
# app/decorators/post_decorator.rb
|
|
46
|
+
class PostDecorator
|
|
47
|
+
attr_reader :post
|
|
48
|
+
delegate_missing_to :post
|
|
49
|
+
|
|
50
|
+
def initialize(post)
|
|
51
|
+
@post = post
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
```
|
|
55
|
+
|
|
45
56
|
## Forms
|
|
46
57
|
|
|
47
58
|
By default, ActiveAdmin does *not* decorate the resource used to render forms.
|
|
@@ -164,7 +164,8 @@ The menu method accepts a hash with the following options:
|
|
|
164
164
|
|
|
165
165
|
* `:label` - The string or proc label to display in the menu. If it's a proc, it
|
|
166
166
|
will be called each time the menu is rendered.
|
|
167
|
-
* `:parent` - The string id (or label) of the parent used for this menu
|
|
167
|
+
* `:parent` - The string id (or label) of the parent used for this menu, or an array
|
|
168
|
+
of string ids (or labels) for a nested menu
|
|
168
169
|
* `:if` - A block or a symbol of a method to call to decide if the menu item
|
|
169
170
|
should be displayed
|
|
170
171
|
* `:priority` - The integer value of the priority, which defaults to `10`
|
|
@@ -227,6 +228,14 @@ end
|
|
|
227
228
|
Note that the "Blog" parent menu item doesn't even have to exist yet; it can be
|
|
228
229
|
dynamically generated for you.
|
|
229
230
|
|
|
231
|
+
To further nest an item under a submenu, provide an array of parents.
|
|
232
|
+
|
|
233
|
+
```ruby
|
|
234
|
+
ActiveAdmin.register Post do
|
|
235
|
+
menu parent: ["Admin", "Blog"]
|
|
236
|
+
end
|
|
237
|
+
```
|
|
238
|
+
|
|
230
239
|
### Customizing Parent Menu Items
|
|
231
240
|
|
|
232
241
|
All of the options given to a standard menu item are also available to
|