activeadmin 2.7.0 → 2.8.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.

Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +54 -8
  3. data/CONTRIBUTING.md +1 -17
  4. data/app/assets/javascripts/active_admin/base.js +13 -15
  5. data/app/assets/stylesheets/active_admin/components/_comments.scss +2 -2
  6. data/app/javascript/active_admin/initializers/per-page.js +1 -1
  7. data/app/javascript/active_admin/lib/checkbox-toggler.js +3 -3
  8. data/app/javascript/active_admin/lib/dropdown-menu.js +1 -1
  9. data/app/javascript/active_admin/lib/modal-dialog.js +7 -7
  10. data/app/javascript/active_admin/lib/per-page.js +1 -1
  11. data/app/javascript/active_admin/lib/table-checkbox-toggler.js +1 -1
  12. data/app/views/layouts/active_admin_logged_out.html.erb +2 -2
  13. data/config/locales/ar.yml +6 -6
  14. data/config/locales/es-MX.yml +2 -1
  15. data/config/locales/es.yml +2 -2
  16. data/config/locales/it.yml +18 -0
  17. data/config/locales/ja.yml +3 -3
  18. data/docs/11-decorators.md +16 -5
  19. data/docs/Gemfile.lock +36 -26
  20. data/lib/active_admin.rb +43 -43
  21. data/lib/active_admin/application.rb +6 -6
  22. data/lib/active_admin/authorization_adapter.rb +3 -3
  23. data/lib/active_admin/base_controller/authorization.rb +9 -9
  24. data/lib/active_admin/batch_actions/controller.rb +3 -3
  25. data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
  26. data/lib/active_admin/batch_actions/views/batch_action_selector.rb +5 -5
  27. data/lib/active_admin/collection_decorator.rb +31 -0
  28. data/lib/active_admin/csv_builder.rb +4 -4
  29. data/lib/active_admin/dependency.rb +7 -7
  30. data/lib/active_admin/filters.rb +1 -1
  31. data/lib/active_admin/filters/forms.rb +3 -3
  32. data/lib/active_admin/filters/resource_extension.rb +1 -1
  33. data/lib/active_admin/form_builder.rb +5 -5
  34. data/lib/active_admin/helpers/optional_display.rb +2 -2
  35. data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
  36. data/lib/active_admin/menu_item.rb +7 -7
  37. data/lib/active_admin/namespace.rb +7 -7
  38. data/lib/active_admin/orm/active_record/comments.rb +11 -11
  39. data/lib/active_admin/orm/active_record/comments/comment.rb +3 -3
  40. data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +3 -3
  41. data/lib/active_admin/pundit_adapter.rb +4 -4
  42. data/lib/active_admin/resource/action_items.rb +1 -1
  43. data/lib/active_admin/resource/menu.rb +4 -4
  44. data/lib/active_admin/resource/naming.rb +3 -3
  45. data/lib/active_admin/resource/routes.rb +5 -5
  46. data/lib/active_admin/resource/scope_to.rb +7 -7
  47. data/lib/active_admin/resource_controller.rb +4 -3
  48. data/lib/active_admin/resource_controller/data_access.rb +1 -1
  49. data/lib/active_admin/resource_controller/decorators.rb +5 -25
  50. data/lib/active_admin/resource_dsl.rb +5 -5
  51. data/lib/active_admin/scope.rb +5 -5
  52. data/lib/active_admin/version.rb +1 -1
  53. data/lib/active_admin/view_factory.rb +16 -16
  54. data/lib/active_admin/view_helpers/breadcrumb_helper.rb +1 -1
  55. data/lib/active_admin/view_helpers/display_helper.rb +3 -3
  56. data/lib/active_admin/view_helpers/fields_for.rb +1 -1
  57. data/lib/active_admin/views/components/attributes_table.rb +2 -2
  58. data/lib/active_admin/views/components/dropdown_menu.rb +2 -2
  59. data/lib/active_admin/views/components/index_list.rb +1 -1
  60. data/lib/active_admin/views/components/menu_item.rb +1 -1
  61. data/lib/active_admin/views/components/paginated_collection.rb +14 -14
  62. data/lib/active_admin/views/components/table_for.rb +10 -10
  63. data/lib/active_admin/views/components/tabs.rb +1 -1
  64. data/lib/active_admin/views/index_as_table.rb +6 -6
  65. data/lib/active_admin/views/pages/base.rb +1 -1
  66. data/lib/active_admin/views/pages/index.rb +8 -8
  67. data/lib/generators/active_admin/assets/templates/active_admin.scss +2 -2
  68. data/lib/generators/active_admin/devise/devise_generator.rb +4 -4
  69. data/lib/generators/active_admin/install/templates/active_admin.rb.erb +2 -2
  70. data/lib/generators/active_admin/resource/resource_generator.rb +1 -1
  71. data/lib/generators/active_admin/webpacker/templates/active_admin.scss +2 -2
  72. metadata +15 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ab0e48981374c48c42109adc93edce137eed195218c8b7d26a8895f1a3e3e85
4
- data.tar.gz: f4a1228efba99ed7d3bdcd93330fb7687fd321521e7ca521c1363ed1a72f3bf6
3
+ metadata.gz: 1eae0d60f49f4133f9500f31625e24882ac57efa140f8052c87dd65a0cfbd353
4
+ data.tar.gz: 8db6863400174d2ed23adcf9985efff541ef858afe56339822d9cf02411052c4
5
5
  SHA512:
6
- metadata.gz: 3c98537ec2c59cfca738a38c5a0c905f15f55fa4aafb3bb9680880f628e89ad8226458b1a950a9ce717c01bc7a72dd6e6b906c77088a0096bf9b4397ae9475bd
7
- data.tar.gz: 3af41a29c2c5602198b7f614360f223c53c2f0c47b931fca189f30d96decfc4211697dea7cfc364e1ea218015259622c2180a15b0164db86615255363ca983f5
6
+ metadata.gz: cf3d8b2a337b50a73a5806ce18e2c40c9985d5db2a064d417057b349d172909fb1ed6e248ea271c76e331a76a76578f975e044373dbc0ca5bd2141f0ac365df4
7
+ data.tar.gz: 88b06f52c04bae83a5068301b0013366db174638392a8b850bec32b20ff3e72adfb480335211558319ee671b1a7a28955fbf4334b8ebf89c836107c7b85c1e61
@@ -2,6 +2,34 @@
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
+
5
33
  ## 2.7.0 [☰](https://github.com/activeadmin/activeadmin/compare/v2.6.1..v2.7.0)
6
34
 
7
35
  ### Enhancements
@@ -520,15 +548,16 @@ Please check [0-6-stable] for previous changes.
520
548
  [#5504]: https://github.com/activeadmin/activeadmin/pull/5504
521
549
  [#5517]: https://github.com/activeadmin/activeadmin/pull/5517
522
550
  [#5537]: https://github.com/activeadmin/activeadmin/pull/5537
551
+ [#5548]: https://github.com/activeadmin/activeadmin/pull/5548
523
552
  [#5555]: https://github.com/activeadmin/activeadmin/pull/5555
524
553
  [#5583]: https://github.com/activeadmin/activeadmin/pull/5583
554
+ [#5590]: https://github.com/activeadmin/activeadmin/pull/5590
525
555
  [#5608]: https://github.com/activeadmin/activeadmin/pull/5608
526
556
  [#5611]: https://github.com/activeadmin/activeadmin/pull/5611
527
557
  [#5627]: https://github.com/activeadmin/activeadmin/pull/5627
528
558
  [#5631]: https://github.com/activeadmin/activeadmin/pull/5631
529
559
  [#5632]: https://github.com/activeadmin/activeadmin/pull/5632
530
560
  [#5650]: https://github.com/activeadmin/activeadmin/pull/5650
531
- [#5590]: https://github.com/activeadmin/activeadmin/pull/5590
532
561
  [#5662]: https://github.com/activeadmin/activeadmin/pull/5662
533
562
  [#5710]: https://github.com/activeadmin/activeadmin/pull/5710
534
563
  [#5726]: https://github.com/activeadmin/activeadmin/pull/5726
@@ -546,32 +575,42 @@ Please check [0-6-stable] for previous changes.
546
575
  [#5822]: https://github.com/activeadmin/activeadmin/pull/5822
547
576
  [#5826]: https://github.com/activeadmin/activeadmin/pull/5826
548
577
  [#5831]: https://github.com/activeadmin/activeadmin/pull/5831
549
- [#5548]: https://github.com/activeadmin/activeadmin/pull/5548
550
578
  [#5842]: https://github.com/activeadmin/activeadmin/pull/5842
551
579
  [#5854]: https://github.com/activeadmin/activeadmin/pull/5854
552
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
553
583
  [#5874]: https://github.com/activeadmin/activeadmin/pull/5874
554
584
  [#5877]: https://github.com/activeadmin/activeadmin/pull/5877
555
585
  [#5886]: https://github.com/activeadmin/activeadmin/pull/5886
556
- [#5870]: https://github.com/activeadmin/activeadmin/pull/5870
586
+ [#5887]: https://github.com/activeadmin/activeadmin/pull/5887
557
587
  [#5894]: https://github.com/activeadmin/activeadmin/pull/5894
558
588
  [#5895]: https://github.com/activeadmin/activeadmin/pull/5895
559
- [#5867]: https://github.com/activeadmin/activeadmin/pull/5867
560
- [#5887]: https://github.com/activeadmin/activeadmin/pull/5887
589
+ [#5929]: https://github.com/activeadmin/activeadmin/pull/5929
561
590
  [#5931]: https://github.com/activeadmin/activeadmin/pull/5931
562
591
  [#5938]: https://github.com/activeadmin/activeadmin/pull/5938
563
- [#5929]: https://github.com/activeadmin/activeadmin/pull/5929
564
592
  [#5943]: https://github.com/activeadmin/activeadmin/pull/5943
565
593
  [#5946]: https://github.com/activeadmin/activeadmin/pull/5946
566
594
  [#5956]: https://github.com/activeadmin/activeadmin/pull/5956
567
595
  [#5957]: https://github.com/activeadmin/activeadmin/pull/5957
596
+ [#5994]: https://github.com/activeadmin/activeadmin/pull/5994
568
597
  [#6000]: https://github.com/activeadmin/activeadmin/pull/6000
569
598
  [#6002]: https://github.com/activeadmin/activeadmin/pull/6002
570
599
  [#6047]: https://github.com/activeadmin/activeadmin/pull/6047
571
- [#5994]: https://github.com/activeadmin/activeadmin/pull/5994
572
- [#6149]: https://github.com/activeadmin/activeadmin/pull/6149
573
600
  [#6086]: https://github.com/activeadmin/activeadmin/pull/6086
574
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
575
614
 
576
615
  [@5t111111]: https://github.com/5t111111
577
616
  [@aarek]: https://github.com/aarek
@@ -584,6 +623,7 @@ Please check [0-6-stable] for previous changes.
584
623
  [@bartoszkopinski]: https://github.com/bartoszkopinski
585
624
  [@blocknotes]: https://github.com/blocknotes
586
625
  [@bolshakov]: https://github.com/bolshakov
626
+ [@brunvez]: https://github.com/brunvez
587
627
  [@buren]: https://github.com/buren
588
628
  [@chancancode]: https://github.com/chancancode
589
629
  [@chrp]: https://github.com/chrp
@@ -602,6 +642,7 @@ Please check [0-6-stable] for previous changes.
602
642
  [@FabioRos]: https://github.com/FabioRos
603
643
  [@faucct]: https://github.com/faucct
604
644
  [@Fivell]: https://github.com/Fivell
645
+ [@fuzziness]: https://github.com/fuzziness
605
646
  [@giapnhdev]: https://github.com/giapnhdev
606
647
  [@glebtv]: https://github.com/glebtv
607
648
  [@gonzedge]: https://github.com/gonzedge
@@ -611,10 +652,12 @@ Please check [0-6-stable] for previous changes.
611
652
  [@innparusu95]: https://github.com/innparusu95
612
653
  [@ionut998]: https://github.com/ionut998
613
654
  [@irmela]: https://github.com/irmela
655
+ [@Ivanov-Anton]: https://github.com/Ivanov-Anton
614
656
  [@jasl]: https://github.com/jasl
615
657
  [@javierjulio]: https://github.com/javierjulio
616
658
  [@jawa]: https://github.com/jawa
617
659
  [@JiiHu]: https://github.com/JiiHu
660
+ [@jiikko]: https://github.com/jiikko
618
661
  [@johnnyshields]: https://github.com/johnnyshields
619
662
  [@jscheid]: https://github.com/jscheid
620
663
  [@juril33t]: https://github.com/juril33t
@@ -631,6 +674,7 @@ Please check [0-6-stable] for previous changes.
631
674
  [@mconiglio]: https://github.com/mconiglio
632
675
  [@micred]: https://github.com/micred
633
676
  [@mirelon]: https://github.com/mirelon
677
+ [@mshalaby]: https://github.com/mshalaby
634
678
  [@ndbroadbent]: https://github.com/ndbroadbent
635
679
  [@Nguyenanh]: https://github.com/Nguyenanh
636
680
  [@orkhan]: https://github.com/orkhan
@@ -639,8 +683,10 @@ Please check [0-6-stable] for previous changes.
639
683
  [@potatosalad]: https://github.com/potatosalad
640
684
  [@pranas]: https://github.com/pranas
641
685
  [@renotocn]: https://github.com/renotocn
686
+ [@rn0rno]: https://github.com/rn0rno
642
687
  [@RobinvanderVliet]: https://github.com/RobinvanderVliet
643
688
  [@rogerkk]: https://github.com/rogerkk
689
+ [@roramirez]: https://github.com/roramirez
644
690
  [@seanlinsley]: https://github.com/seanlinsley
645
691
  [@sgara]: https://github.com/sgara
646
692
  [@ShallmentMo]: https://github.com/ShallmentMo
@@ -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,12 +174,12 @@ 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
177
  * Switch to the master branch and make sure it's up to date.
195
178
  * Make sure you have [chandler] properly configured. Chandler is used to
196
179
  automatically submit github release notes from the changelog right after
197
180
  pushing the gem to rubygems.
198
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.
199
183
  * Run `bin/rake release` from the target branch once the PR is merged.
200
184
 
201
185
  [chandler]: https://github.com/mattbrictson/chandler#2-configure-credentials
@@ -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;
@@ -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 {
@@ -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;
@@ -7,9 +7,9 @@
7
7
 
8
8
  <% ActiveAdmin.application.stylesheets.each do |style, options| %>
9
9
  <% if ActiveAdmin.application.use_webpacker %>
10
- <%= stylesheet_pack_tag style, options %>
10
+ <%= stylesheet_pack_tag style, **options %>
11
11
  <% else %>
12
- <%= stylesheet_link_tag style, options %>
12
+ <%= stylesheet_link_tag style, **options %>
13
13
  <% end %>
14
14
  <% end %>
15
15
  <% ActiveAdmin.application.javascripts.each do |path| %>
@@ -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: "إعادة إرسال تعليمات تنشيط الحساب"