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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +54 -8
- data/CONTRIBUTING.md +1 -17
- data/app/assets/javascripts/active_admin/base.js +13 -15
- data/app/assets/stylesheets/active_admin/components/_comments.scss +2 -2
- data/app/javascript/active_admin/initializers/per-page.js +1 -1
- data/app/javascript/active_admin/lib/checkbox-toggler.js +3 -3
- data/app/javascript/active_admin/lib/dropdown-menu.js +1 -1
- data/app/javascript/active_admin/lib/modal-dialog.js +7 -7
- data/app/javascript/active_admin/lib/per-page.js +1 -1
- data/app/javascript/active_admin/lib/table-checkbox-toggler.js +1 -1
- data/app/views/layouts/active_admin_logged_out.html.erb +2 -2
- data/config/locales/ar.yml +6 -6
- data/config/locales/es-MX.yml +2 -1
- data/config/locales/es.yml +2 -2
- data/config/locales/it.yml +18 -0
- data/config/locales/ja.yml +3 -3
- data/docs/11-decorators.md +16 -5
- data/docs/Gemfile.lock +36 -26
- data/lib/active_admin.rb +43 -43
- data/lib/active_admin/application.rb +6 -6
- data/lib/active_admin/authorization_adapter.rb +3 -3
- data/lib/active_admin/base_controller/authorization.rb +9 -9
- data/lib/active_admin/batch_actions/controller.rb +3 -3
- data/lib/active_admin/batch_actions/views/batch_action_form.rb +1 -1
- data/lib/active_admin/batch_actions/views/batch_action_selector.rb +5 -5
- data/lib/active_admin/collection_decorator.rb +31 -0
- data/lib/active_admin/csv_builder.rb +4 -4
- data/lib/active_admin/dependency.rb +7 -7
- data/lib/active_admin/filters.rb +1 -1
- data/lib/active_admin/filters/forms.rb +3 -3
- data/lib/active_admin/filters/resource_extension.rb +1 -1
- data/lib/active_admin/form_builder.rb +5 -5
- data/lib/active_admin/helpers/optional_display.rb +2 -2
- data/lib/active_admin/inputs/filters/base/search_method_select.rb +2 -2
- data/lib/active_admin/menu_item.rb +7 -7
- data/lib/active_admin/namespace.rb +7 -7
- data/lib/active_admin/orm/active_record/comments.rb +11 -11
- data/lib/active_admin/orm/active_record/comments/comment.rb +3 -3
- data/lib/active_admin/orm/active_record/comments/views/active_admin_comments.rb +3 -3
- data/lib/active_admin/pundit_adapter.rb +4 -4
- data/lib/active_admin/resource/action_items.rb +1 -1
- data/lib/active_admin/resource/menu.rb +4 -4
- data/lib/active_admin/resource/naming.rb +3 -3
- data/lib/active_admin/resource/routes.rb +5 -5
- data/lib/active_admin/resource/scope_to.rb +7 -7
- data/lib/active_admin/resource_controller.rb +4 -3
- data/lib/active_admin/resource_controller/data_access.rb +1 -1
- data/lib/active_admin/resource_controller/decorators.rb +5 -25
- data/lib/active_admin/resource_dsl.rb +5 -5
- data/lib/active_admin/scope.rb +5 -5
- data/lib/active_admin/version.rb +1 -1
- data/lib/active_admin/view_factory.rb +16 -16
- data/lib/active_admin/view_helpers/breadcrumb_helper.rb +1 -1
- data/lib/active_admin/view_helpers/display_helper.rb +3 -3
- data/lib/active_admin/view_helpers/fields_for.rb +1 -1
- data/lib/active_admin/views/components/attributes_table.rb +2 -2
- data/lib/active_admin/views/components/dropdown_menu.rb +2 -2
- data/lib/active_admin/views/components/index_list.rb +1 -1
- data/lib/active_admin/views/components/menu_item.rb +1 -1
- data/lib/active_admin/views/components/paginated_collection.rb +14 -14
- data/lib/active_admin/views/components/table_for.rb +10 -10
- data/lib/active_admin/views/components/tabs.rb +1 -1
- data/lib/active_admin/views/index_as_table.rb +6 -6
- data/lib/active_admin/views/pages/base.rb +1 -1
- data/lib/active_admin/views/pages/index.rb +8 -8
- data/lib/generators/active_admin/assets/templates/active_admin.scss +2 -2
- data/lib/generators/active_admin/devise/devise_generator.rb +4 -4
- data/lib/generators/active_admin/install/templates/active_admin.rb.erb +2 -2
- data/lib/generators/active_admin/resource/resource_generator.rb +1 -1
- data/lib/generators/active_admin/webpacker/templates/active_admin.scss +2 -2
- metadata +15 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eae0d60f49f4133f9500f31625e24882ac57efa140f8052c87dd65a0cfbd353
|
4
|
+
data.tar.gz: 8db6863400174d2ed23adcf9985efff541ef858afe56339822d9cf02411052c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf3d8b2a337b50a73a5806ce18e2c40c9985d5db2a064d417057b349d172909fb1ed6e248ea271c76e331a76a76578f975e044373dbc0ca5bd2141f0ac365df4
|
7
|
+
data.tar.gz: 88b06f52c04bae83a5068301b0013366db174638392a8b850bec32b20ff3e72adfb480335211558319ee671b1a7a28955fbf4334b8ebf89c836107c7b85c1e61
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
[#
|
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
|
-
[#
|
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
|
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,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
|
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",
|
37
|
+
var _ref = [ "select", type, "" ];
|
38
38
|
wrapper = _ref[0];
|
39
|
-
|
40
|
-
|
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 = $("<"
|
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
|
-
|
62
|
-
|
63
|
-
|
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(
|
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(
|
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(
|
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(
|
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;
|
@@ -6,7 +6,7 @@ class CheckboxToggler {
|
|
6
6
|
this._bind();
|
7
7
|
}
|
8
8
|
|
9
|
-
option(
|
9
|
+
option(_key, _value) {
|
10
10
|
}
|
11
11
|
|
12
12
|
_init() {
|
@@ -30,7 +30,7 @@ class CheckboxToggler {
|
|
30
30
|
this.toggle_all_checkbox.change(() => this._didChangeToggleAllCheckbox());
|
31
31
|
}
|
32
32
|
|
33
|
-
_didChangeCheckbox(
|
33
|
+
_didChangeCheckbox(_checkbox){
|
34
34
|
const numChecked = this.checkboxes.filter(':checked').length;
|
35
35
|
|
36
36
|
const allChecked = numChecked === this.checkboxes.length;
|
@@ -44,6 +44,6 @@ class CheckboxToggler {
|
|
44
44
|
this.checkboxes.prop({ checked: setting });
|
45
45
|
return setting;
|
46
46
|
}
|
47
|
-
}
|
47
|
+
}
|
48
48
|
|
49
49
|
export default CheckboxToggler;
|
@@ -1,14 +1,14 @@
|
|
1
1
|
function ModalDialog(message, inputs, callback){
|
2
2
|
let html = `<form id="dialog_confirm" title="${message}"><ul>`;
|
3
3
|
for (let name in inputs) {
|
4
|
-
var
|
4
|
+
var opts, wrapper;
|
5
5
|
let type = inputs[name];
|
6
6
|
if (/^(datepicker|checkbox|text|number)$/.test(type)) {
|
7
7
|
wrapper = 'input';
|
8
8
|
} else if (type === 'textarea') {
|
9
9
|
wrapper = 'textarea';
|
10
10
|
} else if ($.isArray(type)) {
|
11
|
-
[wrapper,
|
11
|
+
[wrapper, opts, type] = ['select', type, ''];
|
12
12
|
} else {
|
13
13
|
throw new Error(`Unsupported input type: {${name}: ${type}}`);
|
14
14
|
}
|
@@ -21,20 +21,20 @@ function ModalDialog(message, inputs, callback){
|
|
21
21
|
const result = [];
|
22
22
|
|
23
23
|
opts.forEach(v => {
|
24
|
-
const $elem = $(
|
24
|
+
const $elem = $('<option></option>');
|
25
25
|
if ($.isArray(v)) {
|
26
26
|
$elem.text(v[0]).val(v[1]);
|
27
27
|
} else {
|
28
28
|
$elem.text(v);
|
29
29
|
}
|
30
|
-
result.push($elem.wrap('<div>').parent().html());
|
30
|
+
result.push($elem.wrap('<div></div>').parent().html());
|
31
31
|
});
|
32
32
|
|
33
33
|
return result;
|
34
34
|
})()).join('') : '') +
|
35
35
|
`</${wrapper}>` +
|
36
36
|
"</li>";
|
37
|
-
[wrapper,
|
37
|
+
[wrapper, opts, type, klass] = []; // unset any temporary variables
|
38
38
|
}
|
39
39
|
|
40
40
|
html += "</ul></form>";
|
@@ -44,7 +44,7 @@ function ModalDialog(message, inputs, callback){
|
|
44
44
|
|
45
45
|
form.dialog({
|
46
46
|
modal: true,
|
47
|
-
open(
|
47
|
+
open(_event, _ui) {
|
48
48
|
$('body').trigger('modal_dialog:after_open', [form]);
|
49
49
|
},
|
50
50
|
dialogClass: 'active_admin_dialog',
|
@@ -58,6 +58,6 @@ function ModalDialog(message, inputs, callback){
|
|
58
58
|
}
|
59
59
|
}
|
60
60
|
});
|
61
|
-
}
|
61
|
+
}
|
62
62
|
|
63
63
|
export default ModalDialog;
|
@@ -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| %>
|
data/config/locales/ar.yml
CHANGED
@@ -8,7 +8,7 @@ ar:
|
|
8
8
|
edit: "تعديل"
|
9
9
|
delete: "حذف"
|
10
10
|
delete_confirmation: "هل تريد تأكيد الحذف؟"
|
11
|
-
new_model: "
|
11
|
+
new_model: "%{model} جديد"
|
12
12
|
edit_model: "تعديل %{model}"
|
13
13
|
delete_model: "حذف %{model}"
|
14
14
|
details: "تفاصيل %{model}"
|
@@ -97,12 +97,12 @@ ar:
|
|
97
97
|
password:
|
98
98
|
title: "كلمة المرور"
|
99
99
|
sign_up:
|
100
|
-
title: "تسجيل
|
101
|
-
submit: "تسجيل
|
100
|
+
title: "تسجيل"
|
101
|
+
submit: "تسجيل"
|
102
102
|
login:
|
103
|
-
title: "
|
103
|
+
title: "تسجيل الدخول"
|
104
104
|
remember_me: "تذكرني"
|
105
|
-
submit: "
|
105
|
+
submit: "تسجيل الدخول"
|
106
106
|
reset_password:
|
107
107
|
title: "هل نسيت كلمة المرور؟"
|
108
108
|
submit: "استرجاع كلمة المرور"
|
@@ -117,7 +117,7 @@ ar:
|
|
117
117
|
submit: "إعادة ارسال تعليمات التأكيد"
|
118
118
|
links:
|
119
119
|
sign_up: "التسجيل"
|
120
|
-
sign_in: "
|
120
|
+
sign_in: "تسجيل الدخول"
|
121
121
|
forgot_your_password: "هل نسيت كلمة المرور؟"
|
122
122
|
sign_in_with_omniauth_provider: "تسجيل الدخول بـ %{provider}"
|
123
123
|
resend_unlock_instructions: "إعادة إرسال تعليمات تنشيط الحساب"
|