activeadmin 2.6.0 → 2.8.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.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +90 -7
  3. data/CONTRIBUTING.md +5 -33
  4. data/README.md +1 -1
  5. data/app/assets/javascripts/active_admin/base.js +13 -15
  6. data/app/assets/stylesheets/active_admin/_header.scss +37 -3
  7. data/app/assets/stylesheets/active_admin/components/_comments.scss +2 -2
  8. data/app/assets/stylesheets/active_admin/mixins/_variables.scss +3 -0
  9. data/app/javascript/active_admin/initializers/per-page.js +1 -1
  10. data/app/javascript/active_admin/lib/checkbox-toggler.js +3 -3
  11. data/app/javascript/active_admin/lib/dropdown-menu.js +1 -1
  12. data/app/javascript/active_admin/lib/modal-dialog.js +7 -7
  13. data/app/javascript/active_admin/lib/per-page.js +1 -1
  14. data/app/javascript/active_admin/lib/table-checkbox-toggler.js +1 -1
  15. data/app/views/layouts/active_admin_logged_out.html.erb +15 -5
  16. data/config/locales/ar.yml +6 -6
  17. data/config/locales/en-CA.yml +3 -3
  18. data/config/locales/en-GB.yml +3 -3
  19. data/config/locales/en.yml +3 -3
  20. data/config/locales/es-MX.yml +2 -1
  21. data/config/locales/es.yml +2 -2
  22. data/config/locales/it.yml +18 -0
  23. data/config/locales/ja.yml +3 -3
  24. data/config/locales/lv.yml +2 -2
  25. data/config/locales/vi.yml +6 -5
  26. data/docs/0-installation.md +26 -2
  27. data/docs/11-decorators.md +16 -5
  28. data/docs/2-resource-customization.md +10 -1
  29. data/docs/Gemfile.lock +42 -31
  30. data/docs/_includes/top-menu.html +1 -1
  31. data/docs/documentation.md +1 -1
  32. data/docs/index.html +6 -6
  33. data/lib/active_admin/application.rb +6 -6
  34. data/lib/active_admin/authorization_adapter.rb +3 -3
  35. data/lib/active_admin/base_controller/authorization.rb +9 -9
  36. data/lib/active_admin/batch_actions/controller.rb +3 -3
  37. data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
  38. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +5 -5
  39. data/lib/active_admin/collection_decorator.rb +31 -0
  40. data/lib/active_admin/csv_builder.rb +11 -7
  41. data/lib/active_admin/dependency.rb +7 -7
  42. data/lib/active_admin/filters/forms.rb +3 -3
  43. data/lib/active_admin/filters/resource_extension.rb +1 -1
  44. data/lib/active_admin/filters.rb +1 -1
  45. data/lib/active_admin/form_builder.rb +5 -5
  46. data/lib/active_admin/helpers/optional_display.rb +2 -2
  47. data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
  48. data/lib/active_admin/localizers/resource_localizer.rb +1 -1
  49. data/lib/active_admin/menu.rb +5 -2
  50. data/lib/active_admin/menu_item.rb +7 -7
  51. data/lib/active_admin/namespace.rb +7 -7
  52. data/lib/active_admin/namespace_settings.rb +3 -0
  53. data/lib/active_admin/orm/active_record/comments/comment.rb +3 -3
  54. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +3 -3
  55. data/lib/active_admin/orm/active_record/comments.rb +11 -11
  56. data/lib/active_admin/pundit_adapter.rb +4 -4
  57. data/lib/active_admin/resource/action_items.rb +1 -1
  58. data/lib/active_admin/resource/menu.rb +4 -4
  59. data/lib/active_admin/resource/naming.rb +4 -4
  60. data/lib/active_admin/resource/routes.rb +5 -5
  61. data/lib/active_admin/resource/scope_to.rb +7 -7
  62. data/lib/active_admin/resource_controller/data_access.rb +1 -1
  63. data/lib/active_admin/resource_controller/decorators.rb +5 -25
  64. data/lib/active_admin/resource_controller.rb +4 -3
  65. data/lib/active_admin/resource_dsl.rb +5 -5
  66. data/lib/active_admin/scope.rb +5 -5
  67. data/lib/active_admin/version.rb +1 -1
  68. data/lib/active_admin/view_factory.rb +16 -16
  69. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +1 -1
  70. data/lib/active_admin/view_helpers/display_helper.rb +3 -3
  71. data/lib/active_admin/view_helpers/fields_for.rb +1 -1
  72. data/lib/active_admin/views/components/attributes_table.rb +2 -2
  73. data/lib/active_admin/views/components/dropdown_menu.rb +2 -2
  74. data/lib/active_admin/views/components/index_list.rb +1 -1
  75. data/lib/active_admin/views/components/menu_item.rb +1 -1
  76. data/lib/active_admin/views/components/paginated_collection.rb +14 -14
  77. data/lib/active_admin/views/components/scopes.rb +2 -0
  78. data/lib/active_admin/views/components/table_for.rb +11 -11
  79. data/lib/active_admin/views/components/tabs.rb +1 -1
  80. data/lib/active_admin/views/index_as_table.rb +6 -6
  81. data/lib/active_admin/views/pages/base.rb +4 -2
  82. data/lib/active_admin/views/pages/index.rb +8 -8
  83. data/lib/active_admin.rb +43 -43
  84. data/lib/generators/active_admin/assets/templates/active_admin.scss +2 -2
  85. data/lib/generators/active_admin/devise/devise_generator.rb +4 -4
  86. data/lib/generators/active_admin/install/install_generator.rb +7 -1
  87. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +9 -2
  88. data/lib/generators/active_admin/resource/resource_generator.rb +1 -1
  89. data/lib/generators/active_admin/webpacker/plugins/jquery.js +7 -0
  90. data/lib/generators/active_admin/webpacker/templates/active_admin.js +5 -0
  91. data/lib/generators/active_admin/webpacker/templates/active_admin.scss +17 -0
  92. data/lib/generators/active_admin/webpacker/templates/print.scss +2 -0
  93. data/lib/generators/active_admin/webpacker/webpacker_generator.rb +26 -0
  94. metadata +20 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 31e6adaf39f455cb8188d2982a201d9853a2976e9ae446dcc7958882a6f15422
4
- data.tar.gz: 58b45a79713a68cf75a9e0bb13b7cfe90bf5bf1c01e403375de2acdd4ad16881
3
+ metadata.gz: 1eae0d60f49f4133f9500f31625e24882ac57efa140f8052c87dd65a0cfbd353
4
+ data.tar.gz: 8db6863400174d2ed23adcf9985efff541ef858afe56339822d9cf02411052c4
5
5
  SHA512:
6
- metadata.gz: 2c633c0f35fb6a9a90677e8f13d1c7194c8ff3ec3e267ca9249fd0343f09a319ac15148e8067be5b483fb5feab8d6cc9213208ffc24609b233b3b3335d2ba3ca
7
- data.tar.gz: 815d48181cbdcc9e36ea268217e320f3542a8791b659b931ca51a7a035d478e3cf00fb84f23e5e7021bc015bafd6c28b04add620a3414953ba32e65d8b7a9da3
6
+ metadata.gz: cf3d8b2a337b50a73a5806ce18e2c40c9985d5db2a064d417057b349d172909fb1ed6e248ea271c76e331a76a76578f975e044373dbc0ca5bd2141f0ac365df4
7
+ data.tar.gz: 88b06f52c04bae83a5068301b0013366db174638392a8b850bec32b20ff3e72adfb480335211558319ee671b1a7a28955fbf4334b8ebf89c836107c7b85c1e61
data/CHANGELOG.md CHANGED
@@ -2,9 +2,59 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.8.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.7.0..v2.8.0)
6
+
7
+ ### Enhancements
8
+
9
+ * Allow using PORO decorators. [#6249] by [@brunvez]
10
+ * Make sure `ActiveAdmin.routes` provides routes in a consistent order. [#6124] by [@jiikko]
11
+ * Use proper closing tags for HTML in ModalDialog component. [#6221] by [@javierjulio]
12
+
13
+ ### Bug Fixes
14
+
15
+ * Fix comment layout so regardless of size, each is aligned and spaced evenly. [#6393] by [@Ivanov-Anton]
16
+
17
+ ### Translation Improvements
18
+
19
+ * Fix several Arabic translations. [#6368] by [@mshalaby]
20
+ * Add missing `scope/all` italian translation. [#6341] by [@fuzziness]
21
+ * Improve Japanese translation. [#6315] by [@rn0rno]
22
+ * Fix es and es-MX sign_in and sign_up translation. [#6210] by [@roramirez]
23
+
24
+ ### Documentation
25
+
26
+ * Fix filter_columns_for_large_association and filter_method_for_large_association examples. [#6232] by [@ndbroadbent]
27
+
28
+ ### Dependency Changes
29
+
30
+ * Allow formtastic 4. [#6318] by [@deivid-rodriguez]
31
+ * Drop Ruby 2.4 support. [#6198] by [@deivid-rodriguez]
32
+
33
+ ## 2.7.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.6.1..v2.7.0)
34
+
35
+ ### Enhancements
36
+
37
+ * Extend menu to allow for nested submenus. [#5994] by [@taralbass]
38
+ * Add Webpacker compatibility with opt-in config switch and installation generator. [#5855] by [@sgara]
39
+
40
+ ### Bug Fixes
41
+
42
+ * Fix scopes renderer when resource has only optional scopes and their conditions are false. [#6149] by [@Looooong]
43
+ * Fix some missing wrapper markup in "logged out" layout. [#6086] by [@irmela]
44
+ * Fix some typos in Vietnamese translation. [#6099] by [@giapnhdev]
45
+
46
+ ## 2.6.1 [☰](https://github.com/activeadmin/activeadmin/compare/v2.6.0..v2.6.1)
47
+
48
+ ### Bug Fixes
49
+
50
+ * Fix some ruby 2.7 warnings about keyword args. [#6000] by [@vcsjones]
51
+ * Missing `create_another` translation in Vietnamese. [#6002] by [@imcvampire]
52
+ * Using "destroy" for user facing message is too robotic, prefer "delete". [#6047] by [@vfonic]
53
+ * Typo in confirmation message for comment deletion. [#6047] by [@vfonic]
54
+
5
55
  ## 2.6.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.5.0..v2.6.0)
6
56
 
7
- ### Enhacements
57
+ ### Enhancements
8
58
 
9
59
  * Display multiple flash messages in separate elements. [#5929] by [@mirelon]
10
60
  * Make delete confirmation messages in French & Spanish gender-neutral. [#5946] by [@cprodhomme]
@@ -498,15 +548,16 @@ Please check [0-6-stable] for previous changes.
498
548
  [#5504]: https://github.com/activeadmin/activeadmin/pull/5504
499
549
  [#5517]: https://github.com/activeadmin/activeadmin/pull/5517
500
550
  [#5537]: https://github.com/activeadmin/activeadmin/pull/5537
551
+ [#5548]: https://github.com/activeadmin/activeadmin/pull/5548
501
552
  [#5555]: https://github.com/activeadmin/activeadmin/pull/5555
502
553
  [#5583]: https://github.com/activeadmin/activeadmin/pull/5583
554
+ [#5590]: https://github.com/activeadmin/activeadmin/pull/5590
503
555
  [#5608]: https://github.com/activeadmin/activeadmin/pull/5608
504
556
  [#5611]: https://github.com/activeadmin/activeadmin/pull/5611
505
557
  [#5627]: https://github.com/activeadmin/activeadmin/pull/5627
506
558
  [#5631]: https://github.com/activeadmin/activeadmin/pull/5631
507
559
  [#5632]: https://github.com/activeadmin/activeadmin/pull/5632
508
560
  [#5650]: https://github.com/activeadmin/activeadmin/pull/5650
509
- [#5590]: https://github.com/activeadmin/activeadmin/pull/5590
510
561
  [#5662]: https://github.com/activeadmin/activeadmin/pull/5662
511
562
  [#5710]: https://github.com/activeadmin/activeadmin/pull/5710
512
563
  [#5726]: https://github.com/activeadmin/activeadmin/pull/5726
@@ -524,23 +575,42 @@ Please check [0-6-stable] for previous changes.
524
575
  [#5822]: https://github.com/activeadmin/activeadmin/pull/5822
525
576
  [#5826]: https://github.com/activeadmin/activeadmin/pull/5826
526
577
  [#5831]: https://github.com/activeadmin/activeadmin/pull/5831
527
- [#5548]: https://github.com/activeadmin/activeadmin/pull/5548
528
578
  [#5842]: https://github.com/activeadmin/activeadmin/pull/5842
529
579
  [#5854]: https://github.com/activeadmin/activeadmin/pull/5854
580
+ [#5855]: https://github.com/activeadmin/activeadmin/pull/5855
581
+ [#5867]: https://github.com/activeadmin/activeadmin/pull/5867
582
+ [#5870]: https://github.com/activeadmin/activeadmin/pull/5870
530
583
  [#5874]: https://github.com/activeadmin/activeadmin/pull/5874
531
584
  [#5877]: https://github.com/activeadmin/activeadmin/pull/5877
532
585
  [#5886]: https://github.com/activeadmin/activeadmin/pull/5886
533
- [#5870]: https://github.com/activeadmin/activeadmin/pull/5870
534
- [#5895]: https://github.com/activeadmin/activeadmin/pull/5895
535
- [#5867]: https://github.com/activeadmin/activeadmin/pull/5867
536
586
  [#5887]: https://github.com/activeadmin/activeadmin/pull/5887
587
+ [#5894]: https://github.com/activeadmin/activeadmin/pull/5894
588
+ [#5895]: https://github.com/activeadmin/activeadmin/pull/5895
589
+ [#5929]: https://github.com/activeadmin/activeadmin/pull/5929
537
590
  [#5931]: https://github.com/activeadmin/activeadmin/pull/5931
538
591
  [#5938]: https://github.com/activeadmin/activeadmin/pull/5938
539
- [#5929]: https://github.com/activeadmin/activeadmin/pull/5929
540
592
  [#5943]: https://github.com/activeadmin/activeadmin/pull/5943
541
593
  [#5946]: https://github.com/activeadmin/activeadmin/pull/5946
542
594
  [#5956]: https://github.com/activeadmin/activeadmin/pull/5956
543
595
  [#5957]: https://github.com/activeadmin/activeadmin/pull/5957
596
+ [#5994]: https://github.com/activeadmin/activeadmin/pull/5994
597
+ [#6000]: https://github.com/activeadmin/activeadmin/pull/6000
598
+ [#6002]: https://github.com/activeadmin/activeadmin/pull/6002
599
+ [#6047]: https://github.com/activeadmin/activeadmin/pull/6047
600
+ [#6086]: https://github.com/activeadmin/activeadmin/pull/6086
601
+ [#6099]: https://github.com/activeadmin/activeadmin/pull/6099
602
+ [#6124]: https://github.com/activeadmin/activeadmin/pull/6124
603
+ [#6149]: https://github.com/activeadmin/activeadmin/pull/6149
604
+ [#6198]: https://github.com/activeadmin/activeadmin/pull/6198
605
+ [#6210]: https://github.com/activeadmin/activeadmin/pull/6210
606
+ [#6221]: https://github.com/activeadmin/activeadmin/pull/6221
607
+ [#6232]: https://github.com/activeadmin/activeadmin/pull/6232
608
+ [#6249]: https://github.com/activeadmin/activeadmin/pull/6249
609
+ [#6315]: https://github.com/activeadmin/activeadmin/pull/6315
610
+ [#6318]: https://github.com/activeadmin/activeadmin/pull/6318
611
+ [#6341]: https://github.com/activeadmin/activeadmin/pull/6341
612
+ [#6368]: https://github.com/activeadmin/activeadmin/pull/6368
613
+ [#6393]: https://github.com/activeadmin/activeadmin/pull/6393
544
614
 
545
615
  [@5t111111]: https://github.com/5t111111
546
616
  [@aarek]: https://github.com/aarek
@@ -553,6 +623,7 @@ Please check [0-6-stable] for previous changes.
553
623
  [@bartoszkopinski]: https://github.com/bartoszkopinski
554
624
  [@blocknotes]: https://github.com/blocknotes
555
625
  [@bolshakov]: https://github.com/bolshakov
626
+ [@brunvez]: https://github.com/brunvez
556
627
  [@buren]: https://github.com/buren
557
628
  [@chancancode]: https://github.com/chancancode
558
629
  [@chrp]: https://github.com/chrp
@@ -571,17 +642,22 @@ Please check [0-6-stable] for previous changes.
571
642
  [@FabioRos]: https://github.com/FabioRos
572
643
  [@faucct]: https://github.com/faucct
573
644
  [@Fivell]: https://github.com/Fivell
645
+ [@fuzziness]: https://github.com/fuzziness
646
+ [@giapnhdev]: https://github.com/giapnhdev
574
647
  [@glebtv]: https://github.com/glebtv
575
648
  [@gonzedge]: https://github.com/gonzedge
576
649
  [@guigs]: https://github.com/guigs
577
650
  [@HappyKadaver]: https://github.com/HappyKadaver
651
+ [@imcvampire]: https://github.com/imcvampire
578
652
  [@innparusu95]: https://github.com/innparusu95
579
653
  [@ionut998]: https://github.com/ionut998
580
654
  [@irmela]: https://github.com/irmela
655
+ [@Ivanov-Anton]: https://github.com/Ivanov-Anton
581
656
  [@jasl]: https://github.com/jasl
582
657
  [@javierjulio]: https://github.com/javierjulio
583
658
  [@jawa]: https://github.com/jawa
584
659
  [@JiiHu]: https://github.com/JiiHu
660
+ [@jiikko]: https://github.com/jiikko
585
661
  [@johnnyshields]: https://github.com/johnnyshields
586
662
  [@jscheid]: https://github.com/jscheid
587
663
  [@juril33t]: https://github.com/juril33t
@@ -592,11 +668,13 @@ Please check [0-6-stable] for previous changes.
592
668
  [@Kris-LIBIS]: https://github.com/Kris-LIBIS
593
669
  [@kwent]: https://github.com/kwent
594
670
  [@leio10]: https://github.com/leio10
671
+ [@Looooong]: https://github.com/Looooong
595
672
  [@markstory]: https://github.com/markstory
596
673
  [@mauriciopasquier]: https://github.com/mauriciopasquier
597
674
  [@mconiglio]: https://github.com/mconiglio
598
675
  [@micred]: https://github.com/micred
599
676
  [@mirelon]: https://github.com/mirelon
677
+ [@mshalaby]: https://github.com/mshalaby
600
678
  [@ndbroadbent]: https://github.com/ndbroadbent
601
679
  [@Nguyenanh]: https://github.com/Nguyenanh
602
680
  [@orkhan]: https://github.com/orkhan
@@ -605,8 +683,10 @@ Please check [0-6-stable] for previous changes.
605
683
  [@potatosalad]: https://github.com/potatosalad
606
684
  [@pranas]: https://github.com/pranas
607
685
  [@renotocn]: https://github.com/renotocn
686
+ [@rn0rno]: https://github.com/rn0rno
608
687
  [@RobinvanderVliet]: https://github.com/RobinvanderVliet
609
688
  [@rogerkk]: https://github.com/rogerkk
689
+ [@roramirez]: https://github.com/roramirez
610
690
  [@seanlinsley]: https://github.com/seanlinsley
611
691
  [@sgara]: https://github.com/sgara
612
692
  [@ShallmentMo]: https://github.com/ShallmentMo
@@ -614,10 +694,13 @@ Please check [0-6-stable] for previous changes.
614
694
  [@shouya]: https://github.com/shouya
615
695
  [@stefsava]: https://github.com/stefsava
616
696
  [@stereoscott]: https://github.com/stereoscott
697
+ [@taralbass]: https://github.com/taralbass
617
698
  [@tiagotex]: https://github.com/tiagotex
618
699
  [@timoschilling]: https://github.com/timoschilling
619
700
  [@TimPetricola]: https://github.com/TimPetricola
620
701
  [@varyonic]: https://github.com/varyonic
702
+ [@vcsjones]: https://github.com/vcsjones
703
+ [@vfonic]: https://github.com/vfonic
621
704
  [@violeta-p]: https://github.com/violeta-p
622
705
  [@WaKeMaTTa]: https://github.com/WaKeMaTTa
623
706
  [@wasifhossain]: https://github.com/wasifhossain
data/CONTRIBUTING.md CHANGED
@@ -115,22 +115,6 @@ checks as the rest of the project. `bin/rake lint` will give you feedback in
115
115
  this regard. You can check & fix style issues by running each linter
116
116
  individually. Run `bin/rake -T lint` to see the available linters.
117
117
 
118
- ### Add a changelog entry
119
-
120
- If your PR includes user-observable changes, you'll be asked to add a changelog
121
- entry following the existing changelog format.
122
-
123
- The changelog format is the following:
124
-
125
- * One line per PR describing your fix or enhancement.
126
- * Entries end with a dot, followed by "[#pr-number] by [@github-username]".
127
- * Entries are added under the "Unreleased" section at the top of the file, under
128
- the "Bug Fixes" or "Enhancements" subsection.
129
- * References to github usernames and pull requests use [shortcut reference
130
- links].
131
- * Your github username reference definition is included in the correct
132
- alphabetical position at the bottom of the file.
133
-
134
118
  ### Make a Pull Request
135
119
 
136
120
  At this point, you should switch back to your master branch and make sure it's
@@ -190,25 +174,13 @@ met.
190
174
 
191
175
  Maintainers need to do the following to push out a release:
192
176
 
193
- * Make sure all pull requests are in and that changelog is current
194
- * Update `version.rb` file and changelog with new version number
195
- * If it's not a patch level release, create a stable branch for that release,
196
- otherwise switch to the stable branch corresponding to the patch release you
197
- want to ship:
198
-
199
- ```sh
200
- git checkout master
201
- git fetch activeadmin
202
- git rebase activeadmin/master
203
- # If the release is 2.1.x then this should be: 2-1-stable
204
- git checkout -b N-N-stable
205
- git push activeadmin N-N-stable:N-N-stable
206
- ```
207
-
177
+ * Switch to the master branch and make sure it's up to date.
208
178
  * Make sure you have [chandler] properly configured. Chandler is used to
209
179
  automatically submit github release notes from the changelog right after
210
180
  pushing the gem to rubygems.
211
- * `bin/rake release`
181
+ * Run one of `bin/rake release:prepare_{prerelease,prepatch,patch,preminor,minor,premajor,major}`, push the result and create a PR.
182
+ * Review and merge the PR. The generated changelog in the PR should include all user visible changes you intend to ship.
183
+ * Run `bin/rake release` from the target branch once the PR is merged.
212
184
 
213
185
  [chandler]: https://github.com/mattbrictson/chandler#2-configure-credentials
214
186
  [Stack Overflow]: http://stackoverflow.com/questions/tagged/activeadmin
@@ -216,7 +188,7 @@ Maintainers need to do the following to push out a release:
216
188
  [fork Active Admin]: https://help.github.com/articles/fork-a-repo
217
189
  [make a pull request]: https://help.github.com/articles/creating-a-pull-request
218
190
  [git rebasing]: http://git-scm.com/book/en/Git-Branching-Rebasing
219
- [interactive rebase]: https://help.github.com/articles/interactive-rebase
191
+ [interactive rebase]: https://help.github.com/en/github/using-git/about-git-rebase
220
192
  [shortcut reference links]: https://github.github.com/gfm/#shortcut-reference-link
221
193
  [Rollup]: https://rollupjs.org/guide/en/#quick-start
222
194
  [Yarn]: https://yarnpkg.com/en/docs/install
data/README.md CHANGED
@@ -101,7 +101,7 @@ Thanks to [Open Collective][opencollective contributors] and all our Open Collec
101
101
  [inch]: http://inch-ci.org/github/activeadmin/activeadmin
102
102
  [tidelift_badge]: https://tidelift.com/badges/github/activeadmin/activeadmin
103
103
  [tidelift]: https://tidelift.com/subscription/pkg/rubygems-activeadmin?utm_source=rubygems-activeadmin&utm_medium=readme
104
- [tidelift_enterprise]: https://tidelift.com/subscription/pkg/rubygems-activeadmin?utm_source=rubygems-activeadmin&utm_medium=referral&utm_campaign=github&utm_content=enterprise
104
+ [tidelift_enterprise]: https://tidelift.com/subscription/pkg/rubygems-activeadmin?utm_source=rubygems-activeadmin&utm_medium=referral&utm_campaign=enterprise
105
105
  [tidelift_support]: https://tidelift.com/subscription/pkg/rubygems-activeadmin?utm_source=rubygems-activeadmin&utm_medium=referral&utm_campaign=github&utm_content=support
106
106
 
107
107
  [docs]: http://activeadmin.info/0-installation.html
@@ -27,18 +27,17 @@
27
27
  function ModalDialog(message, inputs, callback) {
28
28
  var html = '<form id="dialog_confirm" title="' + message + '"><ul>';
29
29
  for (var name in inputs) {
30
- var elem, opts, wrapper;
30
+ var opts, wrapper;
31
31
  var type = inputs[name];
32
32
  if (/^(datepicker|checkbox|text|number)$/.test(type)) {
33
33
  wrapper = "input";
34
34
  } else if (type === "textarea") {
35
35
  wrapper = "textarea";
36
36
  } else if ($.isArray(type)) {
37
- var _ref = [ "select", "option", type, "" ];
37
+ var _ref = [ "select", type, "" ];
38
38
  wrapper = _ref[0];
39
- elem = _ref[1];
40
- opts = _ref[2];
41
- type = _ref[3];
39
+ opts = _ref[1];
40
+ type = _ref[2];
42
41
  } else {
43
42
  throw new Error("Unsupported input type: {" + name + ": " + type + "}");
44
43
  }
@@ -46,29 +45,28 @@
46
45
  html += "<li>\n <label>" + (name.charAt(0).toUpperCase() + name.slice(1)) + "</label>\n <" + wrapper + ' name="' + name + '" class="' + klass + '" type="' + type + '">' + (opts ? function() {
47
46
  var result = [];
48
47
  opts.forEach(function(v) {
49
- var $elem = $("<" + elem + "/>");
48
+ var $elem = $("<option></option>");
50
49
  if ($.isArray(v)) {
51
50
  $elem.text(v[0]).val(v[1]);
52
51
  } else {
53
52
  $elem.text(v);
54
53
  }
55
- result.push($elem.wrap("<div>").parent().html());
54
+ result.push($elem.wrap("<div></div>").parent().html());
56
55
  });
57
56
  return result;
58
57
  }().join("") : "") + ("</" + wrapper + ">") + "</li>";
59
58
  var _ref2 = [];
60
59
  wrapper = _ref2[0];
61
- elem = _ref2[1];
62
- opts = _ref2[2];
63
- type = _ref2[3];
64
- klass = _ref2[4];
60
+ opts = _ref2[1];
61
+ type = _ref2[2];
62
+ klass = _ref2[3];
65
63
  }
66
64
  html += "</ul></form>";
67
65
  var form = $(html).appendTo("body");
68
66
  $("body").trigger("modal_dialog:before_open", [ form ]);
69
67
  form.dialog({
70
68
  modal: true,
71
- open: function open(event, ui) {
69
+ open: function open(_event, _ui) {
72
70
  $("body").trigger("modal_dialog:after_open", [ form ]);
73
71
  },
74
72
  dialogClass: "active_admin_dialog",
@@ -136,7 +134,7 @@
136
134
  this._bind();
137
135
  }
138
136
  var _proto = CheckboxToggler.prototype;
139
- _proto.option = function option(key, value) {};
137
+ _proto.option = function option(_key, _value) {};
140
138
  _proto._init = function _init() {
141
139
  if (!this.container) {
142
140
  throw new Error("Container element not found");
@@ -159,7 +157,7 @@
159
157
  return _this._didChangeToggleAllCheckbox();
160
158
  });
161
159
  };
162
- _proto._didChangeCheckbox = function _didChangeCheckbox(checkbox) {
160
+ _proto._didChangeCheckbox = function _didChangeCheckbox(_checkbox) {
163
161
  var numChecked = this.checkboxes.filter(":checked").length;
164
162
  var allChecked = numChecked === this.checkboxes.length;
165
163
  var someChecked = numChecked > 0 && numChecked < this.checkboxes.length;
@@ -464,7 +462,7 @@
464
462
  return PerPage;
465
463
  }();
466
464
  (function($) {
467
- $(document).on("change", ".pagination_per_page > select", function(event) {
465
+ $(document).on("change", ".pagination_per_page > select", function(_event) {
468
466
  PerPage._jQueryInterface.call($(this), "update");
469
467
  });
470
468
  $.fn["perPage"] = PerPage._jQueryInterface;
@@ -52,6 +52,11 @@
52
52
  margin: 0;
53
53
  padding: 0;
54
54
 
55
+ li {
56
+ /* Hover on li, display the ul */
57
+ &:hover > ul { display: block;}
58
+ }
59
+
55
60
  & > li {
56
61
  display: inline-block;
57
62
  margin-right: 4px;
@@ -95,8 +100,6 @@
95
100
  }
96
101
 
97
102
 
98
- /* Hover on li, display the ul */
99
- &:hover ul { display: block;}
100
103
  /* Drop down menus */
101
104
  ul {
102
105
  background: $hover-menu-item-background;
@@ -114,6 +117,7 @@
114
117
  z-index: 1010;
115
118
 
116
119
  li {
120
+ position: relative;
117
121
  margin: 0px;
118
122
  a {
119
123
  background: none;
@@ -124,10 +128,40 @@
124
128
  &.current {
125
129
  a { @include rounded(0) }
126
130
  }
131
+
132
+ &.has_nested > a {
133
+ background: url($menu-arrow-right-light-icon-url) no-repeat calc(100% - 7px) 55%;
134
+ padding-right: 20px;
135
+ }
136
+
137
+ &.has_nested:hover > a {
138
+ background: url($menu-arrow-right-dark-icon-url) no-repeat calc(100% - 7px) 55%;
139
+ color: #fff;
140
+ }
141
+
142
+ ul {
143
+ @include rounded-all(10px,10px,10px,10px);
144
+ margin-top: 0;
145
+ top: -3px;
146
+ left: 100%;
147
+
148
+ /* Create an invisible backdrop that adds 8px margin around the dropdown menu or submenu
149
+ that maintains the hover. This makes it much easier to navigate to submenus in
150
+ particular without losing hover accientally, especially near rounded corners. */
151
+ &:after {
152
+ content: "";
153
+ display: block;
154
+ position: absolute;
155
+ top: -8px;
156
+ left: -8px;
157
+ height: calc(100% + 16px);
158
+ width: calc(100% + 16px);
159
+ z-index: -2;
160
+ }
161
+ }
127
162
  }
128
163
  }
129
164
  }
130
-
131
165
  }
132
166
 
133
167
  #tabs {
@@ -2,9 +2,9 @@
2
2
  .comments {
3
3
 
4
4
  .active_admin_comment {
5
- clear: both;
5
+ @include clearfix;
6
6
  margin-top: 10px;
7
- margin-bottom: 40px;
7
+ margin-bottom: 20px;
8
8
  max-width: 700px;
9
9
 
10
10
  .active_admin_comment_meta {
@@ -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
@@ -3,7 +3,7 @@ import PerPage from "../lib/per-page";
3
3
  (($) => {
4
4
 
5
5
  $(document).
6
- on('change', '.pagination_per_page > select', function(event) {
6
+ on('change', '.pagination_per_page > select', function(_event) {
7
7
  PerPage._jQueryInterface.call($(this), 'update')
8
8
  });
9
9
 
@@ -6,7 +6,7 @@ class CheckboxToggler {
6
6
  this._bind();
7
7
  }
8
8
 
9
- option(key, value) {
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(checkbox){
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;
@@ -111,6 +111,6 @@ class DropdownMenu {
111
111
  this.$nipple.css('left', menu_center - nipple_center);
112
112
  }
113
113
  }
114
- };
114
+ }
115
115
 
116
116
  export default DropdownMenu;
@@ -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 elem, opts, wrapper;
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, elem, opts, type] = ['select', 'option', type, ''];
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 = $(`<${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, elem, opts, type, klass] = []; // unset any temporary variables
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(event, ui) {
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;
@@ -33,6 +33,6 @@ class PerPage {
33
33
  }
34
34
  })
35
35
  }
36
- };
36
+ }
37
37
 
38
38
  export default PerPage;
@@ -33,6 +33,6 @@ class TableCheckboxToggler extends CheckboxToggler {
33
33
  .find(':checkbox')
34
34
  .click();
35
35
  }
36
- };
36
+ }
37
37
 
38
38
  export default TableCheckboxToggler;
@@ -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
- <%= stylesheet_link_tag style, options %>
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
- <%= javascript_include_tag path %>
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
- <% flash_messages.each do |type, message| %>
28
- <%= content_tag :div, message, class: "flash flash_#{type}" %>
29
- <% end %>
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>
@@ -8,7 +8,7 @@ ar:
8
8
  edit: "تعديل"
9
9
  delete: "حذف"
10
10
  delete_confirmation: "هل تريد تأكيد الحذف؟"
11
- new_model: "جديد %{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: "إعادة إرسال تعليمات تنشيط الحساب"