activeadmin 2.13.1 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of activeadmin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -0
- data/CONTRIBUTING.md +3 -4
- data/README.md +2 -2
- data/app/assets/javascripts/active_admin/base.js +1 -4
- data/app/assets/stylesheets/active_admin/_forms.scss +1 -1
- data/app/assets/stylesheets/active_admin/structure/_footer.scss +6 -1
- data/app/views/layouts/active_admin_logged_out.html.erb +5 -4
- data/config/locales/fr.yml +3 -3
- data/config/locales/vi.yml +34 -7
- data/config/locales/zh-CN.yml +36 -17
- 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/dependency.rb +0 -4
- data/lib/active_admin/engine.rb +1 -1
- data/lib/active_admin/filters/resource_extension.rb +4 -4
- 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 +0 -2
- data/lib/active_admin/resource/action_items.rb +2 -2
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_helpers/auto_link_helper.rb +1 -1
- data/lib/active_admin/views/index_as_table.rb +1 -1
- data/lib/active_admin/views/pages/base.rb +4 -3
- data/lib/active_admin/views/pages/index.rb +1 -1
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +17 -0
- metadata +5 -44
- 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 -238
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e192ee32c6a28d748f4fe6a3c82aba50933295ca915ccb3b5d4f283749dd8ae4
|
4
|
+
data.tar.gz: b3440f204e78159fbff127db9085c81d921a23aacc11828dc1a95c54e1291096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b757b6e53f0385ac472b370b92e9cfff96ad10a04551322c27d3fde495b4f5a8f43d6c54ff19d6d32ca7d39db631759c3d8a76a491ad27d7ba38490ecdbce7ab
|
7
|
+
data.tar.gz: 03a6f3c614b350d6fafc130c1aebf31f0ba854ef06304bac52800cce61ce7dc26a674f07f2ead5032e89740e9f7e016bb1619f91e1e08e944f923ce5c76301c2
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,38 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 2.14.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.13.1..v2.14.0)
|
6
|
+
|
7
|
+
### Enhancements
|
8
|
+
|
9
|
+
* Add csp_meta_tag to layout. [#7986] by [@javierjulio]
|
10
|
+
* Update config.register_javascript with options support. [#7002] by [@lanzhiheng]
|
11
|
+
* Use `csrf_meta_tags` in place of singular version. [#7985] by [@javierjulio]
|
12
|
+
* Allow different new and edit rules in authorization adapters. [#6535] by [@timwis]
|
13
|
+
|
14
|
+
### Bug Fixes
|
15
|
+
|
16
|
+
* Fix form layout for hints and checkboxes. [#7772] by [@JewelSam]
|
17
|
+
* Update filters disabled error to include specific action. [#6195] by [@javawizard]
|
18
|
+
* Fix Comments controller destroy declaration. [#6482] by [@bliof]
|
19
|
+
* Stop pagination elements from overflowing outside of panel container. [#7599] by [@ray-curran]
|
20
|
+
|
21
|
+
### Translation Improvements
|
22
|
+
|
23
|
+
* Update vi locale with more translations. [#7984] by [@rs-phunt]
|
24
|
+
* Update zh-CN locale with multiple corrections. [#7944] by [@hfl]
|
25
|
+
* Fix typo in Vietnamese locale for filter text. [#7920] by [@tvziet]
|
26
|
+
* Improve French translation. [#7653] by [@cprodhomme]
|
27
|
+
|
28
|
+
### Documentation
|
29
|
+
|
30
|
+
* Add more documentation about PORO decorator requirements. [#7556] by [@sanfrecce-osaka]
|
31
|
+
* Add Load Paths docs to the active_admin.rb template. [#7541] by [@gabo-cs]
|
32
|
+
|
33
|
+
### Performance
|
34
|
+
|
35
|
+
* Removes docs from exported gem. [#7013] by [@brunoarueira]
|
36
|
+
|
5
37
|
## 2.13.1 [☰](https://github.com/activeadmin/activeadmin/compare/v2.13.0..v2.13.1)
|
6
38
|
|
7
39
|
### Bug Fixes
|
@@ -743,6 +775,7 @@ Please check [0-6-stable] for previous changes.
|
|
743
775
|
[#6099]: https://github.com/activeadmin/activeadmin/pull/6099
|
744
776
|
[#6124]: https://github.com/activeadmin/activeadmin/pull/6124
|
745
777
|
[#6149]: https://github.com/activeadmin/activeadmin/pull/6149
|
778
|
+
[#6195]: https://github.com/activeadmin/activeadmin/pull/6195
|
746
779
|
[#6198]: https://github.com/activeadmin/activeadmin/pull/6198
|
747
780
|
[#6210]: https://github.com/activeadmin/activeadmin/pull/6210
|
748
781
|
[#6221]: https://github.com/activeadmin/activeadmin/pull/6221
|
@@ -757,8 +790,10 @@ Please check [0-6-stable] for previous changes.
|
|
757
790
|
[#6451]: https://github.com/activeadmin/activeadmin/pull/6451
|
758
791
|
[#6460]: https://github.com/activeadmin/activeadmin/pull/6460
|
759
792
|
[#6462]: https://github.com/activeadmin/activeadmin/pull/6462
|
793
|
+
[#6482]: https://github.com/activeadmin/activeadmin/pull/6482
|
760
794
|
[#6487]: https://github.com/activeadmin/activeadmin/pull/6487
|
761
795
|
[#6523]: https://github.com/activeadmin/activeadmin/pull/6523
|
796
|
+
[#6535]: https://github.com/activeadmin/activeadmin/pull/6535
|
762
797
|
[#6536]: https://github.com/activeadmin/activeadmin/pull/6536
|
763
798
|
[#6548]: https://github.com/activeadmin/activeadmin/pull/6548
|
764
799
|
[#6583]: https://github.com/activeadmin/activeadmin/pull/6583
|
@@ -773,6 +808,8 @@ Please check [0-6-stable] for previous changes.
|
|
773
808
|
[#6936]: https://github.com/activeadmin/activeadmin/pull/6936
|
774
809
|
[#6954]: https://github.com/activeadmin/activeadmin/pull/6954
|
775
810
|
[#6959]: https://github.com/activeadmin/activeadmin/pull/6959
|
811
|
+
[#7002]: https://github.com/activeadmin/activeadmin/pull/7002
|
812
|
+
[#7013]: https://github.com/activeadmin/activeadmin/pull/7013
|
776
813
|
[#7095]: https://github.com/activeadmin/activeadmin/pull/7095
|
777
814
|
[#7127]: https://github.com/activeadmin/activeadmin/pull/7127
|
778
815
|
[#7144]: https://github.com/activeadmin/activeadmin/pull/7144
|
@@ -798,6 +835,16 @@ Please check [0-6-stable] for previous changes.
|
|
798
835
|
[#7479]: https://github.com/activeadmin/activeadmin/pull/7479
|
799
836
|
[#7487]: https://github.com/activeadmin/activeadmin/pull/7487
|
800
837
|
[#7488]: https://github.com/activeadmin/activeadmin/pull/7488
|
838
|
+
[#7541]: https://github.com/activeadmin/activeadmin/pull/7541
|
839
|
+
[#7556]: https://github.com/activeadmin/activeadmin/pull/7556
|
840
|
+
[#7599]: https://github.com/activeadmin/activeadmin/pull/7599
|
841
|
+
[#7653]: https://github.com/activeadmin/activeadmin/pull/7653
|
842
|
+
[#7772]: https://github.com/activeadmin/activeadmin/pull/7772
|
843
|
+
[#7920]: https://github.com/activeadmin/activeadmin/pull/7920
|
844
|
+
[#7944]: https://github.com/activeadmin/activeadmin/pull/7944
|
845
|
+
[#7984]: https://github.com/activeadmin/activeadmin/pull/7984
|
846
|
+
[#7985]: https://github.com/activeadmin/activeadmin/pull/7985
|
847
|
+
[#7986]: https://github.com/activeadmin/activeadmin/pull/7986
|
801
848
|
|
802
849
|
[@1000ship]: https://github.com/1000ship
|
803
850
|
[@5t111111]: https://github.com/5t111111
|
@@ -812,8 +859,10 @@ Please check [0-6-stable] for previous changes.
|
|
812
859
|
[@amiuhle]: https://github.com/amiuhle
|
813
860
|
[@andreslemik]: https://github.com/andreslemik
|
814
861
|
[@bartoszkopinski]: https://github.com/bartoszkopinski
|
862
|
+
[@bliof]: https://github.com/bliof
|
815
863
|
[@blocknotes]: https://github.com/blocknotes
|
816
864
|
[@bolshakov]: https://github.com/bolshakov
|
865
|
+
[@brunoarueira]: https://github.com/brunoarueira
|
817
866
|
[@brunvez]: https://github.com/brunvez
|
818
867
|
[@buren]: https://github.com/buren
|
819
868
|
[@chancancode]: https://github.com/chancancode
|
@@ -835,12 +884,14 @@ Please check [0-6-stable] for previous changes.
|
|
835
884
|
[@Fivell]: https://github.com/Fivell
|
836
885
|
[@Fs00]: https://github.com/Fs00
|
837
886
|
[@fuzziness]: https://github.com/fuzziness
|
887
|
+
[@gabo-cs]: https://github.com/gabo-cs
|
838
888
|
[@giapnhdev]: https://github.com/giapnhdev
|
839
889
|
[@gigorok]: https://github.com/gigorok
|
840
890
|
[@glebtv]: https://github.com/glebtv
|
841
891
|
[@gonzedge]: https://github.com/gonzedge
|
842
892
|
[@guigs]: https://github.com/guigs
|
843
893
|
[@HappyKadaver]: https://github.com/HappyKadaver
|
894
|
+
[@hfl]: https://github.com/hfl
|
844
895
|
[@imcvampire]: https://github.com/imcvampire
|
845
896
|
[@innparusu95]: https://github.com/innparusu95
|
846
897
|
[@ionut998]: https://github.com/ionut998
|
@@ -852,6 +903,7 @@ Please check [0-6-stable] for previous changes.
|
|
852
903
|
[@javierjulio]: https://github.com/javierjulio
|
853
904
|
[@jawa]: https://github.com/jawa
|
854
905
|
[@jaynetics]: https://github.com/jaynetics
|
906
|
+
[@JewelSam]: https://github.com/JewelSam
|
855
907
|
[@JiiHu]: https://github.com/JiiHu
|
856
908
|
[@jiikko]: https://github.com/jiikko
|
857
909
|
[@johnnyshields]: https://github.com/johnnyshields
|
@@ -865,6 +917,7 @@ Please check [0-6-stable] for previous changes.
|
|
865
917
|
[@Kris-LIBIS]: https://github.com/Kris-LIBIS
|
866
918
|
[@krzcho]: https://github.com/krzcho
|
867
919
|
[@kwent]: https://github.com/kwent
|
920
|
+
[@lanzhiheng]: https://github.com/lanzhiheng
|
868
921
|
[@leio10]: https://github.com/leio10
|
869
922
|
[@littleforest]: https://github.com/littleforest
|
870
923
|
[@Looooong]: https://github.com/Looooong
|
@@ -887,11 +940,14 @@ Please check [0-6-stable] for previous changes.
|
|
887
940
|
[@PChambino]: https://github.com/PChambino
|
888
941
|
[@potatosalad]: https://github.com/potatosalad
|
889
942
|
[@pranas]: https://github.com/pranas
|
943
|
+
[@ray-curran]: https://github.com/ray-curran
|
890
944
|
[@renotocn]: https://github.com/renotocn
|
891
945
|
[@rn0rno]: https://github.com/rn0rno
|
892
946
|
[@RobinvanderVliet]: https://github.com/RobinvanderVliet
|
893
947
|
[@rogerkk]: https://github.com/rogerkk
|
894
948
|
[@roramirez]: https://github.com/roramirez
|
949
|
+
[@rs-phunt]: https://github.com/rs-phunt
|
950
|
+
[@sanfrecce-osaka]: https://github.com/sanfrecce-osaka
|
895
951
|
[@seanlinsley]: https://github.com/seanlinsley
|
896
952
|
[@sergey-alekseev]: https://github.com/sergey-alekseev
|
897
953
|
[@sgara]: https://github.com/sgara
|
@@ -908,9 +964,11 @@ Please check [0-6-stable] for previous changes.
|
|
908
964
|
[@tiagotex]: https://github.com/tiagotex
|
909
965
|
[@timoschilling]: https://github.com/timoschilling
|
910
966
|
[@TimPetricola]: https://github.com/TimPetricola
|
967
|
+
[@timwis]: https://github.com/timwis
|
911
968
|
[@tomgilligan]: https://github.com/tomgilligan
|
912
969
|
[@TonyArra]: https://github.com/TonyArra
|
913
970
|
[@tordans]: https://github.com/tordans
|
971
|
+
[@tvziet]: https://github.com/tvziet
|
914
972
|
[@utkarsh2102]: https://github.com/utkarsh2102
|
915
973
|
[@varyonic]: https://github.com/varyonic
|
916
974
|
[@vcsjones]: https://github.com/vcsjones
|
data/CONTRIBUTING.md
CHANGED
@@ -25,8 +25,7 @@ git checkout -b 325-add-japanese-translations
|
|
25
25
|
|
26
26
|
### Get the test suite running
|
27
27
|
|
28
|
-
Make sure you're using a recent
|
29
|
-
least version `1.14.3`.
|
28
|
+
Make sure you're using a recent Ruby version.
|
30
29
|
|
31
30
|
You'll also need chrome installed in order to run cucumber scenarios.
|
32
31
|
|
@@ -56,8 +55,8 @@ Now you should be able to run the entire suite using:
|
|
56
55
|
bin/rake
|
57
56
|
```
|
58
57
|
|
59
|
-
The
|
60
|
-
|
58
|
+
The task will generate a sample Rails application in `tmp/test_apps` to run the
|
59
|
+
test suite against.
|
61
60
|
|
62
61
|
If you want to test against a Rails version different from the latest, make sure
|
63
62
|
you use the correct Gemfile, for example:
|
data/README.md
CHANGED
@@ -95,8 +95,8 @@ Thanks to [Open Collective][opencollective contributors] and all our Open Collec
|
|
95
95
|
[rubygems]: https://rubygems.org/gems/activeadmin
|
96
96
|
[actions_badge]: https://github.com/activeadmin/activeadmin/workflows/ci/badge.svg
|
97
97
|
[actions]: https://github.com/activeadmin/activeadmin/actions
|
98
|
-
[coverage_badge]: https://
|
99
|
-
[coverage]: https://
|
98
|
+
[coverage_badge]: https://codecov.io/gh/activeadmin/activeadmin/branch/master/graph/badge.svg?token=NAjeBdkQXW
|
99
|
+
[coverage]: https://codecov.io/gh/activeadmin/activeadmin
|
100
100
|
[inch_badge]: http://inch-ci.org/github/activeadmin/activeadmin.svg?branch=master
|
101
101
|
[inch]: http://inch-ci.org/github/activeadmin/activeadmin
|
102
102
|
[tidelift_badge]: https://tidelift.com/badges/github/activeadmin/activeadmin
|
@@ -474,7 +474,7 @@
|
|
474
474
|
_setPrototypeOf(subClass, superClass);
|
475
475
|
}
|
476
476
|
function _setPrototypeOf(o, p) {
|
477
|
-
_setPrototypeOf = Object.setPrototypeOf
|
477
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
478
478
|
o.__proto__ = p;
|
479
479
|
return o;
|
480
480
|
};
|
@@ -518,7 +518,4 @@
|
|
518
518
|
}
|
519
519
|
exports.ModalDialog = ModalDialog;
|
520
520
|
exports.modal_dialog = modal_dialog;
|
521
|
-
Object.defineProperty(exports, "__esModule", {
|
522
|
-
value: true
|
523
|
-
});
|
524
521
|
});
|
@@ -9,6 +9,11 @@
|
|
9
9
|
}
|
10
10
|
|
11
11
|
// -------------------------------------- Index Footer (Under Table)
|
12
|
-
#index_footer {
|
12
|
+
#index_footer {
|
13
|
+
@include clearfix;
|
14
|
+
padding-top: 5px;
|
15
|
+
text-align: right;
|
16
|
+
font-size: 0.85em;
|
17
|
+
}
|
13
18
|
|
14
19
|
.index_content { clear: both; }
|
@@ -12,11 +12,11 @@
|
|
12
12
|
<%= stylesheet_link_tag style, **options %>
|
13
13
|
<% end %>
|
14
14
|
<% end %>
|
15
|
-
<% ActiveAdmin.application.javascripts.each do |path| %>
|
15
|
+
<% ActiveAdmin.application.javascripts.each do |path, options| %>
|
16
16
|
<% if ActiveAdmin.application.use_webpacker %>
|
17
|
-
<%= javascript_pack_tag path %>
|
17
|
+
<%= javascript_pack_tag path, **options %>
|
18
18
|
<% else %>
|
19
|
-
<%= javascript_include_tag path %>
|
19
|
+
<%= javascript_include_tag path, **options %>
|
20
20
|
<% end %>
|
21
21
|
<% end %>
|
22
22
|
|
@@ -26,7 +26,8 @@
|
|
26
26
|
<%= tag(:meta, name: name, content: content) %>
|
27
27
|
<% end %>
|
28
28
|
|
29
|
-
<%=
|
29
|
+
<%= csrf_meta_tags %>
|
30
|
+
<%= csp_meta_tag %>
|
30
31
|
</head>
|
31
32
|
<body class="active_admin logged_out <%= controller.action_name %>">
|
32
33
|
<div id="wrapper">
|
data/config/locales/fr.yml
CHANGED
@@ -38,9 +38,9 @@ fr:
|
|
38
38
|
to: "À"
|
39
39
|
search_status:
|
40
40
|
headline: "Statut de la recherche :"
|
41
|
-
current_scope: "
|
41
|
+
current_scope: "Périmètre :"
|
42
42
|
current_filters: "Filtres actuels :"
|
43
|
-
no_current_filters: "Aucun
|
43
|
+
no_current_filters: "Aucun filtre"
|
44
44
|
status_tag:
|
45
45
|
"yes": "Oui"
|
46
46
|
"no": "Non"
|
@@ -52,7 +52,7 @@ fr:
|
|
52
52
|
filters: "Filtres"
|
53
53
|
search_status: "Statut de la recherche"
|
54
54
|
pagination:
|
55
|
-
empty: "Aucun %{model} trouvé"
|
55
|
+
empty: "Aucun(e) %{model} trouvé(e)"
|
56
56
|
one: "Affichage de <b>1</b> %{model}"
|
57
57
|
one_page: "Affichage des <b>%{n}</b> %{model}"
|
58
58
|
multiple: "Affichage de %{model} <b>%{from} - %{to}</b> sur un total de <b>%{total}</b>"
|
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,6 +37,7 @@ 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"
|
@@ -36,10 +53,12 @@ vi:
|
|
36
53
|
lteq_datetime: "Nhỏ hơn hoặc bằng"
|
37
54
|
from: "Từ"
|
38
55
|
to: "Đến"
|
56
|
+
scopes:
|
57
|
+
all: "Tất cả"
|
39
58
|
search_status:
|
40
59
|
headline: "Danh sách tìm kiếm:"
|
41
60
|
current_scope: "Phạm vi:"
|
42
|
-
current_filters: "Bộ
|
61
|
+
current_filters: "Bộ lọc hiện tại:"
|
43
62
|
no_current_filters: "Không có"
|
44
63
|
status_tag:
|
45
64
|
"yes": "Có"
|
@@ -47,7 +66,7 @@ vi:
|
|
47
66
|
"unset": "Không Có"
|
48
67
|
main_content: "Xin bổ sung %{model}#main_content để hiển thị nội dung."
|
49
68
|
logout: "Đăng xuất"
|
50
|
-
powered_by: "
|
69
|
+
powered_by: "Bản quyền bởi %{active_admin} %{version}"
|
51
70
|
sidebars:
|
52
71
|
filters: "Bộ Lọc"
|
53
72
|
search_status: "Trạng thái tìm kiếm"
|
@@ -75,12 +94,13 @@ vi:
|
|
75
94
|
one: "Đã xóa thành công 1 %{model}"
|
76
95
|
other: "Đã xóa thành công %{count} %{plural_model}"
|
77
96
|
selection_toggle_explanation: "(Thay đổi lựa chọn)"
|
78
|
-
action_label: "%{title} được chọn"
|
97
|
+
action_label: "%{title} đã được chọn"
|
79
98
|
labels:
|
80
99
|
destroy: "Xóa"
|
81
100
|
comments:
|
82
101
|
created_at: "Đã tạo"
|
83
102
|
resource_type: "Resource Type"
|
103
|
+
author_type: "Loại tác giả"
|
84
104
|
body: "Nội dung"
|
85
105
|
author: "Tác giả"
|
86
106
|
add: "Thêm bình luận"
|
@@ -117,15 +137,22 @@ vi:
|
|
117
137
|
title: "Thay đổi mật khẩu của bạn"
|
118
138
|
submit: "Thay đổi mật khẩu của tôi"
|
119
139
|
unlock:
|
120
|
-
title: "
|
121
|
-
submit: "
|
140
|
+
title: "Gửi lại hướng dẫn mở khoá"
|
141
|
+
submit: "Gửi lại hướng dẫn mở khoá"
|
122
142
|
resend_confirmation_instructions:
|
123
|
-
title: "
|
124
|
-
submit: "
|
143
|
+
title: "Gửi lại hướng dẫn xác nhận"
|
144
|
+
submit: "Gửi lại hướng dẫn xác nhận"
|
125
145
|
links:
|
146
|
+
sign_up: "Đăng ký"
|
126
147
|
sign_in: "Đăng nhập"
|
127
148
|
forgot_your_password: "Quên mật khẩu của bạn?"
|
128
149
|
sign_in_with_omniauth_provider: "Đăng nhập với %{provider}"
|
150
|
+
resend_unlock_instructions: "Gửi lại hướng dẫn mở khoá"
|
151
|
+
resend_confirmation_instructions: "Gửi lại hướng dẫn xác nhận"
|
152
|
+
unsupported_browser:
|
153
|
+
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."
|
154
|
+
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."
|
155
|
+
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
156
|
access_denied:
|
130
157
|
message: "Bạn không có quyền thực hiện tính năng này"
|
131
158
|
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,10 +33,11 @@
|
|
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: "过滤"
|
@@ -28,26 +45,28 @@
|
|
28
45
|
predicates:
|
29
46
|
contains: "包含"
|
30
47
|
equals: "等于"
|
31
|
-
starts_with: "
|
32
|
-
ends_with: "
|
48
|
+
starts_with: "始于"
|
49
|
+
ends_with: "止于"
|
33
50
|
greater_than: "大于"
|
34
51
|
less_than: "小于"
|
35
52
|
gteq_datetime: "大于等于"
|
36
53
|
lteq_datetime: "小于等于"
|
37
54
|
from: "起"
|
38
55
|
to: "止"
|
56
|
+
scopes:
|
57
|
+
all: "所有"
|
39
58
|
search_status:
|
40
59
|
headline: "搜索条件:"
|
41
|
-
current_scope: "
|
60
|
+
current_scope: "范围:"
|
42
61
|
current_filters: "过滤条件:"
|
43
62
|
no_current_filters: "无"
|
44
63
|
status_tag:
|
45
64
|
"yes": "是"
|
46
65
|
"no": "否"
|
47
66
|
"unset": "否"
|
48
|
-
main_content: "请执行 %{model}#main_content
|
67
|
+
main_content: "请执行 %{model}#main_content 来显示内容。"
|
49
68
|
logout: "退出"
|
50
|
-
powered_by: "
|
69
|
+
powered_by: "构建程序为 %{active_admin} %{version}"
|
51
70
|
sidebars:
|
52
71
|
filters: "所有条件"
|
53
72
|
search_status: "搜索条件"
|
@@ -63,14 +82,14 @@
|
|
63
82
|
other: "条目"
|
64
83
|
any: "任何"
|
65
84
|
blank_slate:
|
66
|
-
content: "暂时还没有%{resource_name}
|
67
|
-
link: "
|
85
|
+
content: "暂时还没有%{resource_name}。"
|
86
|
+
link: "新增一个"
|
68
87
|
dropdown_actions:
|
69
|
-
button_label: "
|
88
|
+
button_label: "操作"
|
70
89
|
batch_actions:
|
71
90
|
button_label: "批处理"
|
72
|
-
default_confirmation: "
|
73
|
-
delete_confirmation: "你确定要删除这些%{plural_model}
|
91
|
+
default_confirmation: "你确定要这样做?"
|
92
|
+
delete_confirmation: "你确定要删除这些%{plural_model}?"
|
74
93
|
succesfully_destroyed:
|
75
94
|
one: "成功删除 1 %{model}"
|
76
95
|
other: "成功删除 %{count} %{plural_model}"
|
@@ -92,7 +111,7 @@
|
|
92
111
|
author_missing: "匿名"
|
93
112
|
title_content: "(%{count})条评论"
|
94
113
|
errors:
|
95
|
-
empty_text: "
|
114
|
+
empty_text: "评论保存失败,内空不能为空。"
|
96
115
|
devise:
|
97
116
|
username:
|
98
117
|
title: "用户名"
|
@@ -121,8 +140,8 @@
|
|
121
140
|
title: "重新发送送解锁命令"
|
122
141
|
submit: "重新发送送解锁命令"
|
123
142
|
resend_confirmation_instructions:
|
124
|
-
title: "
|
125
|
-
submit: "
|
143
|
+
title: " 重新发送确认说明"
|
144
|
+
submit: " 重新发送确认说明"
|
126
145
|
links:
|
127
146
|
sign_up: "注册"
|
128
147
|
sign_in: "登录"
|
@@ -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
|
}
|
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
|
@@ -3,8 +3,8 @@ module ActiveAdmin
|
|
3
3
|
module Filters
|
4
4
|
|
5
5
|
class Disabled < RuntimeError
|
6
|
-
def initialize
|
7
|
-
super "
|
6
|
+
def initialize(action)
|
7
|
+
super "Cannot #{action} a filter when filters are disabled. Enable filters with 'config.filters = true'"
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -61,7 +61,7 @@ module ActiveAdmin
|
|
61
61
|
#
|
62
62
|
# @param [Symbol] attributes The attributes to not filter on
|
63
63
|
def remove_filter(*attributes)
|
64
|
-
raise Disabled unless filters_enabled?
|
64
|
+
raise Disabled, "remove" unless filters_enabled?
|
65
65
|
|
66
66
|
attributes.each { |attribute| (@filters_to_remove ||= []) << attribute.to_sym }
|
67
67
|
end
|
@@ -73,7 +73,7 @@ module ActiveAdmin
|
|
73
73
|
# @param [Hash] options The set of options that are passed through to
|
74
74
|
# ransack for the field definition.
|
75
75
|
def add_filter(attribute, options = {})
|
76
|
-
raise Disabled unless filters_enabled?
|
76
|
+
raise Disabled, "add" unless filters_enabled?
|
77
77
|
|
78
78
|
(@filters ||= {})[attribute.to_sym] = options
|
79
79
|
end
|
@@ -72,15 +72,15 @@ ActiveAdmin.after_load do |app|
|
|
72
72
|
redirect_back fallback_location: active_admin_root
|
73
73
|
end
|
74
74
|
end
|
75
|
+
end
|
75
76
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
end
|
77
|
+
def destroy
|
78
|
+
destroy! do |success, failure|
|
79
|
+
success.html do
|
80
|
+
redirect_back fallback_location: active_admin_root
|
81
|
+
end
|
82
|
+
failure.html do
|
83
|
+
redirect_back fallback_location: active_admin_root
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
@@ -44,8 +44,6 @@ module ActiveAdmin
|
|
44
44
|
def format_action(action, subject)
|
45
45
|
# https://github.com/varvet/pundit/blob/master/lib/generators/pundit/install/templates/application_policy.rb
|
46
46
|
case action
|
47
|
-
when Auth::CREATE then :create?
|
48
|
-
when Auth::UPDATE then :update?
|
49
47
|
when Auth::READ then subject.is_a?(Class) ? :index? : :show?
|
50
48
|
when Auth::DESTROY then subject.is_a?(Class) ? :destroy_all? : :destroy?
|
51
49
|
else "#{action}?"
|
@@ -65,7 +65,7 @@ module ActiveAdmin
|
|
65
65
|
# Adds the default New link on index
|
66
66
|
def add_default_new_action_item
|
67
67
|
add_action_item :new, only: :index do
|
68
|
-
if controller.action_methods.include?("new") && authorized?(ActiveAdmin::Auth::
|
68
|
+
if controller.action_methods.include?("new") && authorized?(ActiveAdmin::Auth::NEW, active_admin_config.resource_class)
|
69
69
|
localizer = ActiveAdmin::Localizers.resource(active_admin_config)
|
70
70
|
link_to localizer.t(:new_model), new_resource_path
|
71
71
|
end
|
@@ -75,7 +75,7 @@ module ActiveAdmin
|
|
75
75
|
# Adds the default Edit link on show
|
76
76
|
def add_default_edit_action_item
|
77
77
|
add_action_item :edit, only: :show do
|
78
|
-
if controller.action_methods.include?("edit") && authorized?(ActiveAdmin::Auth::
|
78
|
+
if controller.action_methods.include?("edit") && authorized?(ActiveAdmin::Auth::EDIT, resource)
|
79
79
|
localizer = ActiveAdmin::Localizers.resource(active_admin_config)
|
80
80
|
link_to localizer.t(:edit_model), edit_resource_path(resource)
|
81
81
|
end
|