slash_admin 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +38 -11
- data/app/assets/config/slash_admin_manifest.js +2 -2
- data/app/assets/stylesheets/slash_admin/application.scss +57 -59
- data/app/helpers/slash_admin/application_helper.rb +2 -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/lib/slash_admin/engine.rb +7 -1
- data/lib/slash_admin/version.rb +1 -1
- metadata +2 -3
- 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: b42c98abab9d671f4d925ba48fa5c94c0fe6a55c155f12acb911523c5c8aaa86
|
4
|
+
data.tar.gz: 66357a010404330066abcc1414d5e6c4a1f6a36ef27dce5debd0f03cf48c4472
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e60105aa9b1bea203ab1e47b2300b0ed8cc4cfb89bdc33155ea9e5ee40eb45405544d3d1f57983a5defc4354528ad91b37f0915d51882ce3dd87ec138894bc4e
|
7
|
+
data.tar.gz: 91a2b1f78f5943e4e950927d342bfd0808e7ee74ac0becc820463a9a92734df89d1b8fc667dd672db09b5d0a9259068d7da9c2a78f297923c067d494a0c133c0
|
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
|
[![Gem Version](https://badge.fury.io/rb/slash_admin.svg)](https://badge.fury.io/rb/slash_admin)
|
8
|
-
[![Code Climate](https://codeclimate.com/github/nicovak/slash_admin/badges/gpa.svg)](https://codeclimate.com/github/nicovak/slash_admin)
|
9
8
|
[![CircleCI](https://circleci.com/gh/nicovak/slash_admin/tree/master.svg?style=svg&circle-token=6e9ebd7fef3ebc881c75a769b0970808024a2ae9)](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
|
-
![Image of Login screen](https://i.imgur.com/
|
36
|
+
![Image of Login screen](https://i.imgur.com/ftwC0rF.png)
|
38
37
|
##### Dashboard
|
39
|
-
![Image of Dashboard](https://i.imgur.com/
|
38
|
+
![Image of Dashboard](https://i.imgur.com/3JzkvoT.png)
|
40
39
|
##### List
|
41
|
-
![Image of List](https://i.imgur.com/
|
40
|
+
![Image of List](https://i.imgur.com/y6Vz6S1.png)
|
42
41
|
##### Edit / Create
|
43
|
-
![Image of Create / Edit](https://i.imgur.com/
|
42
|
+
![Image of Create / Edit](https://i.imgur.com/S2QqHWF.png)
|
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 administrate/application.css
|
90
|
+
//= link administrate/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
|
@@ -1,37 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
*= require select2/select2-bootstrap4
|
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 "codemirror/codemirror";
|
14
|
+
@import "codemirror/theme/relax-seti";
|
15
|
+
@import "codemirror/lint/lint";
|
16
|
+
@import "colors";
|
17
|
+
@import "alert";
|
35
18
|
|
36
19
|
$pagination-padding-y: 0.4rem !default;
|
37
20
|
$pagination-border-width: 0 !default;
|
@@ -155,7 +138,8 @@ p[data-f-id="pbf"] {
|
|
155
138
|
}
|
156
139
|
|
157
140
|
.select2-container--bootstrap4 .select2-results__option--highlighted,
|
158
|
-
.select2-container--bootstrap4
|
141
|
+
.select2-container--bootstrap4
|
142
|
+
.select2-results__option--highlighted.select2-results__option[aria-selected="true"] {
|
159
143
|
background-color: $primary;
|
160
144
|
color: white;
|
161
145
|
}
|
@@ -178,20 +162,27 @@ p[data-f-id="pbf"] {
|
|
178
162
|
background: $input;
|
179
163
|
}
|
180
164
|
|
181
|
-
.select2-container--bootstrap4
|
165
|
+
.select2-container--bootstrap4
|
166
|
+
.select2-selection--multiple
|
167
|
+
.select2-selection__choice {
|
182
168
|
word-break: break-all;
|
183
169
|
background: white;
|
184
170
|
}
|
185
171
|
|
186
172
|
.select2-container .select2-results__option--highlighted,
|
187
|
-
.select2-container
|
188
|
-
|
173
|
+
.select2-container
|
174
|
+
.select2-results__option--highlighted.select2-results__option[aria-selected="true"],
|
175
|
+
.select2-container--bootstrap4
|
176
|
+
.select2-dropdown
|
177
|
+
.select2-results__option[aria-selected="true"] {
|
189
178
|
background-color: $primary;
|
190
179
|
color: white;
|
191
180
|
}
|
192
181
|
|
193
|
-
.select2-container--bootstrap4.select2-container--focus
|
194
|
-
|
182
|
+
.select2-container--bootstrap4.select2-container--focus
|
183
|
+
.select2-selection--multiple,
|
184
|
+
.select2-container--bootstrap4.select2-container--focus
|
185
|
+
.select2-selection--single {
|
195
186
|
border: 1px solid $border;
|
196
187
|
background: $input;
|
197
188
|
}
|
@@ -211,7 +202,9 @@ p[data-f-id="pbf"] {
|
|
211
202
|
background: none;
|
212
203
|
}
|
213
204
|
|
214
|
-
.select2-container--bootstrap4
|
205
|
+
.select2-container--bootstrap4
|
206
|
+
.select2-search--dropdown
|
207
|
+
.select2-search__field {
|
215
208
|
border-color: $border;
|
216
209
|
}
|
217
210
|
|
@@ -397,18 +390,18 @@ p[data-f-id="pbf"] {
|
|
397
390
|
position: relative;
|
398
391
|
height: 80px;
|
399
392
|
width: 100%;
|
400
|
-
transition: all ease .6s;
|
393
|
+
transition: all ease 0.6s;
|
401
394
|
}
|
402
395
|
|
403
396
|
.image-overlay {
|
404
|
-
transition: all ease .6s;
|
397
|
+
transition: all ease 0.6s;
|
405
398
|
position: absolute;
|
406
399
|
width: 100%;
|
407
400
|
height: 100%;
|
408
|
-
background: rgba($primary,
|
401
|
+
background: rgba($primary, 0);
|
409
402
|
|
410
403
|
.icon-zoom-image {
|
411
|
-
transition: all ease .6s;
|
404
|
+
transition: all ease 0.6s;
|
412
405
|
position: absolute;
|
413
406
|
top: 50%;
|
414
407
|
left: 50%;
|
@@ -418,7 +411,7 @@ p[data-f-id="pbf"] {
|
|
418
411
|
}
|
419
412
|
|
420
413
|
&:hover {
|
421
|
-
background: rgba($primary, .4);
|
414
|
+
background: rgba($primary, 0.4);
|
422
415
|
|
423
416
|
.icon-zoom-image {
|
424
417
|
opacity: 1;
|
@@ -589,10 +582,6 @@ p[data-f-id="pbf"] {
|
|
589
582
|
display: flex;
|
590
583
|
align-items: center;
|
591
584
|
|
592
|
-
&:hover {
|
593
|
-
background: #f9fafc;
|
594
|
-
}
|
595
|
-
|
596
585
|
&.active {
|
597
586
|
color: $textColorHover;
|
598
587
|
}
|
@@ -869,9 +858,10 @@ p[data-f-id="pbf"] {
|
|
869
858
|
display: none;
|
870
859
|
padding: 9px 15px;
|
871
860
|
|
872
|
-
tr,
|
861
|
+
tr,
|
862
|
+
a {
|
873
863
|
color: $textColor;
|
874
|
-
transition: all .6s ease;
|
864
|
+
transition: all 0.6s ease;
|
875
865
|
cursor: pointer;
|
876
866
|
|
877
867
|
&.active {
|
@@ -1051,7 +1041,7 @@ p[data-f-id="pbf"] {
|
|
1051
1041
|
border-color: rgba(121, 133, 166, 0.1) !important;
|
1052
1042
|
margin-top: 1rem;
|
1053
1043
|
background: #fff;
|
1054
|
-
font-size: .9em;
|
1044
|
+
font-size: 0.9em;
|
1055
1045
|
|
1056
1046
|
.fit {
|
1057
1047
|
white-space: nowrap;
|
@@ -1085,8 +1075,12 @@ p[data-f-id="pbf"] {
|
|
1085
1075
|
margin-top: 0.5rem;
|
1086
1076
|
}
|
1087
1077
|
|
1088
|
-
.select2-container--bootstrap4
|
1089
|
-
|
1078
|
+
.select2-container--bootstrap4
|
1079
|
+
.select2-selection--single
|
1080
|
+
.select2-selection__choice,
|
1081
|
+
.select2-container--bootstrap4
|
1082
|
+
.select2-selection--multiple
|
1083
|
+
.select2-selection__choice {
|
1090
1084
|
display: flex;
|
1091
1085
|
clear: both;
|
1092
1086
|
}
|
@@ -1350,7 +1344,9 @@ p[data-f-id="pbf"] {
|
|
1350
1344
|
height: 45px;
|
1351
1345
|
}
|
1352
1346
|
|
1353
|
-
.cookies-eu,
|
1347
|
+
.cookies-eu,
|
1348
|
+
.cookies-eu-button-holder,
|
1349
|
+
.cookies-eu-content-holder {
|
1354
1350
|
display: flex;
|
1355
1351
|
line-height: normal;
|
1356
1352
|
}
|
@@ -1397,7 +1393,7 @@ p[data-f-id="pbf"] {
|
|
1397
1393
|
}
|
1398
1394
|
|
1399
1395
|
label {
|
1400
|
-
font-size: .85em;
|
1396
|
+
font-size: 0.85em;
|
1401
1397
|
color: $textColor;
|
1402
1398
|
text-transform: uppercase;
|
1403
1399
|
margin-bottom: 0.25rem;
|
@@ -1411,7 +1407,9 @@ p[data-f-id="pbf"] {
|
|
1411
1407
|
a {
|
1412
1408
|
color: $textColor;
|
1413
1409
|
|
1414
|
-
&:hover,
|
1410
|
+
&:hover,
|
1411
|
+
&:focus,
|
1412
|
+
&:active {
|
1415
1413
|
color: $primary;
|
1416
1414
|
}
|
1417
1415
|
}
|
@@ -1439,7 +1437,7 @@ p[data-f-id="pbf"] {
|
|
1439
1437
|
}
|
1440
1438
|
|
1441
1439
|
.sub-title {
|
1442
|
-
font-size: .9em;
|
1440
|
+
font-size: 0.9em;
|
1443
1441
|
color: $textColor;
|
1444
1442
|
}
|
1445
1443
|
|
@@ -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 %>
|
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.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOVACS Nicolas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -389,7 +389,6 @@ files:
|
|
389
389
|
- app/views/slash_admin/shared/_new_form_buttons.html.erb
|
390
390
|
- app/views/slash_admin/shared/_sub_header.html.erb
|
391
391
|
- app/views/slash_admin/shared/_tooltip.html.erb
|
392
|
-
- config/initializers/pagy.rb
|
393
392
|
- config/initializers/validators.rb
|
394
393
|
- config/locales/en.yml
|
395
394
|
- config/locales/fr.yml
|
data/config/initializers/pagy.rb
DELETED