cm-admin 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -2
- data/lib/cm_admin/version.rb +1 -1
- data/lib/generators/cm_admin/install_generator.rb +9 -1
- data/lib/generators/cm_admin/templates/assets/images/cm.png +0 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/application.css.scss +16 -13
- data/lib/generators/cm_admin/templates/assets/stylesheets/{_variable.scss → base/_variable.scss} +5 -2
- data/lib/generators/cm_admin/templates/assets/stylesheets/base/auth.scss +75 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/base/form.scss +125 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/base/input-styles.scss +72 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/base/main-nav.scss +79 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/base/scaffold.scss +95 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/base/show.scss +88 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/base/sidebar.scss +69 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/base/table.scss +246 -0
- data/lib/generators/cm_admin/templates/layouts/_navbar.html.slim +7 -8
- data/lib/generators/cm_admin/templates/layouts/_side_navbar.html.slim +7 -11
- data/lib/generators/cm_admin/templates/layouts/application.html.slim +3 -8
- data/lib/generators/cm_admin/templates/views/_form.erb +58 -29
- data/lib/generators/cm_admin/templates/views/_table.erb +20 -12
- data/lib/generators/cm_admin/templates/views/edit.erb +10 -0
- data/lib/generators/cm_admin/templates/views/index.erb +5 -5
- data/lib/generators/cm_admin/templates/views/new.erb +10 -0
- data/lib/generators/cm_admin/templates/views/reset_password.erb +12 -0
- data/lib/generators/cm_admin/templates/views/show.erb +17 -7
- data/lib/generators/cm_admin/templates/views/sign_in.erb +18 -0
- data/lib/generators/cm_admin/view_generator.rb +23 -2
- metadata +15 -11
- data/lib/generators/cm_admin/templates/assets/images/same-logo.png +0 -0
- data/lib/generators/cm_admin/templates/assets/stylesheets/alignment.scss +0 -111
- data/lib/generators/cm_admin/templates/assets/stylesheets/devise.scss +0 -98
- data/lib/generators/cm_admin/templates/assets/stylesheets/form.scss +0 -131
- data/lib/generators/cm_admin/templates/assets/stylesheets/products.scss +0 -21
- data/lib/generators/cm_admin/templates/assets/stylesheets/scaffold.scss +0 -241
- data/lib/generators/cm_admin/templates/assets/stylesheets/table.scss +0 -90
- data/lib/generators/cm_admin/templates/assets/stylesheets/user.scss +0 -25
- data/lib/generators/cm_admin/templates/views/_filters.html.slim +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 208e7113a6556a94cdba5289db7d672f6ba3443189c49789fc4f3c95d6a14dc2
|
4
|
+
data.tar.gz: b9201bb6da693871e2a3708bb8ac76ba352ee68b92c58413bd17038225b39ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b6937bc74d0aebd0220271d096b914e70183af91fa5ec2908d3d16b32afebb97d5a1fad1f049d2234f308b27e9a843a1b4a5df649290897c20dc4635217d870
|
7
|
+
data.tar.gz: 65146543054360dec133299268ae94e8579403d4a962c031835d449199dd7009271b85c31d59c8b46a42507e1ed41ad85d19dae953135789a9f10f5a488f5e28
|
data/README.md
CHANGED
@@ -43,10 +43,20 @@ For generating the show page views
|
|
43
43
|
|
44
44
|
$ rails g cm_admin:view products show title description
|
45
45
|
|
46
|
-
For generating the
|
47
|
-
|
46
|
+
For generating the form page views
|
47
|
+
$ rails g cm_admin:view products form column_name:field_type
|
48
48
|
$ rails g cm_admin:view products form title:string description:string
|
49
49
|
|
50
|
+
Following field types are acceted
|
51
|
+
|
52
|
+
* input-integer
|
53
|
+
* input-string
|
54
|
+
* single-select
|
55
|
+
* multi-select
|
56
|
+
* checkbox
|
57
|
+
* radio
|
58
|
+
|
59
|
+
|
50
60
|
## Development
|
51
61
|
|
52
62
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/cm_admin/version.rb
CHANGED
@@ -12,6 +12,14 @@ module CmAdmin
|
|
12
12
|
|
13
13
|
DESC
|
14
14
|
|
15
|
+
def add_required_gems
|
16
|
+
gem 'slim'
|
17
|
+
gem 'simple_form'
|
18
|
+
system("yarn add bootstrap")
|
19
|
+
system("yarn add @fortawesome/fontawesome-free")
|
20
|
+
system("yarn add select2")
|
21
|
+
end
|
22
|
+
|
15
23
|
def copy_layout_file
|
16
24
|
copy_file "layouts/_side_navbar.html.slim", "app/views/layouts/_side_navbar.html.slim"
|
17
25
|
copy_file "layouts/_navbar.html.slim", "app/views/layouts/_navbar.html.slim"
|
@@ -20,7 +28,7 @@ module CmAdmin
|
|
20
28
|
end
|
21
29
|
|
22
30
|
def copy_asset_file
|
23
|
-
copy_file "assets/images/
|
31
|
+
copy_file "assets/images/cm.png", "app/assets/images/cm.png"
|
24
32
|
directory "assets/stylesheets/", "app/assets/stylesheets/"
|
25
33
|
remove_file "app/assets/stylesheets/application.css"
|
26
34
|
end
|
Binary file
|
@@ -10,21 +10,24 @@
|
|
10
10
|
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
11
|
* It is generally better to create a new file per style scope.
|
12
12
|
*
|
13
|
-
*=
|
13
|
+
*= require 'base/table'
|
14
|
+
*= require 'base/main-nav'
|
15
|
+
*= require 'base/sidebar'
|
16
|
+
*= require 'base/show'
|
17
|
+
*= require 'base/form'
|
18
|
+
*= require 'base/scaffold'
|
19
|
+
*= require 'base/input-styles'
|
20
|
+
*= require 'base/auth'
|
14
21
|
*= require_self
|
15
|
-
*= require font-awesome
|
16
22
|
*= require 'select2'
|
17
23
|
*= require bootstrap/dist/css/bootstrap
|
24
|
+
*= require bootstrap-datepicker/dist/css/bootstrap-datepicker3
|
25
|
+
*= require daterangepicker
|
18
26
|
*/
|
19
27
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
}
|
27
|
-
|
28
|
-
.select2-selection {
|
29
|
-
height: 40px !important;
|
30
|
-
}
|
28
|
+
$fa-font-path: '@fortawesome/fontawesome-free/webfonts';
|
29
|
+
@import '@fortawesome/fontawesome-free/scss/fontawesome';
|
30
|
+
@import '@fortawesome/fontawesome-free/scss/solid';
|
31
|
+
@import '@fortawesome/fontawesome-free/scss/regular';
|
32
|
+
@import '@fortawesome/fontawesome-free/scss/brands';
|
33
|
+
@import '@fortawesome/fontawesome-free/scss/v4-shims';
|
data/lib/generators/cm_admin/templates/assets/stylesheets/{_variable.scss → base/_variable.scss}
RENAMED
@@ -1,4 +1,4 @@
|
|
1
|
-
$
|
1
|
+
$elephant-black: #1A1D1F;
|
2
2
|
$nav-btn-color: #FFCB05;
|
3
3
|
$nav-text-color: white;
|
4
4
|
$sidebar-background: #242536;
|
@@ -6,6 +6,9 @@ $main-background: #F6F8FA;
|
|
6
6
|
$table-background: #ffffff;
|
7
7
|
$heading-color: rgb(224, 193, 14);
|
8
8
|
$form-control-background: rgba(50,50,50,0.6) !important;
|
9
|
-
$nav-active-border: 4px solid #
|
9
|
+
$nav-active-border: 4px solid #0099ff;
|
10
10
|
$active-bg: #000000;
|
11
11
|
$paginate-btn-color: rgb(180, 149, 23);
|
12
|
+
|
13
|
+
//general colors
|
14
|
+
$white: #FFFFFF;
|
@@ -0,0 +1,75 @@
|
|
1
|
+
@import "_variable.scss";
|
2
|
+
|
3
|
+
.auth {
|
4
|
+
display: flex;
|
5
|
+
justify-content: center;
|
6
|
+
align-items: center;
|
7
|
+
width: 100%;
|
8
|
+
height: 100vh;
|
9
|
+
background-color: #1b1d1f;
|
10
|
+
&__form-inner {
|
11
|
+
width: 450px;
|
12
|
+
max-width: 450px;
|
13
|
+
margin: 0 auto;
|
14
|
+
.header-log {
|
15
|
+
text-align: center;
|
16
|
+
img {
|
17
|
+
width: 250px;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
.header-title {
|
21
|
+
margin: 30px 0;
|
22
|
+
letter-spacing: 2px;
|
23
|
+
text-align: center;
|
24
|
+
color: $white;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field-50 {
|
28
|
+
display: flex;
|
29
|
+
margin-bottom: 24px;
|
30
|
+
&__item {
|
31
|
+
width: 50%;
|
32
|
+
&:nth-child(2) {
|
33
|
+
margin-left: 20px;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
.field-100 {
|
39
|
+
width: 100%;
|
40
|
+
margin-bottom: 24px;
|
41
|
+
}
|
42
|
+
|
43
|
+
.get-start-btn {
|
44
|
+
width: 100%;
|
45
|
+
}
|
46
|
+
|
47
|
+
.forgot-password {
|
48
|
+
margin-bottom: 8px;
|
49
|
+
text-align: right;
|
50
|
+
a {
|
51
|
+
color: #20b5ff;
|
52
|
+
font-size: 14px;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
input {
|
57
|
+
display: block;
|
58
|
+
width: 100%;
|
59
|
+
height: 39px;
|
60
|
+
padding: 6px 12px;
|
61
|
+
font-size: 16px;
|
62
|
+
color: #555555;
|
63
|
+
background-color: $white;
|
64
|
+
border: 1px solid #ccc;
|
65
|
+
border-radius: 2px;
|
66
|
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
67
|
+
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
|
68
|
+
&:focus {
|
69
|
+
border-color: #66afe9 !important;
|
70
|
+
outline: 0 !important;
|
71
|
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6) !important;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
@import "_variable.scss";
|
2
|
+
|
3
|
+
.form-wrapper {
|
4
|
+
margin-top: 60px;
|
5
|
+
|
6
|
+
&__top-bar {
|
7
|
+
position: fixed;
|
8
|
+
top: 60px;
|
9
|
+
left: 250px;
|
10
|
+
display: flex;
|
11
|
+
align-items: center;
|
12
|
+
width: calc(100% - 250px);
|
13
|
+
height: 60px;
|
14
|
+
padding: 0 20px;
|
15
|
+
background-color: $white;
|
16
|
+
box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.06);
|
17
|
+
z-index: 9;
|
18
|
+
.back-btn {
|
19
|
+
color: #091e42;
|
20
|
+
font-size: 20px;
|
21
|
+
cursor: pointer;
|
22
|
+
span {
|
23
|
+
color: #0099ff;
|
24
|
+
margin-right: 8px;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
&__inner {
|
30
|
+
margin-top: 120px;
|
31
|
+
padding: 20px;
|
32
|
+
.paper {
|
33
|
+
padding: 20px;
|
34
|
+
background-color: $white;
|
35
|
+
box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.1);
|
36
|
+
border: 1px solid #ebecf0;
|
37
|
+
border-radius: 4px;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
.cm-admin-form {
|
42
|
+
max-width: 600px;
|
43
|
+
.form-field {
|
44
|
+
margin-bottom: 20px;
|
45
|
+
.form-label {
|
46
|
+
font-weight: 600;
|
47
|
+
color: #172b4d;
|
48
|
+
font-size: 14px;
|
49
|
+
margin-bottom: 0.5rem;
|
50
|
+
}
|
51
|
+
.form-input {
|
52
|
+
label {
|
53
|
+
font-weight: 600;
|
54
|
+
color: #172b4d;
|
55
|
+
font-size: 14px;
|
56
|
+
}
|
57
|
+
input {
|
58
|
+
width: 100%;
|
59
|
+
padding: 5px 10px;
|
60
|
+
border: 1px solid #c1c7d0;
|
61
|
+
border-radius: 2px;
|
62
|
+
&:focus {
|
63
|
+
border-color: #66afe9 !important;
|
64
|
+
outline: 0 !important;
|
65
|
+
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6) !important;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
.file-upload {
|
71
|
+
position: relative;
|
72
|
+
display: flex;
|
73
|
+
justify-content: center;
|
74
|
+
align-items: center;
|
75
|
+
width: 250px;
|
76
|
+
height: 80px;
|
77
|
+
border: 2px dashed #c1c7d0;
|
78
|
+
border-radius: 4px;
|
79
|
+
cursor: pointer;
|
80
|
+
input[type="file"] {
|
81
|
+
position: absolute;
|
82
|
+
top: 0;
|
83
|
+
right: 0;
|
84
|
+
bottom: 0;
|
85
|
+
left: 0;
|
86
|
+
opacity: 0;
|
87
|
+
cursor: pointer;
|
88
|
+
}
|
89
|
+
label {
|
90
|
+
color: #0099ff;
|
91
|
+
margin: 0;
|
92
|
+
cursor: pointer;
|
93
|
+
}
|
94
|
+
i {
|
95
|
+
color: #0099ff;
|
96
|
+
margin-left: 8px;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
.radio-label {
|
101
|
+
color: #172b4d;
|
102
|
+
font-size: 16px;
|
103
|
+
font-weight: 600;
|
104
|
+
margin-left: 8px;
|
105
|
+
}
|
106
|
+
|
107
|
+
.checkbox-label {
|
108
|
+
color: #172b4d;
|
109
|
+
font-size: 16px;
|
110
|
+
font-weight: 600;
|
111
|
+
margin-left: 8px;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
.form-actions {
|
116
|
+
input {
|
117
|
+
padding: 5px 10px;
|
118
|
+
color: $white;
|
119
|
+
background-color: #0099ff;
|
120
|
+
border: none;
|
121
|
+
border-radius: 4px;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
@import "_variable.scss";
|
2
|
+
|
3
|
+
//check box style
|
4
|
+
input.cm-checkbox[type='checkbox'] {
|
5
|
+
-webkit-font-smoothing: antialiased;
|
6
|
+
text-rendering: optimizeSpeed;
|
7
|
+
width: 20px;
|
8
|
+
height: 20px;
|
9
|
+
display: inline-block;
|
10
|
+
float: left;
|
11
|
+
position: relative;
|
12
|
+
margin-top: 2px;
|
13
|
+
|
14
|
+
&:after {
|
15
|
+
content: "";
|
16
|
+
vertical-align: middle;
|
17
|
+
text-align: center;
|
18
|
+
position: absolute;
|
19
|
+
cursor: pointer;
|
20
|
+
height: 20px;
|
21
|
+
width: 20px;
|
22
|
+
font-size: 7px;
|
23
|
+
background: $white;
|
24
|
+
border: 1px solid #ccc;
|
25
|
+
border-radius: 2px;
|
26
|
+
line-height: 16px;
|
27
|
+
}
|
28
|
+
|
29
|
+
&:checked:after {
|
30
|
+
background: #0099ff;
|
31
|
+
content: "\2713";
|
32
|
+
font-size: 16px;
|
33
|
+
line-height: 18px;
|
34
|
+
font-weight: bold;
|
35
|
+
color: $white;
|
36
|
+
border: none;
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
//Radio button styles
|
41
|
+
input.cm-radio[type='radio'] {
|
42
|
+
-webkit-font-smoothing: antialiased;
|
43
|
+
text-rendering: optimizeSpeed;
|
44
|
+
width: 20px;
|
45
|
+
height: 16px;
|
46
|
+
display: inline-block;
|
47
|
+
position: relative;
|
48
|
+
margin-top: 3px;
|
49
|
+
&:focus {
|
50
|
+
outline: none;
|
51
|
+
}
|
52
|
+
&:after {
|
53
|
+
content: "";
|
54
|
+
vertical-align: middle;
|
55
|
+
text-align: center;
|
56
|
+
position: absolute;
|
57
|
+
height: 20px;
|
58
|
+
width: 20px;
|
59
|
+
background-color: $white;
|
60
|
+
border: 1px solid #D9DEE3;
|
61
|
+
border-radius: 50%;
|
62
|
+
cursor: pointer;
|
63
|
+
}
|
64
|
+
&:checked:after {
|
65
|
+
background-color: #0099ff;
|
66
|
+
content: "\25CF";
|
67
|
+
color: $white;
|
68
|
+
font-size: 12px;
|
69
|
+
line-height: 20px;
|
70
|
+
border: none;
|
71
|
+
}
|
72
|
+
}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
@import "_variable.scss";
|
2
|
+
|
3
|
+
.main-nav {
|
4
|
+
position: fixed;
|
5
|
+
top: 0;
|
6
|
+
right: 0;
|
7
|
+
left: 250px;
|
8
|
+
display: flex;
|
9
|
+
justify-content: space-between;
|
10
|
+
align-items: center;
|
11
|
+
width: calc(100% - 250px);
|
12
|
+
height: 60px;
|
13
|
+
padding: 0 20px;
|
14
|
+
background-color: $elephant-black;
|
15
|
+
box-shadow: 0 0 2px 0 rgba(0,0,0,0.23), 0 1px 0 0 rgba(0,0,0,0.1);
|
16
|
+
z-index: 99;
|
17
|
+
&__lhs {
|
18
|
+
|
19
|
+
}
|
20
|
+
&__rhs {
|
21
|
+
.profile-avatar {
|
22
|
+
position: relative;
|
23
|
+
width: 30px;
|
24
|
+
height: 30px;
|
25
|
+
background-color: #3ACA60;
|
26
|
+
text-align: center;
|
27
|
+
border-radius: 50%;
|
28
|
+
cursor: pointer;
|
29
|
+
span {
|
30
|
+
color: $white;
|
31
|
+
font-size: 14px;
|
32
|
+
vertical-align: middle;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
.auth-popup {
|
37
|
+
display: none;
|
38
|
+
position: absolute;
|
39
|
+
top: 45px;
|
40
|
+
right: -10px;
|
41
|
+
min-width: 160px;
|
42
|
+
padding: 10px 0;
|
43
|
+
background-color: $white;
|
44
|
+
box-shadow: 0 6px 12px rgba(0,0,0,0.175);
|
45
|
+
border-radius: 4px;
|
46
|
+
z-index: 999;
|
47
|
+
&::before {
|
48
|
+
content: "";
|
49
|
+
border-bottom: 10px solid white;
|
50
|
+
border-right: 10px solid transparent;
|
51
|
+
border-left: 10px solid transparent;
|
52
|
+
position: absolute;
|
53
|
+
top: -10px;
|
54
|
+
right: 16px;
|
55
|
+
z-index: 10;
|
56
|
+
}
|
57
|
+
&::after {
|
58
|
+
content: "";
|
59
|
+
border-bottom: 12px solid #ccc;
|
60
|
+
border-right: 12px solid transparent;
|
61
|
+
border-left: 12px solid transparent;
|
62
|
+
position: absolute;
|
63
|
+
top: -12px;
|
64
|
+
right: 14px;
|
65
|
+
z-index: 9;
|
66
|
+
}
|
67
|
+
p {
|
68
|
+
margin: 0;
|
69
|
+
cursor: pointer;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
|
73
|
+
.profile-avatar:hover {
|
74
|
+
.auth-popup {
|
75
|
+
display: block;
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|