rails_material_admin 0.1.8 → 0.1.9
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 +16 -0
- data/app/helpers/admin_helper.rb +10 -1
- data/lib/generators/material_admin/material_admin_generator.rb +2 -2
- data/lib/material_admin/version.rb +1 -1
- data/vendor/javascript/packs/admin.js +1 -1
- data/vendor/javascript/packs/admin_style.js +1 -1
- data/vendor/javascript/src/stylesheets/admin/shared/common.scss +47 -36
- data/vendor/javascript/src/stylesheets/admin/shared/{overide.scss → override.scss} +5 -27
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e149cf1845f01081d80159c39143ed16a50d26bc5f91451f74258b2a107a415f
|
4
|
+
data.tar.gz: b40e938e32a9025500b2cd7934398ec428abdca35db677ccefa23292eef49e4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50e463b925990f31db34e5034f977329a8be8d81ccd96bd9450f02140d0d052741958075aa858e2c00447ef0a0b9f225a259601c71024fab72c180df84f16017
|
7
|
+
data.tar.gz: ca4f286534ac41bb5350da901d240d93dfdb441cff226fcedd287a4bd256392f14cdf23240143d694d99f1d9ae02811f68fc1aeb13577a07369e75f0e2434378
|
data/README.md
CHANGED
@@ -8,6 +8,22 @@ Easily install and set up admin quickly
|
|
8
8
|
## Prerequisite
|
9
9
|
- Need set up your db first
|
10
10
|
|
11
|
+
```
|
12
|
+
// Gemfile
|
13
|
+
gem 'webpacker', '~> 5.0'
|
14
|
+
|
15
|
+
|
16
|
+
// package.json
|
17
|
+
{
|
18
|
+
"dependencies": {
|
19
|
+
"@rails/webpacker": "5.4.2",
|
20
|
+
},
|
21
|
+
"devDependencies": {
|
22
|
+
"webpack-dev-server": "^3.11.2"
|
23
|
+
}
|
24
|
+
}
|
25
|
+
```
|
26
|
+
|
11
27
|
|
12
28
|
## Usage
|
13
29
|
### Installation
|
data/app/helpers/admin_helper.rb
CHANGED
@@ -18,6 +18,16 @@ module ApplicationHelper
|
|
18
18
|
{ model: model, column: column }.to_json
|
19
19
|
end
|
20
20
|
|
21
|
+
def sub_item_active?(sub_c_names = [])
|
22
|
+
class_names = 'sidebar-item'
|
23
|
+
|
24
|
+
if controller_name.in?(sub_c_names)
|
25
|
+
class_names += ' active'
|
26
|
+
end
|
27
|
+
|
28
|
+
class_names
|
29
|
+
end
|
30
|
+
|
21
31
|
def sidebar_item_classes(c_names, *a_names)
|
22
32
|
class_names = 'sidebar-item'
|
23
33
|
|
@@ -41,5 +51,4 @@ module ApplicationHelper
|
|
41
51
|
|
42
52
|
class_names
|
43
53
|
end
|
44
|
-
|
45
54
|
end
|
@@ -6,11 +6,11 @@ class MaterialAdminGenerator < Rails::Generators::NamedBase
|
|
6
6
|
GEM_NAME = 'rails_material_admin'
|
7
7
|
GEM_PATH = Gem.loaded_specs[GEM_NAME].full_gem_path
|
8
8
|
JS_PKGS =
|
9
|
-
'datatables.net-
|
9
|
+
'datatables.net-bs5 datatables.net-responsive-bs5'\
|
10
10
|
' expose-loader file-loader url-loader resolve-url-loader'\
|
11
11
|
' @rails/ujs @rails/activestorage'\
|
12
12
|
' stimulus turbolinks'\
|
13
|
-
' jquery popper.js select2 @popperjs/core'
|
13
|
+
' jquery popper.js select2 @popperjs/core webpack-cli'
|
14
14
|
ESLINT_JS_PKGS =
|
15
15
|
'eslint prettier eslint-plugin-prettier eslint-config-prettier'\
|
16
16
|
' stylelint stylelint-config-prettier stylelint-config-recommended stylelint-scss'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import 'select2/dist/css/select2.css'
|
2
2
|
|
3
|
-
import '../../../node_modules/datatables.net-
|
3
|
+
import '../../../node_modules/datatables.net-bs5/css/dataTables.bootstrap5.css';
|
4
4
|
import '../vendor/rails_material_admin/material_admin.scss';
|
5
5
|
import '../src/stylesheets/shared/atom.scss';
|
6
6
|
import '../src/stylesheets/admin/shared/override.scss';
|
@@ -13,48 +13,59 @@ ul#sidebarnav > li > a {
|
|
13
13
|
}
|
14
14
|
|
15
15
|
/* form */
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
display: flex;
|
20
|
-
flex-direction: column;
|
21
|
-
justify-content: center;
|
22
|
-
}
|
16
|
+
[type='checkbox'] + label {
|
17
|
+
margin-right: 15px;
|
18
|
+
}
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
[type='radio'] + label {
|
21
|
+
margin-right: 15px;
|
22
|
+
}
|
23
|
+
|
24
|
+
form .form-body .form-group > label {
|
25
|
+
display: flex;
|
26
|
+
flex-direction: column;
|
27
|
+
justify-content: center;
|
28
|
+
}
|
29
|
+
|
30
|
+
.form-body .form-group {
|
31
|
+
padding-bottom: 0;
|
32
|
+
margin-bottom: 14px;
|
33
|
+
border-bottom: none;
|
34
|
+
}
|
29
35
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
span.select2.select2-container .selection .select2-selection {
|
43
|
-
border-color: #fc4b6c;
|
44
|
-
padding-right: calc(1.5em + .75rem);
|
45
|
-
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23fc4b6c'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23fc4b6c' stroke='none'/%3e%3c/svg%3e");
|
46
|
-
background-repeat: no-repeat;
|
47
|
-
background-position: right calc(.375em + 1rem) center;
|
48
|
-
background-size: calc(.75em + .375rem) calc(.75em + .375rem);
|
49
|
-
}
|
36
|
+
|
37
|
+
input[type='text'].form-control,
|
38
|
+
textarea.form-control {
|
39
|
+
&::-webkit-input-placeholder {
|
40
|
+
font-weight: 300;
|
41
|
+
}
|
42
|
+
&::-moz-placeholder {
|
43
|
+
font-weight: 300;
|
44
|
+
}
|
45
|
+
&:-ms-input-placeholder {
|
46
|
+
font-weight: 300;
|
50
47
|
}
|
48
|
+
&:-moz-placeholder {
|
49
|
+
font-weight: 300;
|
50
|
+
}
|
51
|
+
}
|
51
52
|
|
52
|
-
|
53
|
-
|
53
|
+
#error_explanation ul {
|
54
|
+
margin-bottom: 0;
|
55
|
+
}
|
56
|
+
|
57
|
+
.input-group-text {
|
58
|
+
.form-check {
|
59
|
+
margin-bottom: 0;
|
54
60
|
}
|
55
61
|
|
56
|
-
|
57
|
-
margin-
|
62
|
+
.form-check-label {
|
63
|
+
margin-bottom: 0;
|
58
64
|
}
|
59
65
|
}
|
60
66
|
|
67
|
+
|
68
|
+
/* table */
|
69
|
+
table.editable-table td.select-cell {
|
70
|
+
padding: 0;
|
71
|
+
}
|
@@ -51,34 +51,12 @@ html, body {
|
|
51
51
|
width: 100% !important;
|
52
52
|
}
|
53
53
|
|
54
|
-
.select2-container--default .select2-selection--single .select2-selection__placeholder {
|
55
|
-
font-size: 16px;
|
56
|
-
color: #67757c;
|
57
|
-
}
|
58
54
|
|
59
|
-
|
60
|
-
|
55
|
+
/* DataTable */
|
56
|
+
div.dataTables_wrapper div.dataTables_paginate {
|
57
|
+
margin-top: 8px;
|
61
58
|
}
|
62
59
|
|
63
|
-
|
64
|
-
|
65
|
-
.input-group>:not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) {
|
66
|
-
margin-left: -1px;
|
67
|
-
border-top-left-radius: 0;
|
68
|
-
border-bottom-left-radius: 0;
|
60
|
+
.page-wrapper {
|
61
|
+
transition: none;
|
69
62
|
}
|
70
|
-
|
71
|
-
.input-group:not(.has-validation)>.dropdown-toggle:nth-last-child(n+3), .input-group:not(.has-validation)>:not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
|
72
|
-
border-top-right-radius: 0;
|
73
|
-
border-bottom-right-radius: 0;
|
74
|
-
}
|
75
|
-
|
76
|
-
.form-control, .form-control::placeholder {
|
77
|
-
font-weight: 200;
|
78
|
-
}
|
79
|
-
|
80
|
-
.btn.active.focus, .btn.active:focus,
|
81
|
-
.btn.focus, .btn:active.focus, .btn:active:focus, .btn:focus {
|
82
|
-
outline: none;
|
83
|
-
}
|
84
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_material_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tracy Cai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -60,7 +60,7 @@ files:
|
|
60
60
|
- vendor/javascript/src/javascripts/admin/common/scaffold.js
|
61
61
|
- vendor/javascript/src/javascripts/lib/utils_datatables.js
|
62
62
|
- vendor/javascript/src/stylesheets/admin/shared/common.scss
|
63
|
-
- vendor/javascript/src/stylesheets/admin/shared/
|
63
|
+
- vendor/javascript/src/stylesheets/admin/shared/override.scss
|
64
64
|
- vendor/javascript/src/stylesheets/shared/atom.scss
|
65
65
|
- vendor/javascript/src/stylesheets/shared/override.scss
|
66
66
|
- vendor/rails_material_admin/css/animate.scss
|