activeadmin 2.12.0 → 3.3.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 +230 -0
- data/CONTRIBUTING.md +4 -12
- data/README.md +4 -4
- data/app/assets/javascripts/active_admin/base.js +1 -4
- data/app/assets/stylesheets/active_admin/_forms.scss +2 -3
- data/app/assets/stylesheets/active_admin/components/_comments.scss +1 -1
- data/app/assets/stylesheets/active_admin/components/_dropdown_menu.scss +7 -4
- data/app/assets/stylesheets/active_admin/components/_pagination.scss +5 -2
- data/app/assets/stylesheets/active_admin/components/_table_tools.scss +9 -6
- data/app/assets/stylesheets/active_admin/components/_tabs.scss +10 -7
- data/app/assets/stylesheets/active_admin/mixins/_buttons.scss +2 -2
- data/app/assets/stylesheets/active_admin/pages/_logged_out.scss +1 -1
- data/app/assets/stylesheets/active_admin/structure/_footer.scss +6 -1
- data/app/assets/stylesheets/active_admin/structure/_title_bar.scss +6 -3
- data/app/views/layouts/active_admin_logged_out.html.erb +5 -4
- data/config/locales/ar.yml +0 -7
- data/config/locales/az.yml +0 -7
- data/config/locales/bg.yml +0 -7
- data/config/locales/bs.yml +0 -7
- data/config/locales/ca.yml +0 -7
- data/config/locales/cs.yml +0 -7
- data/config/locales/da.yml +0 -7
- data/config/locales/de-CH.yml +0 -7
- data/config/locales/de.yml +0 -8
- data/config/locales/el.yml +0 -7
- data/config/locales/en-CA.yml +0 -7
- data/config/locales/en-GB.yml +0 -7
- data/config/locales/en.yml +0 -8
- data/config/locales/eo.yml +0 -8
- data/config/locales/es-MX.yml +0 -7
- data/config/locales/es.yml +0 -8
- data/config/locales/fa.yml +0 -7
- data/config/locales/fi.yml +0 -7
- data/config/locales/fr.yml +3 -11
- data/config/locales/he.yml +0 -9
- data/config/locales/hr.yml +0 -7
- data/config/locales/hu.yml +0 -8
- data/config/locales/id.yml +0 -7
- data/config/locales/it.yml +0 -8
- data/config/locales/ja.yml +0 -8
- data/config/locales/ko.yml +0 -7
- data/config/locales/lt.yml +0 -8
- data/config/locales/lv.yml +0 -7
- data/config/locales/mk.yml +0 -8
- data/config/locales/nb.yml +0 -8
- data/config/locales/nl.yml +0 -8
- data/config/locales/pl.yml +0 -8
- data/config/locales/pt-BR.yml +0 -8
- data/config/locales/pt-PT.yml +0 -7
- data/config/locales/ro.yml +0 -7
- data/config/locales/ru.yml +0 -6
- data/config/locales/sk.yml +0 -8
- data/config/locales/sv-SE.yml +58 -39
- data/config/locales/tr.yml +0 -11
- data/config/locales/uk.yml +0 -6
- data/config/locales/vi.yml +34 -15
- data/config/locales/zh-CN.yml +34 -23
- data/config/locales/zh-TW.yml +0 -7
- data/lib/active_admin/application.rb +4 -4
- data/lib/active_admin/asset_registration.rb +3 -3
- data/lib/active_admin/authorization_adapter.rb +2 -0
- data/lib/active_admin/base_controller/authorization.rb +2 -2
- data/lib/active_admin/csv_builder.rb +23 -2
- data/lib/active_admin/dependency.rb +0 -4
- data/lib/active_admin/engine.rb +5 -1
- data/lib/active_admin/filters/active_filter.rb +1 -1
- data/lib/active_admin/filters/forms.rb +2 -2
- data/lib/active_admin/filters/formtastic_addons.rb +1 -1
- data/lib/active_admin/filters/resource_extension.rb +4 -4
- data/lib/active_admin/form_builder.rb +5 -6
- data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
- data/lib/active_admin/inputs/filters/date_range_input.rb +2 -2
- data/lib/active_admin/inputs/filters/numeric_input.rb +1 -1
- data/lib/active_admin/inputs/filters/select_input.rb +3 -3
- data/lib/active_admin/inputs/filters/string_input.rb +1 -1
- data/lib/active_admin/menu.rb +1 -0
- data/lib/active_admin/namespace.rb +3 -3
- data/lib/active_admin/namespace_settings.rb +1 -1
- data/lib/active_admin/orm/active_record/comments/comment.rb +8 -0
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +1 -1
- data/lib/active_admin/orm/active_record/comments.rb +8 -8
- data/lib/active_admin/pundit_adapter.rb +20 -14
- data/lib/active_admin/resource/action_items.rb +2 -2
- data/lib/active_admin/resource/attributes.rb +8 -1
- data/lib/active_admin/resource/belongs_to.rb +0 -1
- data/lib/active_admin/resource_controller/decorators.rb +1 -1
- data/lib/active_admin/resource_controller/streaming.rb +1 -1
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_helpers/auto_link_helper.rb +1 -1
- data/lib/active_admin/view_helpers/display_helper.rb +10 -3
- data/lib/active_admin/views/components/active_admin_form.rb +14 -6
- data/lib/active_admin/views/components/paginated_collection.rb +4 -1
- data/lib/active_admin/views/index_as_table.rb +8 -7
- data/lib/active_admin/views/pages/base.rb +4 -3
- data/lib/active_admin/views/pages/index.rb +1 -1
- data/lib/active_admin/views/pages/show.rb +1 -7
- data/lib/active_admin.rb +5 -3
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +19 -2
- data/vendor/assets/javascripts/jquery-ui/data.js +12 -8
- data/vendor/assets/javascripts/jquery-ui/disable-selection.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/focusable.js +12 -9
- data/vendor/assets/javascripts/jquery-ui/form-reset-mixin.js +60 -57
- data/vendor/assets/javascripts/jquery-ui/form.js +15 -12
- data/vendor/assets/javascripts/jquery-ui/ie.js +5 -2
- data/vendor/assets/javascripts/jquery-ui/keycode.js +11 -7
- data/vendor/assets/javascripts/jquery-ui/labels.js +46 -40
- data/vendor/assets/javascripts/jquery-ui/plugin.js +5 -2
- data/vendor/assets/javascripts/jquery-ui/position.js +30 -17
- data/vendor/assets/javascripts/jquery-ui/safe-active-element.js +6 -2
- data/vendor/assets/javascripts/jquery-ui/safe-blur.js +6 -2
- data/vendor/assets/javascripts/jquery-ui/scroll-parent.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/tabbable.js +11 -8
- data/vendor/assets/javascripts/jquery-ui/unique-id.js +10 -7
- data/vendor/assets/javascripts/jquery-ui/version.js +6 -3
- data/vendor/assets/javascripts/jquery-ui/widget.js +53 -30
- data/vendor/assets/javascripts/jquery-ui/widgets/button.js +87 -24
- data/vendor/assets/javascripts/jquery-ui/widgets/checkboxradio.js +276 -273
- data/vendor/assets/javascripts/jquery-ui/widgets/controlgroup.js +15 -11
- data/vendor/assets/javascripts/jquery-ui/widgets/datepicker.js +182 -62
- data/vendor/assets/javascripts/jquery-ui/widgets/dialog.js +53 -36
- data/vendor/assets/javascripts/jquery-ui/widgets/draggable.js +28 -19
- data/vendor/assets/javascripts/jquery-ui/widgets/mouse.js +22 -11
- data/vendor/assets/javascripts/jquery-ui/widgets/resizable.js +47 -26
- data/vendor/assets/javascripts/jquery-ui/widgets/sortable.js +186 -125
- data/vendor/assets/javascripts/jquery-ui/widgets/tabs.js +20 -20
- metadata +34 -79
- data/docs/.gitignore +0 -1
- data/docs/0-installation.md +0 -142
- data/docs/1-general-configuration.md +0 -224
- data/docs/10-custom-pages.md +0 -150
- data/docs/11-decorators.md +0 -70
- data/docs/12-arbre-components.md +0 -214
- data/docs/13-authorization-adapter.md +0 -285
- data/docs/14-gotchas.md +0 -138
- data/docs/2-resource-customization.md +0 -475
- data/docs/3-index-pages/custom-index.md +0 -35
- data/docs/3-index-pages/index-as-block.md +0 -19
- data/docs/3-index-pages/index-as-blog.md +0 -69
- data/docs/3-index-pages/index-as-grid.md +0 -27
- data/docs/3-index-pages/index-as-table.md +0 -234
- data/docs/3-index-pages.md +0 -328
- data/docs/4-csv-format.md +0 -74
- data/docs/5-forms.md +0 -237
- data/docs/6-show-pages.md +0 -93
- data/docs/7-sidebars.md +0 -75
- data/docs/8-custom-actions.md +0 -177
- data/docs/9-batch-actions.md +0 -237
- data/docs/CNAME +0 -1
- data/docs/Gemfile +0 -4
- data/docs/Gemfile.lock +0 -283
- data/docs/README.md +0 -24
- data/docs/_config.yml +0 -4
- data/docs/_includes/footer.html +0 -8
- data/docs/_includes/google-analytics.html +0 -16
- data/docs/_includes/head.html +0 -7
- data/docs/_includes/toc.html +0 -98
- data/docs/_includes/top-menu.html +0 -17
- data/docs/_layouts/default.html +0 -21
- data/docs/documentation.md +0 -60
- data/docs/images/activeadmin.png +0 -0
- data/docs/images/code-header.png +0 -0
- data/docs/images/divider.png +0 -0
- data/docs/images/features.png +0 -0
- data/docs/images/tidelift.svg +0 -14
- data/docs/index.html +0 -226
- data/docs/stylesheets/main.css +0 -1205
- data/lib/active_admin/deprecation.rb +0 -11
- data/lib/ransack_ext.rb +0 -21
- data/vendor/assets/javascripts/jquery-ui/escape-selector.js +0 -23
data/config/locales/sv-SE.yml
CHANGED
@@ -1,17 +1,34 @@
|
|
1
1
|
"sv-SE":
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
comment:
|
5
|
+
one: "Kommentar"
|
6
|
+
other: "Kommentarer"
|
7
|
+
active_admin/comment:
|
8
|
+
one: "Kommentar"
|
9
|
+
other: "Kommentarer"
|
10
|
+
attributes:
|
11
|
+
active_admin/comment:
|
12
|
+
author_type: "Författartyp"
|
13
|
+
body: "Innehåll"
|
14
|
+
created_at: "Skapad"
|
15
|
+
namespace: "Namnrymd"
|
16
|
+
resource_type: "Resurstyp"
|
17
|
+
updated_at: "Aktualiserad"
|
2
18
|
active_admin:
|
3
19
|
dashboard: Skrivbord
|
4
20
|
dashboard_welcome:
|
5
21
|
welcome: "Välkommen till Active Admin. Detta är ditt standardskrivbord."
|
6
|
-
call_to_action: "För att lägga till sektioner,
|
22
|
+
call_to_action: "För att lägga till sektioner, gå till 'app/admin/dashboard.rb'"
|
7
23
|
view: "Visa"
|
8
24
|
edit: "Redigera"
|
9
25
|
delete: "Ta bort"
|
10
|
-
delete_confirmation: "Är du säker att du vill ta bort
|
26
|
+
delete_confirmation: "Är du säker på att du vill ta bort detta?"
|
27
|
+
create_another: "Skapa en till %{model}"
|
11
28
|
new_model: "Ny %{model}"
|
12
29
|
edit_model: "Redigera %{model}"
|
13
30
|
delete_model: "Ta bort %{model}"
|
14
|
-
details: "
|
31
|
+
details: "%{model}-detaljer"
|
15
32
|
cancel: "Avbryt"
|
16
33
|
empty: "Tom"
|
17
34
|
previous: "Föregående"
|
@@ -20,82 +37,84 @@
|
|
20
37
|
has_many_new: "Skapa en ny %{model}"
|
21
38
|
has_many_delete: "Ta bort"
|
22
39
|
has_many_remove: "Ta bort"
|
40
|
+
move: "Flytta"
|
23
41
|
filters:
|
24
42
|
buttons:
|
25
|
-
filter: "
|
43
|
+
filter: "Filtrera"
|
26
44
|
clear: "Rensa filter"
|
27
45
|
predicates:
|
28
|
-
contains: "Innehåller"
|
29
|
-
equals: "Lika med"
|
30
|
-
starts_with: "Börjar med"
|
31
|
-
ends_with: "Slutar med"
|
32
|
-
greater_than: "Större än"
|
33
|
-
less_than: "Mindre än"
|
34
46
|
from: "Från"
|
35
47
|
to: "Till"
|
48
|
+
scopes:
|
49
|
+
all: "Alla"
|
36
50
|
search_status:
|
37
|
-
headline: "
|
38
|
-
current_scope: "
|
39
|
-
current_filters: "
|
51
|
+
headline: "Sökstatus:"
|
52
|
+
current_scope: "Omfattning:"
|
53
|
+
current_filters: "Aktiva filter:"
|
40
54
|
no_current_filters: "Inga"
|
41
55
|
status_tag:
|
42
56
|
"yes": "Ja"
|
43
57
|
"no": "Nej"
|
44
58
|
"unset": "Nej"
|
45
|
-
main_content: "Implementera %{model}#main_content för att
|
59
|
+
main_content: "Implementera %{model}#main_content för att visa innehåll."
|
46
60
|
logout: "Logga ut"
|
47
61
|
powered_by: "Powered by %{active_admin} %{version}"
|
48
62
|
sidebars:
|
49
63
|
filters: "Filter"
|
50
|
-
search_status: "
|
64
|
+
search_status: "Sökstatus"
|
51
65
|
pagination:
|
52
|
-
empty: "Ingen %{model}
|
53
|
-
one: "Visar <b>1</b>
|
54
|
-
one_page: "Visar <b>alla %{n}</b>
|
66
|
+
empty: "Ingen %{model} hittades"
|
67
|
+
one: "Visar <b>1</b> %{model}"
|
68
|
+
one_page: "Visar <b>alla %{n}</b> %{model}"
|
55
69
|
multiple: "Visar %{model} <b>%{from} - %{to}</b> av <b>%{total}</b> totalt"
|
56
70
|
multiple_without_total: "Visar %{model} <b>%{from} - %{to}</b>"
|
71
|
+
per_page: "Per sida: "
|
57
72
|
entry:
|
58
73
|
one: "inlägg"
|
59
74
|
other: "inlägg"
|
60
|
-
any: "
|
75
|
+
any: "Alla"
|
61
76
|
blank_slate:
|
62
|
-
content: "
|
77
|
+
content: "Det finns inga %{resource_name} än."
|
63
78
|
link: "Skapa en"
|
64
79
|
dropdown_actions:
|
65
|
-
button_label: "
|
80
|
+
button_label: "Åtgärder"
|
66
81
|
batch_actions:
|
67
|
-
button_label: "Batch
|
82
|
+
button_label: "Batch-åtgärder"
|
68
83
|
default_confirmation: "Är du säker på att du vill göra detta?"
|
69
84
|
delete_confirmation: "Är du säker på att du vill radera dessa %{plural_model}?"
|
70
85
|
succesfully_destroyed:
|
71
86
|
one: "Lyckades radera 1 %{model}"
|
72
87
|
other: "Lyckades radera %{count} %{plural_model}"
|
73
|
-
selection_toggle_explanation: "(
|
74
|
-
action_label: "%{title}
|
88
|
+
selection_toggle_explanation: "(Byt markering)"
|
89
|
+
action_label: "%{title} markerad"
|
75
90
|
labels:
|
76
91
|
destroy: "Radera"
|
77
92
|
comments:
|
78
93
|
created_at: "Skapad"
|
79
|
-
resource_type: "
|
80
|
-
author_type: "
|
94
|
+
resource_type: "Resurstyp"
|
95
|
+
author_type: "Författartyp"
|
81
96
|
body: "Innehåll"
|
82
97
|
author: "Författare"
|
83
98
|
add: "Lägg till kommentar"
|
99
|
+
delete: "Radera kommentar"
|
100
|
+
delete_confirmation: "Är du säker på att du vill radera dessa kommentarer?"
|
84
101
|
resource: "Resurs"
|
85
102
|
no_comments_yet: "Inga kommentarer än."
|
86
103
|
author_missing: "Anonym"
|
87
104
|
title_content: "Kommentarer (%{count})"
|
88
105
|
errors:
|
89
|
-
empty_text: "Kommentaren sparades inte
|
106
|
+
empty_text: "Kommentaren sparades inte. Textfältet får inte vara tomt."
|
90
107
|
devise:
|
91
108
|
username:
|
92
109
|
title: "Användarnamn"
|
93
110
|
email:
|
94
|
-
title: "
|
111
|
+
title: "E-post"
|
95
112
|
subdomain:
|
96
113
|
title: "Subdomän"
|
97
114
|
password:
|
98
115
|
title: "Lösenord"
|
116
|
+
password_confirmation:
|
117
|
+
title: "Bekräfta lösenord"
|
99
118
|
sign_up:
|
100
119
|
title: "Registera"
|
101
120
|
submit: "Registera"
|
@@ -105,29 +124,29 @@
|
|
105
124
|
submit: "Inloggning"
|
106
125
|
reset_password:
|
107
126
|
title: "Glömt ditt lösenord?"
|
108
|
-
submit: "
|
127
|
+
submit: "Återställ mitt lösenord"
|
109
128
|
change_password:
|
110
129
|
title: "Ändra ditt lösenord"
|
111
130
|
submit: "Ändra mitt lösenord"
|
112
131
|
unlock:
|
113
|
-
title: "Skicka
|
114
|
-
submit: "Skicka
|
132
|
+
title: "Skicka upplåsningsinstruktioner"
|
133
|
+
submit: "Skicka upplåsningsinstruktioner"
|
115
134
|
resend_confirmation_instructions:
|
116
|
-
title: "Skicka
|
117
|
-
submit: "Skicka
|
135
|
+
title: "Skicka bekräftelseinstruktioner"
|
136
|
+
submit: "Skicka bekräftelseinstruktioner"
|
118
137
|
links:
|
119
138
|
sign_up: "Registera"
|
120
139
|
sign_in: "Logga in"
|
121
140
|
forgot_your_password: "Glömt ditt lösenord?"
|
122
141
|
sign_in_with_omniauth_provider: "Logga in med %{provider}"
|
123
|
-
resend_unlock_instructions: "Skicka
|
124
|
-
resend_confirmation_instructions: "Skicka
|
142
|
+
resend_unlock_instructions: "Skicka upplåsningsinstruktioner igen"
|
143
|
+
resend_confirmation_instructions: "Skicka bekräftningsinstruktioner igen"
|
125
144
|
unsupported_browser:
|
126
|
-
headline: "
|
127
|
-
recommendation: "Vi rekommenderar
|
128
|
-
turn_off_compatibility_view: "Om du använder IE 9 eller senare, se till att <a href=\"https://support.microsoft.com/sv-se/help/17471\">
|
145
|
+
headline: "Observera att ActiveAdmin inte längre stödjer Internet Explorer version 8 eller lägre."
|
146
|
+
recommendation: "Vi rekommenderar att du uppgraderar till den senaste versionen av <a href=\"http://windows.microsoft.com/ie\">Internet Explorer</a>, <a href=\"https://chrome.google.com/\">Google Chrome</a>, eller <a href=\"https://mozilla.org/firefox/\">Firefox</a>."
|
147
|
+
turn_off_compatibility_view: "Om du använder IE 9 eller senare, se till att <a href=\"https://support.microsoft.com/sv-se/help/17471\">stänga av \"Compatibility View\"</a>."
|
129
148
|
access_denied:
|
130
|
-
message: "Du har inte
|
149
|
+
message: "Du har inte behörighet att utföra denna åtgärd."
|
131
150
|
index_list:
|
132
151
|
table: "Tabell"
|
133
152
|
block: "Lista"
|
data/config/locales/tr.yml
CHANGED
@@ -26,17 +26,6 @@ tr:
|
|
26
26
|
buttons:
|
27
27
|
filter: "Filtrele"
|
28
28
|
clear: "Filtreleri Temizle"
|
29
|
-
predicates:
|
30
|
-
contains: "İçerir"
|
31
|
-
equals: "Eşittir"
|
32
|
-
starts_with: "İle başlar"
|
33
|
-
ends_with: "İle biter"
|
34
|
-
greater_than: "Büyüktür"
|
35
|
-
less_than: "Küçüktür"
|
36
|
-
gteq_datetime: "Büyük yada eşit"
|
37
|
-
lteq_datetime: "Küçük yada eşit"
|
38
|
-
from: "Başlangıç"
|
39
|
-
to: "Bitiş"
|
40
29
|
search_status:
|
41
30
|
headline: "Arama"
|
42
31
|
current_scope: "Kapsam:"
|
data/config/locales/uk.yml
CHANGED
@@ -25,12 +25,6 @@ uk:
|
|
25
25
|
filter: "Фільтрувати"
|
26
26
|
clear: "Очистити"
|
27
27
|
predicates:
|
28
|
-
contains: "Містить"
|
29
|
-
equals: "="
|
30
|
-
starts_with: "Починається з"
|
31
|
-
ends_with: "Закінчується"
|
32
|
-
greater_than: "більше"
|
33
|
-
less_than: "менше"
|
34
28
|
from: "від"
|
35
29
|
to: "до"
|
36
30
|
search_status:
|
data/config/locales/vi.yml
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
vi:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
comment:
|
5
|
+
one: "Bình luận"
|
6
|
+
other: "Các bình luận"
|
7
|
+
active_admin/comment:
|
8
|
+
one: "Bình luận"
|
9
|
+
other: "Các bình luận"
|
10
|
+
attributes:
|
11
|
+
active_admin/comment:
|
12
|
+
author_type: "Loại tác giả"
|
13
|
+
body: "Nội dung"
|
14
|
+
created_at: "Đã tạo"
|
15
|
+
namespace: "Namespace"
|
16
|
+
resource_type: "Resource type"
|
17
|
+
updated_at: "Đã cập nhật"
|
2
18
|
active_admin:
|
3
19
|
dashboard: Bảng điều khiển
|
4
20
|
dashboard_welcome:
|
@@ -21,25 +37,20 @@ vi:
|
|
21
37
|
has_many_new: "Thêm mới %{model}"
|
22
38
|
has_many_delete: "Xóa"
|
23
39
|
has_many_remove: "Hủy bỏ"
|
40
|
+
move: "Di chuyển"
|
24
41
|
filters:
|
25
42
|
buttons:
|
26
43
|
filter: "Lọc"
|
27
44
|
clear: "Xóa dữ liệu lọc"
|
28
45
|
predicates:
|
29
|
-
contains: "Có chứa"
|
30
|
-
equals: "Bằng"
|
31
|
-
starts_with: "Bắt đầu với"
|
32
|
-
ends_with: "Kết thúc bởi"
|
33
|
-
greater_than: "Lớn hơn"
|
34
|
-
less_than: "Nhỏ hơn"
|
35
|
-
gteq_datetime: "Lớn hơn hoặc bằng"
|
36
|
-
lteq_datetime: "Nhỏ hơn hoặc bằng"
|
37
46
|
from: "Từ"
|
38
47
|
to: "Đến"
|
48
|
+
scopes:
|
49
|
+
all: "Tất cả"
|
39
50
|
search_status:
|
40
51
|
headline: "Danh sách tìm kiếm:"
|
41
52
|
current_scope: "Phạm vi:"
|
42
|
-
current_filters: "Bộ
|
53
|
+
current_filters: "Bộ lọc hiện tại:"
|
43
54
|
no_current_filters: "Không có"
|
44
55
|
status_tag:
|
45
56
|
"yes": "Có"
|
@@ -47,7 +58,7 @@ vi:
|
|
47
58
|
"unset": "Không Có"
|
48
59
|
main_content: "Xin bổ sung %{model}#main_content để hiển thị nội dung."
|
49
60
|
logout: "Đăng xuất"
|
50
|
-
powered_by: "
|
61
|
+
powered_by: "Bản quyền bởi %{active_admin} %{version}"
|
51
62
|
sidebars:
|
52
63
|
filters: "Bộ Lọc"
|
53
64
|
search_status: "Trạng thái tìm kiếm"
|
@@ -75,12 +86,13 @@ vi:
|
|
75
86
|
one: "Đã xóa thành công 1 %{model}"
|
76
87
|
other: "Đã xóa thành công %{count} %{plural_model}"
|
77
88
|
selection_toggle_explanation: "(Thay đổi lựa chọn)"
|
78
|
-
action_label: "%{title} được chọn"
|
89
|
+
action_label: "%{title} đã được chọn"
|
79
90
|
labels:
|
80
91
|
destroy: "Xóa"
|
81
92
|
comments:
|
82
93
|
created_at: "Đã tạo"
|
83
94
|
resource_type: "Resource Type"
|
95
|
+
author_type: "Loại tác giả"
|
84
96
|
body: "Nội dung"
|
85
97
|
author: "Tác giả"
|
86
98
|
add: "Thêm bình luận"
|
@@ -117,15 +129,22 @@ vi:
|
|
117
129
|
title: "Thay đổi mật khẩu của bạn"
|
118
130
|
submit: "Thay đổi mật khẩu của tôi"
|
119
131
|
unlock:
|
120
|
-
title: "
|
121
|
-
submit: "
|
132
|
+
title: "Gửi lại hướng dẫn mở khoá"
|
133
|
+
submit: "Gửi lại hướng dẫn mở khoá"
|
122
134
|
resend_confirmation_instructions:
|
123
|
-
title: "
|
124
|
-
submit: "
|
135
|
+
title: "Gửi lại hướng dẫn xác nhận"
|
136
|
+
submit: "Gửi lại hướng dẫn xác nhận"
|
125
137
|
links:
|
138
|
+
sign_up: "Đăng ký"
|
126
139
|
sign_in: "Đăng nhập"
|
127
140
|
forgot_your_password: "Quên mật khẩu của bạn?"
|
128
141
|
sign_in_with_omniauth_provider: "Đăng nhập với %{provider}"
|
142
|
+
resend_unlock_instructions: "Gửi lại hướng dẫn mở khoá"
|
143
|
+
resend_confirmation_instructions: "Gửi lại hướng dẫn xác nhận"
|
144
|
+
unsupported_browser:
|
145
|
+
headline: "Vui lòng lưu ý rằng ActiveAdmin không còn hỗ trợ trên Internet Explorer các phiên bản 8 và thấp hơn."
|
146
|
+
recommendation: "Chúng tôi khuyên bạn hãy vào <a href=\"http://browsehappy.com/\">nâng cấp trình duyệt của bạn </a> để cải thiện trải nghiệm của bạn."
|
147
|
+
turn_off_compatibility_view: "Nếu bạn đang sử dụng IE 9 hoặc mới hơn, hãy chắc chắn bạn <a href=\"https://support.microsoft.com/en-us/help/17471\">tắt \"Compatibility View\"</a>."
|
129
148
|
access_denied:
|
130
149
|
message: "Bạn không có quyền thực hiện tính năng này"
|
131
150
|
index_list:
|
data/config/locales/zh-CN.yml
CHANGED
@@ -1,4 +1,20 @@
|
|
1
1
|
"zh-CN":
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
comment:
|
5
|
+
one: "评论"
|
6
|
+
other: "评论"
|
7
|
+
active_admin/comment:
|
8
|
+
one: "评论"
|
9
|
+
other: "评论"
|
10
|
+
attributes:
|
11
|
+
active_admin/comment:
|
12
|
+
author_type: "作者类型"
|
13
|
+
body: "内容"
|
14
|
+
created_at: "创建"
|
15
|
+
namespace: "Namespace"
|
16
|
+
resource_type: "Resource 类型"
|
17
|
+
updated_at: "更新"
|
2
18
|
active_admin:
|
3
19
|
dashboard: "控制面板"
|
4
20
|
dashboard_welcome:
|
@@ -8,8 +24,8 @@
|
|
8
24
|
edit: "编辑"
|
9
25
|
delete: "删除"
|
10
26
|
delete_confirmation: "确定删除?"
|
11
|
-
create_another: "
|
12
|
-
new_model: "
|
27
|
+
create_another: "新增另一个%{model}"
|
28
|
+
new_model: "新增%{model}"
|
13
29
|
edit_model: "编辑%{model}"
|
14
30
|
delete_model: "删除%{model}"
|
15
31
|
details: "%{model}详情"
|
@@ -17,37 +33,32 @@
|
|
17
33
|
empty: "未定义"
|
18
34
|
previous: "上一个"
|
19
35
|
next: "下一个"
|
20
|
-
download: "
|
21
|
-
has_many_new: "
|
36
|
+
download: "下载:"
|
37
|
+
has_many_new: "新增一个%{model}"
|
22
38
|
has_many_delete: "删除"
|
23
39
|
has_many_remove: "清除"
|
40
|
+
move: "移动"
|
24
41
|
filters:
|
25
42
|
buttons:
|
26
43
|
filter: "过滤"
|
27
44
|
clear: "清除条件"
|
28
45
|
predicates:
|
29
|
-
contains: "包含"
|
30
|
-
equals: "等于"
|
31
|
-
starts_with: "开头"
|
32
|
-
ends_with: "完与"
|
33
|
-
greater_than: "大于"
|
34
|
-
less_than: "小于"
|
35
|
-
gteq_datetime: "大于等于"
|
36
|
-
lteq_datetime: "小于等于"
|
37
46
|
from: "起"
|
38
47
|
to: "止"
|
48
|
+
scopes:
|
49
|
+
all: "所有"
|
39
50
|
search_status:
|
40
51
|
headline: "搜索条件:"
|
41
|
-
current_scope: "
|
52
|
+
current_scope: "范围:"
|
42
53
|
current_filters: "过滤条件:"
|
43
54
|
no_current_filters: "无"
|
44
55
|
status_tag:
|
45
56
|
"yes": "是"
|
46
57
|
"no": "否"
|
47
58
|
"unset": "否"
|
48
|
-
main_content: "请执行 %{model}#main_content
|
59
|
+
main_content: "请执行 %{model}#main_content 来显示内容。"
|
49
60
|
logout: "退出"
|
50
|
-
powered_by: "
|
61
|
+
powered_by: "构建程序为 %{active_admin} %{version}"
|
51
62
|
sidebars:
|
52
63
|
filters: "所有条件"
|
53
64
|
search_status: "搜索条件"
|
@@ -63,14 +74,14 @@
|
|
63
74
|
other: "条目"
|
64
75
|
any: "任何"
|
65
76
|
blank_slate:
|
66
|
-
content: "暂时还没有%{resource_name}
|
67
|
-
link: "
|
77
|
+
content: "暂时还没有%{resource_name}。"
|
78
|
+
link: "新增一个"
|
68
79
|
dropdown_actions:
|
69
|
-
button_label: "
|
80
|
+
button_label: "操作"
|
70
81
|
batch_actions:
|
71
82
|
button_label: "批处理"
|
72
|
-
default_confirmation: "
|
73
|
-
delete_confirmation: "你确定要删除这些%{plural_model}
|
83
|
+
default_confirmation: "你确定要这样做?"
|
84
|
+
delete_confirmation: "你确定要删除这些%{plural_model}?"
|
74
85
|
succesfully_destroyed:
|
75
86
|
one: "成功删除 1 %{model}"
|
76
87
|
other: "成功删除 %{count} %{plural_model}"
|
@@ -92,7 +103,7 @@
|
|
92
103
|
author_missing: "匿名"
|
93
104
|
title_content: "(%{count})条评论"
|
94
105
|
errors:
|
95
|
-
empty_text: "
|
106
|
+
empty_text: "评论保存失败,内空不能为空。"
|
96
107
|
devise:
|
97
108
|
username:
|
98
109
|
title: "用户名"
|
@@ -121,8 +132,8 @@
|
|
121
132
|
title: "重新发送送解锁命令"
|
122
133
|
submit: "重新发送送解锁命令"
|
123
134
|
resend_confirmation_instructions:
|
124
|
-
title: "
|
125
|
-
submit: "
|
135
|
+
title: " 重新发送确认说明"
|
136
|
+
submit: " 重新发送确认说明"
|
126
137
|
links:
|
127
138
|
sign_up: "注册"
|
128
139
|
sign_in: "登录"
|
data/config/locales/zh-TW.yml
CHANGED
@@ -76,7 +76,7 @@ module ActiveAdmin
|
|
76
76
|
|
77
77
|
namespace = namespaces[name.to_sym] ||= begin
|
78
78
|
namespace = Namespace.new(self, name)
|
79
|
-
ActiveSupport::Notifications.instrument ActiveAdmin::Namespace::RegisterEvent, namespace
|
79
|
+
ActiveSupport::Notifications.instrument ActiveAdmin::Namespace::RegisterEvent, { active_admin_namespace: namespace }
|
80
80
|
namespace
|
81
81
|
end
|
82
82
|
|
@@ -112,10 +112,10 @@ module ActiveAdmin
|
|
112
112
|
# To reload everything simply call `ActiveAdmin.unload!`
|
113
113
|
def load!
|
114
114
|
unless loaded?
|
115
|
-
ActiveSupport::Notifications.instrument BeforeLoadEvent, self # before_load hook
|
115
|
+
ActiveSupport::Notifications.instrument BeforeLoadEvent, { active_admin_application: self } # before_load hook
|
116
116
|
files.each { |file| load file } # load files
|
117
117
|
namespace(default_namespace) # init AA resources
|
118
|
-
ActiveSupport::Notifications.instrument AfterLoadEvent, self # after_load hook
|
118
|
+
ActiveSupport::Notifications.instrument AfterLoadEvent, { active_admin_application: self } # after_load hook
|
119
119
|
@@loaded = true
|
120
120
|
end
|
121
121
|
end
|
@@ -126,7 +126,7 @@ module ActiveAdmin
|
|
126
126
|
|
127
127
|
# Returns ALL the files to be loaded
|
128
128
|
def files
|
129
|
-
load_paths.flatten.compact.uniq.flat_map { |path| Dir["#{path}/**/*.rb"] }
|
129
|
+
load_paths.flatten.compact.uniq.flat_map { |path| Dir["#{path}/**/*.rb"].sort }
|
130
130
|
end
|
131
131
|
|
132
132
|
# Creates all the necessary routes for the ActiveAdmin configurations
|
@@ -14,12 +14,12 @@ module ActiveAdmin
|
|
14
14
|
stylesheets.clear
|
15
15
|
end
|
16
16
|
|
17
|
-
def register_javascript(
|
18
|
-
javascripts
|
17
|
+
def register_javascript(path, options = {})
|
18
|
+
javascripts[path] = options
|
19
19
|
end
|
20
20
|
|
21
21
|
def javascripts
|
22
|
-
@javascripts ||=
|
22
|
+
@javascripts ||= {}
|
23
23
|
end
|
24
24
|
|
25
25
|
def clear_javascripts!
|
@@ -7,9 +7,9 @@ module ActiveAdmin
|
|
7
7
|
ACTIONS_DICTIONARY = {
|
8
8
|
index: ActiveAdmin::Authorization::READ,
|
9
9
|
show: ActiveAdmin::Authorization::READ,
|
10
|
-
new: ActiveAdmin::Authorization::
|
10
|
+
new: ActiveAdmin::Authorization::NEW,
|
11
11
|
create: ActiveAdmin::Authorization::CREATE,
|
12
|
-
edit: ActiveAdmin::Authorization::
|
12
|
+
edit: ActiveAdmin::Authorization::EDIT,
|
13
13
|
update: ActiveAdmin::Authorization::UPDATE,
|
14
14
|
destroy: ActiveAdmin::Authorization::DESTROY
|
15
15
|
}
|
@@ -51,7 +51,7 @@ module ActiveAdmin
|
|
51
51
|
csv << bom if bom
|
52
52
|
|
53
53
|
if column_names
|
54
|
-
csv << CSV.generate_line(columns.map { |c| encode
|
54
|
+
csv << CSV.generate_line(columns.map { |c| sanitize(encode(c.name, options)) }, **csv_options)
|
55
55
|
end
|
56
56
|
|
57
57
|
controller.send(:in_paginated_batches) do |resource|
|
@@ -70,7 +70,7 @@ module ActiveAdmin
|
|
70
70
|
|
71
71
|
def build_row(resource, columns, options)
|
72
72
|
columns.map do |column|
|
73
|
-
encode
|
73
|
+
sanitize(encode(call_method_or_proc_on(resource, column.data), options))
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
@@ -86,6 +86,10 @@ module ActiveAdmin
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
def sanitize(content)
|
90
|
+
Sanitizer.sanitize(content)
|
91
|
+
end
|
92
|
+
|
89
93
|
def method_missing(method, *args, &block)
|
90
94
|
if @view_context.respond_to? method
|
91
95
|
@view_context.public_send method, *args, &block
|
@@ -120,4 +124,21 @@ module ActiveAdmin
|
|
120
124
|
@column_transitive_options ||= @options.slice(*COLUMN_TRANSITIVE_OPTIONS)
|
121
125
|
end
|
122
126
|
end
|
127
|
+
|
128
|
+
# Prevents CSV Injection according to https://owasp.org/www-community/attacks/CSV_Injection
|
129
|
+
module Sanitizer
|
130
|
+
extend self
|
131
|
+
|
132
|
+
ATTACK_CHARACTERS = ["=", "+", "-", "@", "\t", "\r"].freeze
|
133
|
+
|
134
|
+
def sanitize(value)
|
135
|
+
return "'#{value}" if require_sanitization?(value)
|
136
|
+
|
137
|
+
value
|
138
|
+
end
|
139
|
+
|
140
|
+
def require_sanitization?(value)
|
141
|
+
value.is_a?(String) && value.starts_with?(*ATTACK_CHARACTERS)
|
142
|
+
end
|
143
|
+
end
|
123
144
|
end
|
data/lib/active_admin/engine.rb
CHANGED
@@ -12,7 +12,7 @@ module ActiveAdmin
|
|
12
12
|
ActiveAdmin.application.stylesheets.each do |path, _|
|
13
13
|
app.config.assets.precompile << path
|
14
14
|
end
|
15
|
-
ActiveAdmin.application.javascripts.each do |path|
|
15
|
+
ActiveAdmin.application.javascripts.each do |path, _|
|
16
16
|
app.config.assets.precompile << path
|
17
17
|
end
|
18
18
|
end
|
@@ -21,5 +21,9 @@ module ActiveAdmin
|
|
21
21
|
initializer "active_admin.routes" do
|
22
22
|
require "active_admin/helpers/routes/url_helpers"
|
23
23
|
end
|
24
|
+
|
25
|
+
initializer "active_admin.deprecator" do |app|
|
26
|
+
app.deprecators[:activeadmin] = ActiveAdmin.deprecator if app.respond_to?(:deprecators)
|
27
|
+
end
|
24
28
|
end
|
25
29
|
end
|
@@ -21,7 +21,7 @@ module ActiveAdmin
|
|
21
21
|
# Returns the default filter type for a given attribute. If you want
|
22
22
|
# to use a custom search method, you have to specify the type yourself.
|
23
23
|
def default_input_type(method, options = {})
|
24
|
-
if method =~ /_(eq|
|
24
|
+
if method =~ /_(eq|cont|start|end)\z/
|
25
25
|
:string
|
26
26
|
elsif klass._ransackers.key?(method.to_s)
|
27
27
|
klass._ransackers[method.to_s].type
|
@@ -31,7 +31,7 @@ module ActiveAdmin
|
|
31
31
|
case column.type
|
32
32
|
when :date, :datetime
|
33
33
|
:date_range
|
34
|
-
when :string, :text
|
34
|
+
when :string, :text, :citext
|
35
35
|
:string
|
36
36
|
when :integer, :float, :decimal
|
37
37
|
:numeric
|
@@ -47,7 +47,7 @@ module ActiveAdmin
|
|
47
47
|
#
|
48
48
|
|
49
49
|
def searchable_has_many_through?
|
50
|
-
if reflection && reflection.options[:through]
|
50
|
+
if klass.ransackable_associations.include?(method.to_s) && reflection && reflection.options[:through]
|
51
51
|
reflection.through_reflection.klass.ransackable_attributes.include? reflection.foreign_key
|
52
52
|
else
|
53
53
|
false
|