slash_admin 1.3.2 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +38 -11
- data/app/assets/config/slash_admin_manifest.js +2 -2
- data/app/assets/javascripts/slash_admin/application.js +2 -2
- data/app/assets/stylesheets/slash_admin/application.scss +69 -74
- data/app/controllers/slash_admin/models_controller.rb +8 -4
- data/app/helpers/slash_admin/application_helper.rb +2 -0
- data/app/views/slash_admin/base/_data_list.html.erb +3 -1
- data/app/views/slash_admin/base/_translatable_fields.html.erb +4 -4
- data/app/views/slash_admin/base/_wysiwyg.html.erb +1 -0
- data/app/views/slash_admin/security/sessions/new.html.erb +1 -1
- data/app/views/slash_admin/shared/_header.html.erb +2 -2
- data/app/views/slash_admin/shared/_menu.html.erb +2 -2
- data/lib/generators/slash_admin/install/install_generator.rb +2 -0
- data/lib/generators/slash_admin/install/templates/initializer.rb +6 -0
- data/lib/slash_admin.rb +16 -0
- data/lib/slash_admin/engine.rb +7 -1
- data/lib/slash_admin/version.rb +1 -1
- metadata +7 -6
- data/config/initializers/pagy.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11e65af2390efad19838b6a296c332d2390f7db2cc19d5e7fb3b194a20764e02
|
4
|
+
data.tar.gz: 6b8d9aeb8534270f7edf23f56a13d8284ed791d3fc08a85a5577adada253e075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3198056fa8a35ae1d9e0005d86b44ef6e382675b63073deeb7974862a73b100cdeadef0ab6cd0f8f7ccf150c11ea0a38e95a42c149f41626393ba318144f33cf
|
7
|
+
data.tar.gz: e7e82ddba2244e1ca4c65d6f39cf8627793182bf36b709adae59f7b385364eeeeed4bee13d1fe2dade6b0edb295bdc1c03181921bae6c6449df84d42bc2da1f7
|
data/README.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
<p align="center">
|
2
|
-
<img width="250" src="https://i.imgur.com/
|
2
|
+
<img width="250" src="https://i.imgur.com/mm9gXtL.png" />
|
3
3
|
</p>
|
4
4
|
|
5
5
|
# SlashAdmin
|
6
6
|
|
7
7
|
[](https://badge.fury.io/rb/slash_admin)
|
8
|
-
[](https://codeclimate.com/github/nicovak/slash_admin)
|
9
8
|
[](https://circleci.com/gh/nicovak/slash_admin/tree/master)
|
10
9
|
|
11
|
-
A modern and fully
|
12
|
-
|
10
|
+
A modern and fully customizable admin, just the rails way.
|
11
|
+
Embedded admin user and authentication system, devise is not needded.
|
13
12
|
|
14
13
|
❤️ [Demo repository](https://github.com/nicovak/slash_admin_demo)
|
15
14
|
🚀 [Live running](https://slashadmin.herokuapp.com/admin)
|
@@ -21,7 +20,7 @@ Password
|
|
21
20
|
`admin@admin`
|
22
21
|
|
23
22
|
#### Motivation:
|
24
|
-
- Provide to
|
23
|
+
- Provide to Ruby On Rails the admin it deserves without DSL or obscure logic.
|
25
24
|
- Provide an easy to use and modern experience to final users.
|
26
25
|
|
27
26
|
I tried to take the best from two greats existing gem:
|
@@ -34,37 +33,42 @@ Design inspired from the awesome metronic admin theme:
|
|
34
33
|
#### Screenshots
|
35
34
|
|
36
35
|
##### Login
|
37
|
-

|
38
37
|
##### Dashboard
|
39
|
-

|
40
39
|
##### List
|
41
|
-

|
42
41
|
##### Edit / Create
|
43
|
-

|
44
43
|
|
45
44
|
### Installation
|
46
45
|
|
47
46
|
Add this line to your application's Gemfile:
|
47
|
+
|
48
48
|
```ruby
|
49
49
|
gem 'slash_admin'
|
50
50
|
```
|
51
51
|
|
52
|
-
|
52
|
+
Then execute:
|
53
|
+
|
53
54
|
```bash
|
54
55
|
$ bundle install
|
55
56
|
```
|
56
57
|
|
57
58
|
Or install it yourself as:
|
59
|
+
|
58
60
|
```bash
|
59
61
|
$ gem install slash_admin
|
60
62
|
```
|
61
63
|
|
62
64
|
Gemfile
|
65
|
+
|
63
66
|
```
|
64
67
|
gem 'carrierwave'
|
65
68
|
```
|
66
69
|
|
67
70
|
Then:
|
71
|
+
|
68
72
|
```bash
|
69
73
|
$ rails g slash_admin:install
|
70
74
|
$ rails slash_admin:install:migrations
|
@@ -77,13 +81,36 @@ $ rails db:migrate
|
|
77
81
|
Mime::Type.register "application/xls", :xls
|
78
82
|
```
|
79
83
|
|
84
|
+
If your apps uses Sprockets 4+, you'll need to add SlashAdmin assets to your `manifest.js` file. To do this, add these two lines to the file:
|
85
|
+
|
86
|
+
`app/assets/config/manifest.js`
|
87
|
+
|
88
|
+
```
|
89
|
+
//= link slash_admin/application.css
|
90
|
+
//= link slash_admin/application.js
|
91
|
+
```
|
92
|
+
|
93
|
+
`config/routes.rb`
|
94
|
+
|
80
95
|
```ruby
|
81
96
|
Rails.application.routes.draw do
|
82
97
|
mount SlashAdmin::Engine => "/"
|
83
98
|
end
|
84
99
|
```
|
85
100
|
|
86
|
-
Mounted as '/' but prefixed in the gem and in routes definition of models admin. See above.
|
101
|
+
Mounted as '/' but prefixed in the gem and in routes definition of models admin. See the full example above.
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
Rails.application.routes.draw do
|
105
|
+
mount SlashAdmin::Engine => "/"
|
106
|
+
|
107
|
+
namespace :slash_admin, path: "/admin" do
|
108
|
+
scope module: 'models' do
|
109
|
+
resources :pages # assume Page model
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
```
|
87
114
|
|
88
115
|
### Important
|
89
116
|
|
@@ -1,3 +1,3 @@
|
|
1
1
|
//= link_tree ../images
|
2
|
-
//=
|
3
|
-
//=
|
2
|
+
//= link_tree ../javascripts
|
3
|
+
//= link_tree ../stylesheets
|
@@ -207,7 +207,7 @@ function init() {
|
|
207
207
|
|
208
208
|
|
209
209
|
$(".select2-single, .select2-multiple").each (function() {
|
210
|
-
|
210
|
+
var initialPlaceholder = $(this).attr('data-placeholder') || I18n.t('slash_admin.view.select');
|
211
211
|
|
212
212
|
$(this).select2({
|
213
213
|
placeholder: initialPlaceholder,
|
@@ -228,7 +228,7 @@ function init() {
|
|
228
228
|
});
|
229
229
|
|
230
230
|
$(".select2-model-multiple, .select2-model-single").each(function() {
|
231
|
-
|
231
|
+
var initialPlaceholder = $(this).attr('data-placeholder') || I18n.t('slash_admin.view.select');
|
232
232
|
|
233
233
|
$(this).select2({
|
234
234
|
placeholder: initialPlaceholder,
|
@@ -1,37 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
*= require bootstrap-datepicker.min
|
20
|
-
*= require bootstrap-material-datetimepicker
|
21
|
-
*= require jquery.tagsinput-revisited.min
|
22
|
-
*= require jquery.minicolors
|
23
|
-
*= require slash_admin/colors
|
24
|
-
*= require slash_admin/alert
|
25
|
-
*= require codemirror/codemirror
|
26
|
-
*= require codemirror/theme/relax-seti
|
27
|
-
*= require codemirror/lint/lint
|
28
|
-
*= require_self
|
29
|
-
*= require slash_admin/custom
|
30
|
-
*= require_tree .
|
31
|
-
*/
|
32
|
-
|
33
|
-
@import "./colors";
|
34
|
-
@import "./alert";
|
1
|
+
@import "animate";
|
2
|
+
@import "toastr";
|
3
|
+
@import "jquery.nestable";
|
4
|
+
@import "sweetalert";
|
5
|
+
@import "select2/select2.min";
|
6
|
+
@import "select2/select2-bootstrap4";
|
7
|
+
@import "bootstrap-datepicker.min";
|
8
|
+
@import "bootstrap-material-datetimepicker";
|
9
|
+
@import "jquery.tagsinput-revisited.min";
|
10
|
+
@import "jquery.minicolors";
|
11
|
+
@import "slash_admin/colors";
|
12
|
+
@import "slash_admin/alert";
|
13
|
+
@import "slash_admin/custom";
|
14
|
+
@import "codemirror/codemirror";
|
15
|
+
@import "codemirror/theme/relax-seti";
|
16
|
+
@import "codemirror/lint/lint";
|
17
|
+
@import "colors";
|
18
|
+
@import "alert";
|
35
19
|
|
36
20
|
$pagination-padding-y: 0.4rem !default;
|
37
21
|
$pagination-border-width: 0 !default;
|
@@ -107,7 +91,7 @@ p[data-f-id="pbf"] {
|
|
107
91
|
margin: 0;
|
108
92
|
|
109
93
|
label.form-control-label {
|
110
|
-
display: block;
|
94
|
+
display: inline-block;
|
111
95
|
font-weight: 600;
|
112
96
|
}
|
113
97
|
|
@@ -155,7 +139,8 @@ p[data-f-id="pbf"] {
|
|
155
139
|
}
|
156
140
|
|
157
141
|
.select2-container--bootstrap4 .select2-results__option--highlighted,
|
158
|
-
.select2-container--bootstrap4
|
142
|
+
.select2-container--bootstrap4
|
143
|
+
.select2-results__option--highlighted.select2-results__option[aria-selected="true"] {
|
159
144
|
background-color: $primary;
|
160
145
|
color: white;
|
161
146
|
}
|
@@ -178,20 +163,27 @@ p[data-f-id="pbf"] {
|
|
178
163
|
background: $input;
|
179
164
|
}
|
180
165
|
|
181
|
-
.select2-container--bootstrap4
|
166
|
+
.select2-container--bootstrap4
|
167
|
+
.select2-selection--multiple
|
168
|
+
.select2-selection__choice {
|
182
169
|
word-break: break-all;
|
183
170
|
background: white;
|
184
171
|
}
|
185
172
|
|
186
173
|
.select2-container .select2-results__option--highlighted,
|
187
|
-
.select2-container
|
188
|
-
|
174
|
+
.select2-container
|
175
|
+
.select2-results__option--highlighted.select2-results__option[aria-selected="true"],
|
176
|
+
.select2-container--bootstrap4
|
177
|
+
.select2-dropdown
|
178
|
+
.select2-results__option[aria-selected="true"] {
|
189
179
|
background-color: $primary;
|
190
180
|
color: white;
|
191
181
|
}
|
192
182
|
|
193
|
-
.select2-container--bootstrap4.select2-container--focus
|
194
|
-
|
183
|
+
.select2-container--bootstrap4.select2-container--focus
|
184
|
+
.select2-selection--multiple,
|
185
|
+
.select2-container--bootstrap4.select2-container--focus
|
186
|
+
.select2-selection--single {
|
195
187
|
border: 1px solid $border;
|
196
188
|
background: $input;
|
197
189
|
}
|
@@ -211,7 +203,9 @@ p[data-f-id="pbf"] {
|
|
211
203
|
background: none;
|
212
204
|
}
|
213
205
|
|
214
|
-
.select2-container--bootstrap4
|
206
|
+
.select2-container--bootstrap4
|
207
|
+
.select2-search--dropdown
|
208
|
+
.select2-search__field {
|
215
209
|
border-color: $border;
|
216
210
|
}
|
217
211
|
|
@@ -272,20 +266,6 @@ p[data-f-id="pbf"] {
|
|
272
266
|
}
|
273
267
|
}
|
274
268
|
|
275
|
-
.field_with_errors {
|
276
|
-
label {
|
277
|
-
color: $red;
|
278
|
-
}
|
279
|
-
|
280
|
-
input {
|
281
|
-
border-color: $red !important;
|
282
|
-
}
|
283
|
-
|
284
|
-
& + .form-control-feedback {
|
285
|
-
color: $red;
|
286
|
-
}
|
287
|
-
}
|
288
|
-
|
289
269
|
.block-language {
|
290
270
|
display: block;
|
291
271
|
margin: 15px 0;
|
@@ -397,18 +377,18 @@ p[data-f-id="pbf"] {
|
|
397
377
|
position: relative;
|
398
378
|
height: 80px;
|
399
379
|
width: 100%;
|
400
|
-
transition: all ease .6s;
|
380
|
+
transition: all ease 0.6s;
|
401
381
|
}
|
402
382
|
|
403
383
|
.image-overlay {
|
404
|
-
transition: all ease .6s;
|
384
|
+
transition: all ease 0.6s;
|
405
385
|
position: absolute;
|
406
386
|
width: 100%;
|
407
387
|
height: 100%;
|
408
|
-
background: rgba($primary,
|
388
|
+
background: rgba($primary, 0);
|
409
389
|
|
410
390
|
.icon-zoom-image {
|
411
|
-
transition: all ease .6s;
|
391
|
+
transition: all ease 0.6s;
|
412
392
|
position: absolute;
|
413
393
|
top: 50%;
|
414
394
|
left: 50%;
|
@@ -418,7 +398,7 @@ p[data-f-id="pbf"] {
|
|
418
398
|
}
|
419
399
|
|
420
400
|
&:hover {
|
421
|
-
background: rgba($primary, .4);
|
401
|
+
background: rgba($primary, 0.4);
|
422
402
|
|
423
403
|
.icon-zoom-image {
|
424
404
|
opacity: 1;
|
@@ -442,6 +422,16 @@ p[data-f-id="pbf"] {
|
|
442
422
|
color: $primary;
|
443
423
|
}
|
444
424
|
|
425
|
+
.has-danger {
|
426
|
+
.form-control, input, select, textarea {
|
427
|
+
border-color: $error !important;
|
428
|
+
}
|
429
|
+
|
430
|
+
label, .form-control-feedback {
|
431
|
+
color: $error !important;
|
432
|
+
}
|
433
|
+
}
|
434
|
+
|
445
435
|
.scroll-to-top {
|
446
436
|
text-align: center;
|
447
437
|
position: fixed;
|
@@ -589,10 +579,6 @@ p[data-f-id="pbf"] {
|
|
589
579
|
display: flex;
|
590
580
|
align-items: center;
|
591
581
|
|
592
|
-
&:hover {
|
593
|
-
background: #f9fafc;
|
594
|
-
}
|
595
|
-
|
596
582
|
&.active {
|
597
583
|
color: $textColorHover;
|
598
584
|
}
|
@@ -869,9 +855,10 @@ p[data-f-id="pbf"] {
|
|
869
855
|
display: none;
|
870
856
|
padding: 9px 15px;
|
871
857
|
|
872
|
-
tr,
|
858
|
+
tr,
|
859
|
+
a {
|
873
860
|
color: $textColor;
|
874
|
-
transition: all .6s ease;
|
861
|
+
transition: all 0.6s ease;
|
875
862
|
cursor: pointer;
|
876
863
|
|
877
864
|
&.active {
|
@@ -1051,7 +1038,7 @@ p[data-f-id="pbf"] {
|
|
1051
1038
|
border-color: rgba(121, 133, 166, 0.1) !important;
|
1052
1039
|
margin-top: 1rem;
|
1053
1040
|
background: #fff;
|
1054
|
-
font-size: .9em;
|
1041
|
+
font-size: 0.9em;
|
1055
1042
|
|
1056
1043
|
.fit {
|
1057
1044
|
white-space: nowrap;
|
@@ -1085,8 +1072,12 @@ p[data-f-id="pbf"] {
|
|
1085
1072
|
margin-top: 0.5rem;
|
1086
1073
|
}
|
1087
1074
|
|
1088
|
-
.select2-container--bootstrap4
|
1089
|
-
|
1075
|
+
.select2-container--bootstrap4
|
1076
|
+
.select2-selection--single
|
1077
|
+
.select2-selection__choice,
|
1078
|
+
.select2-container--bootstrap4
|
1079
|
+
.select2-selection--multiple
|
1080
|
+
.select2-selection__choice {
|
1090
1081
|
display: flex;
|
1091
1082
|
clear: both;
|
1092
1083
|
}
|
@@ -1350,7 +1341,9 @@ p[data-f-id="pbf"] {
|
|
1350
1341
|
height: 45px;
|
1351
1342
|
}
|
1352
1343
|
|
1353
|
-
.cookies-eu,
|
1344
|
+
.cookies-eu,
|
1345
|
+
.cookies-eu-button-holder,
|
1346
|
+
.cookies-eu-content-holder {
|
1354
1347
|
display: flex;
|
1355
1348
|
line-height: normal;
|
1356
1349
|
}
|
@@ -1397,7 +1390,7 @@ p[data-f-id="pbf"] {
|
|
1397
1390
|
}
|
1398
1391
|
|
1399
1392
|
label {
|
1400
|
-
font-size: .85em;
|
1393
|
+
font-size: 0.85em;
|
1401
1394
|
color: $textColor;
|
1402
1395
|
text-transform: uppercase;
|
1403
1396
|
margin-bottom: 0.25rem;
|
@@ -1411,7 +1404,9 @@ p[data-f-id="pbf"] {
|
|
1411
1404
|
a {
|
1412
1405
|
color: $textColor;
|
1413
1406
|
|
1414
|
-
&:hover,
|
1407
|
+
&:hover,
|
1408
|
+
&:focus,
|
1409
|
+
&:active {
|
1415
1410
|
color: $primary;
|
1416
1411
|
}
|
1417
1412
|
}
|
@@ -1439,7 +1434,7 @@ p[data-f-id="pbf"] {
|
|
1439
1434
|
}
|
1440
1435
|
|
1441
1436
|
.sub-title {
|
1442
|
-
font-size: .9em;
|
1437
|
+
font-size: 0.9em;
|
1443
1438
|
color: $textColor;
|
1444
1439
|
}
|
1445
1440
|
|
@@ -9,9 +9,9 @@ module SlashAdmin
|
|
9
9
|
before_action :handle_default
|
10
10
|
before_action :nestable_config
|
11
11
|
before_action :handle_default_params
|
12
|
-
before_action :
|
12
|
+
before_action :handle_associations
|
13
13
|
|
14
|
-
helper_method :list_params, :export_params, :create_params, :update_params, :show_params, :nested_params, :should_add_translatable?, :translatable_params, :tooltips
|
14
|
+
helper_method :list_params, :export_params, :create_params, :update_params, :show_params, :nested_params, :should_add_translatable?, :translatable_params, :available_locales, :tooltips
|
15
15
|
|
16
16
|
def index
|
17
17
|
authorize! :index, @model_class
|
@@ -386,7 +386,7 @@ module SlashAdmin
|
|
386
386
|
end
|
387
387
|
|
388
388
|
def handle_default_translations
|
389
|
-
|
389
|
+
available_locales.reject { |key| key == :root }.each do |locale|
|
390
390
|
translation = @model.translations.find_by_locale locale.to_s
|
391
391
|
if translation.nil?
|
392
392
|
@model.translations.build locale: locale
|
@@ -402,7 +402,11 @@ module SlashAdmin
|
|
402
402
|
params[:filters] ||= []
|
403
403
|
end
|
404
404
|
|
405
|
-
def
|
405
|
+
def available_locales
|
406
|
+
SlashAdmin.configuration.available_locales
|
407
|
+
end
|
408
|
+
|
409
|
+
def handle_associations
|
406
410
|
@belongs_to_fields = @model_class.reflect_on_all_associations(:belongs_to).map(&:name)
|
407
411
|
@has_many_fields = @model_class.reflect_on_all_associations(:has_many).map(&:name)
|
408
412
|
@has_one_fields = @model_class.reflect_on_all_associations(:has_one).map(&:name)
|
@@ -75,7 +75,9 @@
|
|
75
75
|
<% end %>
|
76
76
|
</td>
|
77
77
|
<% else %>
|
78
|
-
<td class="<%= attr.to_s.parameterize.underscore.downcase %>"
|
78
|
+
<td class="<%= attr.to_s.parameterize.underscore.downcase %>">
|
79
|
+
<%= render attr[attr.keys.first][:type].to_s, model: m, attr: attr.keys.first %>
|
80
|
+
</td>
|
79
81
|
<% end %>
|
80
82
|
<% else %>
|
81
83
|
<% if m.send(attr).is_a?(TrueClass) || m.send(attr).is_a?(FalseClass) %>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<% if should_add_translatable? %>
|
2
2
|
<h3 class="translations"><%= t('slash_admin.view.translations') %></h3>
|
3
3
|
<nav class="nav nav-tabs" id="language-tabs" role="tablist">
|
4
|
-
<%
|
5
|
-
<a class="nav-item nav-link <%=
|
4
|
+
<% available_locales.each do |locale| %>
|
5
|
+
<a class="nav-item nav-link <%= available_locales.first == locale ? 'active' : '' %>" id="nav-language-<%= locale %>" data-toggle="tab" href="#language-<%= locale %>" role="tab" aria-controls="language-<%= locale %>">
|
6
6
|
<img src='<%= image_path("slash_admin/#{locale.to_s}.png") %>' style="margin-right: 5px; max-width: 25px;">
|
7
7
|
</a>
|
8
8
|
<% end %>
|
9
9
|
</nav>
|
10
10
|
<div class="tab-content">
|
11
|
-
<%
|
12
|
-
<div class="tab-pane fade <%=
|
11
|
+
<% available_locales.each do |locale| %>
|
12
|
+
<div class="tab-pane fade <%= available_locales.first == locale ? 'show active' : '' %>" id="language-<%= locale %>" role="tabpanel" aria-labelledby="language-<%= locale %>-tab">
|
13
13
|
<%= f.globalize_fields_for locale do |g| %>
|
14
14
|
<% translatable_params.each do |a| %>
|
15
15
|
<%= render 'slash_admin/fields/form_group', f: g, a: a %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= truncate(strip_tags(model.send(attr)), length: 50) %>
|
@@ -27,7 +27,7 @@
|
|
27
27
|
</div>
|
28
28
|
</div>
|
29
29
|
<div class="col-lg-6 col-md-4 d-none d-sm-none d-md-flex ">
|
30
|
-
<div class="container-fluid container-fluid-devise bckg-login" align="center" style="background: url(https://source.unsplash.com/
|
30
|
+
<div class="container-fluid container-fluid-devise bckg-login" align="center" style="background: url(https://source.unsplash.com/collection/827743/960x1080) no-repeat; background-size: cover;">
|
31
31
|
</div>
|
32
32
|
</div>
|
33
33
|
</div>
|
@@ -10,8 +10,8 @@
|
|
10
10
|
<div class="navbar-nav mr-auto mt-2 mt-lg-0">
|
11
11
|
</div>
|
12
12
|
<ul class="nav right-nav-fix">
|
13
|
-
<li class="nav-item
|
14
|
-
<a class="nav-link
|
13
|
+
<li class="nav-item">
|
14
|
+
<a class="nav-link">
|
15
15
|
<% if current_admin.avatar.present? %>
|
16
16
|
<img src="<%= current_admin.avatar.url %>" class="rounded-circle"/>
|
17
17
|
<% else %>
|
@@ -74,8 +74,8 @@
|
|
74
74
|
<script type="text/javascript">
|
75
75
|
$(function() {
|
76
76
|
$(".clickable-row").click(function() {
|
77
|
-
|
78
|
-
|
77
|
+
var href = $(this).data("href");
|
78
|
+
var blank = $(this).data("blank");
|
79
79
|
|
80
80
|
if (blank === true) {
|
81
81
|
window.open = href;
|
data/lib/slash_admin.rb
CHANGED
@@ -23,4 +23,20 @@ require "http_accept_language"
|
|
23
23
|
require "batch_translation"
|
24
24
|
|
25
25
|
module SlashAdmin
|
26
|
+
class << self
|
27
|
+
attr_accessor :configuration
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.configure
|
31
|
+
self.configuration ||= Configuration.new
|
32
|
+
yield(configuration)
|
33
|
+
end
|
34
|
+
|
35
|
+
class Configuration
|
36
|
+
attr_accessor :available_locales
|
37
|
+
|
38
|
+
def initialize
|
39
|
+
@available_locales = I18n.available_locales
|
40
|
+
end
|
41
|
+
end
|
26
42
|
end
|
data/lib/slash_admin/engine.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
+
require "pagy"
|
2
|
+
require "pagy/extras/bootstrap"
|
3
|
+
require "pagy/extras/i18n"
|
4
|
+
require "pagy/extras/array"
|
5
|
+
|
1
6
|
module SlashAdmin
|
2
7
|
class Engine < ::Rails::Engine
|
3
8
|
isolate_namespace SlashAdmin
|
4
9
|
|
5
10
|
initializer "slash_admin.assets.precompile" do |app|
|
6
|
-
app.config.assets.precompile += %w
|
11
|
+
app.config.assets.precompile += %w(slash_admin slash_admin_manifest.js)
|
12
|
+
app.config.assets.paths << Pagy.root.join("javascripts")
|
7
13
|
end
|
8
14
|
end
|
9
15
|
end
|
data/lib/slash_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slash_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOVACS Nicolas
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -342,6 +342,7 @@ files:
|
|
342
342
|
- app/views/slash_admin/base/_data_show.html.erb
|
343
343
|
- app/views/slash_admin/base/_filters.html.erb
|
344
344
|
- app/views/slash_admin/base/_translatable_fields.html.erb
|
345
|
+
- app/views/slash_admin/base/_wysiwyg.html.erb
|
345
346
|
- app/views/slash_admin/base/edit.html.erb
|
346
347
|
- app/views/slash_admin/base/index.html.erb
|
347
348
|
- app/views/slash_admin/base/index.xls.erb
|
@@ -389,7 +390,6 @@ files:
|
|
389
390
|
- app/views/slash_admin/shared/_new_form_buttons.html.erb
|
390
391
|
- app/views/slash_admin/shared/_sub_header.html.erb
|
391
392
|
- app/views/slash_admin/shared/_tooltip.html.erb
|
392
|
-
- config/initializers/pagy.rb
|
393
393
|
- config/initializers/validators.rb
|
394
394
|
- config/locales/en.yml
|
395
395
|
- config/locales/fr.yml
|
@@ -399,6 +399,7 @@ files:
|
|
399
399
|
- lib/generators/slash_admin/controllers/controllers_generator.rb
|
400
400
|
- lib/generators/slash_admin/controllers/templates/controllers.erb
|
401
401
|
- lib/generators/slash_admin/install/install_generator.rb
|
402
|
+
- lib/generators/slash_admin/install/templates/initializer.rb
|
402
403
|
- lib/generators/slash_admin/install/templates/install.erb
|
403
404
|
- lib/generators/slash_admin/override_admin/override_admin_generator.rb
|
404
405
|
- lib/generators/slash_admin/override_admin/templates/admin.erb
|
@@ -440,7 +441,7 @@ homepage: https://github.com/nicovak/slash_admin
|
|
440
441
|
licenses:
|
441
442
|
- MIT
|
442
443
|
metadata: {}
|
443
|
-
post_install_message:
|
444
|
+
post_install_message:
|
444
445
|
rdoc_options: []
|
445
446
|
require_paths:
|
446
447
|
- lib
|
@@ -456,7 +457,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
456
457
|
version: '0'
|
457
458
|
requirements: []
|
458
459
|
rubygems_version: 3.1.2
|
459
|
-
signing_key:
|
460
|
+
signing_key:
|
460
461
|
specification_version: 4
|
461
462
|
summary: A modern and overridable admin gem, just the rails way.
|
462
463
|
test_files: []
|
data/config/initializers/pagy.rb
DELETED