cm-admin 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +6 -0
  5. data/Gemfile +6 -1
  6. data/Gemfile.lock +118 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +6 -40
  9. data/app/assets/images/logo.png +0 -0
  10. data/{lib/generators/cm_admin/templates/assets/stylesheets → app/assets/stylesheets/cm_admin}/base/auth.scss +16 -6
  11. data/app/assets/stylesheets/cm_admin/base/common.scss +237 -0
  12. data/app/assets/stylesheets/cm_admin/base/filters.scss +199 -0
  13. data/app/assets/stylesheets/cm_admin/base/form.scss +262 -0
  14. data/app/assets/stylesheets/cm_admin/base/main-nav.scss +47 -0
  15. data/app/assets/stylesheets/cm_admin/base/navbar.scss +67 -0
  16. data/app/assets/stylesheets/cm_admin/base/quicksearch.scss +69 -0
  17. data/app/assets/stylesheets/cm_admin/base/scaffold.scss +61 -0
  18. data/app/assets/stylesheets/cm_admin/base/show.scss +54 -0
  19. data/app/assets/stylesheets/cm_admin/base/sidebar.scss +225 -0
  20. data/app/assets/stylesheets/cm_admin/base/table.scss +303 -0
  21. data/app/assets/stylesheets/cm_admin/base/tabs.scss +26 -0
  22. data/app/assets/stylesheets/cm_admin/cm_admin.css.scss +26 -0
  23. data/app/assets/stylesheets/cm_admin/components/_alerts.scss +101 -0
  24. data/app/assets/stylesheets/cm_admin/components/_buttons.scss +135 -0
  25. data/app/assets/stylesheets/cm_admin/components/_dropdown-popup.scss +141 -0
  26. data/app/assets/stylesheets/cm_admin/components/_input.scss +274 -0
  27. data/app/assets/stylesheets/cm_admin/components/_modal.scss +34 -0
  28. data/app/assets/stylesheets/cm_admin/components/_range.scss +20 -0
  29. data/app/assets/stylesheets/cm_admin/components/_status-tag.scss +67 -0
  30. data/app/assets/stylesheets/cm_admin/components/index.scss +7 -0
  31. data/app/assets/stylesheets/cm_admin/dependency/bootstrap.min.css +7 -0
  32. data/app/assets/stylesheets/cm_admin/helpers/_mixins.scss +20 -0
  33. data/app/assets/stylesheets/cm_admin/helpers/_variable.scss +86 -0
  34. data/app/assets/stylesheets/cm_admin/helpers/index.scss +2 -0
  35. data/app/controllers/cm_admin/application_controller.rb +6 -0
  36. data/app/controllers/cm_admin/exports_controller.rb +16 -0
  37. data/app/controllers/cm_admin/main_controller.rb +8 -0
  38. data/app/helpers/cm_admin/application_helper.rb +11 -0
  39. data/app/javascript/packs/cm_admin/application.js +9 -0
  40. data/app/javascript/packs/cm_admin/filters.js +32 -0
  41. data/app/javascript/packs/cm_admin/scaffolds.js +14 -0
  42. data/app/views/cm_admin/main/_cm_pagy_nav.html.slim +23 -0
  43. data/app/views/cm_admin/main/_filters.html.slim +10 -0
  44. data/app/views/cm_admin/main/_table.html.slim +59 -0
  45. data/app/views/cm_admin/main/_top_navbar.html.slim +25 -0
  46. data/app/views/cm_admin/main/dashboard.html.slim +1 -0
  47. data/app/views/cm_admin/main/edit.html.slim +19 -0
  48. data/app/views/cm_admin/main/index.html.slim +9 -0
  49. data/app/views/cm_admin/main/new.html.slim +22 -0
  50. data/app/views/cm_admin/main/show.html.slim +13 -0
  51. data/app/views/layouts/_left_sidebar_nav.html.slim +30 -0
  52. data/app/views/layouts/cm_admin.html.slim +18 -0
  53. data/bin/console +1 -0
  54. data/bin/webpack +18 -0
  55. data/bin/webpack-dev-server +18 -0
  56. data/cm_admin.gemspec +20 -31
  57. data/{lib → config}/.DS_Store +0 -0
  58. data/config/initializers/active_record_extension.rb +9 -0
  59. data/config/routes.rb +18 -0
  60. data/config/webpack/development.js +5 -0
  61. data/config/webpack/environment.js +12 -0
  62. data/config/webpack/production.js +5 -0
  63. data/config/webpack/test.js +5 -0
  64. data/config/webpacker.yml +92 -0
  65. data/lib/c.png +0 -0
  66. data/lib/cm_admin.rb +31 -2
  67. data/lib/cm_admin/constants.rb +33 -0
  68. data/lib/cm_admin/engine.rb +38 -0
  69. data/lib/cm_admin/model.rb +262 -0
  70. data/lib/cm_admin/models/action.rb +22 -0
  71. data/lib/cm_admin/models/actions/blocks.rb +25 -0
  72. data/lib/cm_admin/models/blocks.rb +19 -0
  73. data/lib/cm_admin/models/column.rb +16 -0
  74. data/lib/cm_admin/models/export.rb +43 -0
  75. data/lib/cm_admin/models/field.rb +14 -0
  76. data/lib/cm_admin/models/filter.rb +30 -0
  77. data/lib/cm_admin/utils.rb +67 -0
  78. data/lib/cm_admin/version.rb +1 -1
  79. data/lib/cm_admin/view_helpers.rb +72 -0
  80. data/lib/cm_admin/view_helpers/field_column_helper.rb +23 -0
  81. data/lib/cm_admin/view_helpers/form_field_helper.rb +16 -0
  82. data/lib/cm_admin/view_helpers/form_helper.rb +55 -0
  83. data/lib/cm_admin/view_helpers/navigation_helper.rb +18 -0
  84. data/lib/cm_admin/view_helpers/page_info_helper.rb +21 -0
  85. data/lib/generators/cm_admin/install_generator.rb +10 -32
  86. data/lib/generators/cm_admin/templates/cm_admin_initializer.rb +4 -0
  87. data/lib/tasks/webpack_install.rake +63 -0
  88. data/package.json +18 -0
  89. data/postcss.config.js +12 -0
  90. data/yarn-error.log +44 -0
  91. data/yarn.lock +6903 -0
  92. metadata +123 -48
  93. data/CODE_OF_CONDUCT.md +0 -74
  94. data/lib/generators/cm_admin/USAGE +0 -8
  95. data/lib/generators/cm_admin/templates/assets/images/cm.png +0 -0
  96. data/lib/generators/cm_admin/templates/assets/stylesheets/application.css.scss +0 -33
  97. data/lib/generators/cm_admin/templates/assets/stylesheets/base/_variable.scss +0 -14
  98. data/lib/generators/cm_admin/templates/assets/stylesheets/base/form.scss +0 -125
  99. data/lib/generators/cm_admin/templates/assets/stylesheets/base/input-styles.scss +0 -72
  100. data/lib/generators/cm_admin/templates/assets/stylesheets/base/main-nav.scss +0 -79
  101. data/lib/generators/cm_admin/templates/assets/stylesheets/base/scaffold.scss +0 -95
  102. data/lib/generators/cm_admin/templates/assets/stylesheets/base/show.scss +0 -88
  103. data/lib/generators/cm_admin/templates/assets/stylesheets/base/sidebar.scss +0 -69
  104. data/lib/generators/cm_admin/templates/assets/stylesheets/base/table.scss +0 -246
  105. data/lib/generators/cm_admin/templates/layouts/_navbar.html.slim +0 -8
  106. data/lib/generators/cm_admin/templates/layouts/_side_navbar.html.slim +0 -12
  107. data/lib/generators/cm_admin/templates/layouts/application.html.slim +0 -20
  108. data/lib/generators/cm_admin/templates/layouts/initializer.rb +0 -2
  109. data/lib/generators/cm_admin/templates/views/_form.erb +0 -67
  110. data/lib/generators/cm_admin/templates/views/_table.erb +0 -22
  111. data/lib/generators/cm_admin/templates/views/edit.erb +0 -10
  112. data/lib/generators/cm_admin/templates/views/index.erb +0 -11
  113. data/lib/generators/cm_admin/templates/views/new.erb +0 -10
  114. data/lib/generators/cm_admin/templates/views/reset_password.erb +0 -12
  115. data/lib/generators/cm_admin/templates/views/show.erb +0 -18
  116. data/lib/generators/cm_admin/templates/views/sign_in.erb +0 -18
  117. data/lib/generators/cm_admin/view_generator.rb +0 -78
@@ -0,0 +1,47 @@
1
+ @import "../helpers/index.scss";
2
+
3
+ .main-nav {
4
+ position: fixed;
5
+ top: 0;
6
+ right: 0;
7
+ left: 225px;
8
+ display: flex;
9
+ justify-content: space-between;
10
+ width: calc(100% - 225px);
11
+ height: 140px;
12
+ padding: 24px 24px 16px;
13
+ background-color: $white;
14
+ z-index: 2;
15
+ &__lhs {
16
+ .bread-crumb-area {
17
+ .breadcrumb-text {
18
+ font-size: $t4-text;
19
+ line-height: 22px;
20
+ color: $ink-lighter-clr;
21
+ margin: 0 0 16px;
22
+ a {
23
+ color: inherit;
24
+ }
25
+ }
26
+ }
27
+ .nav-title-area {
28
+ .title-text {
29
+ font-size: 24px;
30
+ font-weight: 600;
31
+ line-height: 32px;
32
+ color: $primary-text-clr;
33
+ margin: 0 0 8px;
34
+ }
35
+ .title-sub-text {
36
+ font-size: $t4-text;
37
+ line-height: 22px;
38
+ color: $primary-text-clr;
39
+ margin: 0;
40
+ }
41
+ }
42
+ }
43
+
44
+ &__rhs {
45
+
46
+ }
47
+ }
@@ -0,0 +1,67 @@
1
+ @import "../helpers/index.scss";
2
+
3
+ .cm-navbar {
4
+ position: fixed;
5
+ top: 0;
6
+ right: 0;
7
+ left: 225px;
8
+ display: flex;
9
+ justify-content: space-between;
10
+ width: calc(100% - 225px);
11
+ height: 140px;
12
+ padding: 24px 24px 16px;
13
+ background-color: $white;
14
+ z-index: 2;
15
+ &__lhs {
16
+ .bread-crumb-area {
17
+ .breadcrumb-text {
18
+ @include font($size: $t4-text, $color: $ink-lighter-clr);
19
+ line-height: 22px;
20
+ margin: 0 0 16px;
21
+ a {
22
+ color: inherit;
23
+ }
24
+ }
25
+ }
26
+ .nav-title-area {
27
+ .title-text {
28
+ @include font($size: 24px, $color: $primary-text-clr, $weight: 600);
29
+ line-height: 32px;
30
+ margin: 0 0 8px;
31
+ }
32
+ .title-sub-text {
33
+ @include font($size: $t4-text, $color: $primary-text-clr);
34
+ line-height: 22px;
35
+ margin: 0;
36
+ }
37
+ }
38
+ }
39
+
40
+ &__rhs {
41
+ display: flex;
42
+ align-items: center;
43
+
44
+ .export-container {
45
+ position: relative;
46
+ .export-popup {
47
+ top: 45px;
48
+ width: 156px;
49
+ padding: 8px 0;
50
+ animation: fadeIn .2s ease-in-out;
51
+ .popup-option {
52
+ padding: 8px 16px;
53
+ @include font($size: $t4-text, $color: $primary-text-clr);
54
+ line-height: 22px;
55
+ transition: all .2s linear;
56
+ cursor: pointer;
57
+ &:hover {
58
+ background-color: $grey-lighter-clr;
59
+ }
60
+ span {
61
+ margin-right: 8px;
62
+ }
63
+ }
64
+ }
65
+ }
66
+ }
67
+ }
@@ -0,0 +1,69 @@
1
+ @import "../helpers/index.scss";
2
+
3
+ .quick-search-modal {
4
+ .modal-dialog {
5
+ max-width: 526px;
6
+ height: auto;
7
+ .modal-content {
8
+ .modal-body {
9
+ padding: 24px 24px 0;
10
+ }
11
+ }
12
+ }
13
+ .quick-search-field {
14
+ .clear-search {
15
+ position: absolute;
16
+ top: 8px;
17
+ right: 16px;
18
+ font-size: $t4-text;
19
+ line-height: 22px;
20
+ color: $ink-lighter-clr;
21
+ cursor: pointer;
22
+ }
23
+ }
24
+ .search-results-container {
25
+ margin: 16px 0;
26
+ .result-item {
27
+ padding: 8px 16px;
28
+ font-size: $t4-text;
29
+ line-height: 22px;
30
+ span:nth-child(1) {
31
+ color: #828282;
32
+ }
33
+ span:nth-child(2) {
34
+ margin-left: 8px;
35
+ color: $primary-text-clr;
36
+ }
37
+ }
38
+ }
39
+ .results-action {
40
+ display: flex;
41
+ align-items: center;
42
+ padding: 4px 16px;
43
+ box-shadow: inset 0px 1px 0px rgba(148, 151, 155, 0.15);
44
+ .select {
45
+ font-size: $t6-text;
46
+ line-height: 16px;
47
+ color: $ink-lightest-clr;
48
+ cursor: pointer;
49
+ .move-arrow {
50
+ font-size: 10px;
51
+ margin-right: 4px;
52
+ &:nth-child(2) {
53
+ margin-right: 8px;
54
+ }
55
+ }
56
+ }
57
+ .enter-btn {
58
+ @include font($size: $t6-text, $color: $ink-lightest-clr, $weight: 600);
59
+ line-height: 16px;
60
+ margin: 0 8px 0 24px;
61
+ padding: 0;
62
+ }
63
+ .open-btn {
64
+ @include font($size: $t6-text, $color: $ink-lightest-clr);
65
+ line-height: 16px;
66
+ padding: 0;
67
+ }
68
+ }
69
+ }
@@ -0,0 +1,61 @@
1
+ @import "../helpers/index.scss";
2
+
3
+ body {
4
+ box-sizing: border-box;
5
+ width: 100%;
6
+ margin: 0px;
7
+ padding: 0px;
8
+ font-family: 'Open Sans', sans-serif !important;
9
+ background-color: $grey-lightest-clr !important;
10
+ }
11
+
12
+ //main-layout-styles
13
+ .cm-admin {
14
+ display: flex;
15
+ width: 100%;
16
+ height: 100%;
17
+
18
+ .panel-area {
19
+ width: calc(100% - 225px);
20
+ margin-left: 225px;
21
+ overflow-y: auto;
22
+ overflow-x: hidden;
23
+ }
24
+
25
+ .components {
26
+ margin-top: 140px;
27
+ padding: 10px 30px;
28
+ .field-container {
29
+ max-width: 400px;
30
+ }
31
+ }
32
+ }
33
+
34
+
35
+ a:hover,
36
+ a {
37
+ text-decoration: none !important;
38
+ }
39
+
40
+ // daterangepicker theme styles
41
+ .daterangepicker {
42
+ .active {
43
+ background-color: $brand-color !important;
44
+ }
45
+ .drp-buttons {
46
+ .btn-primary {
47
+ background-color: $brand-color !important;
48
+ }
49
+ }
50
+ }
51
+
52
+ // datepicker theme styles
53
+ .datepicker {
54
+ .active {
55
+ background-color: $brand-color !important;
56
+ }
57
+ }
58
+
59
+ .opacity-1 {
60
+ opacity: 1 !important;
61
+ }
@@ -0,0 +1,54 @@
1
+ @import "../helpers/index.scss";
2
+
3
+ .show-page {
4
+ margin-top: 194px;
5
+
6
+ &__tabs {
7
+ .cm-tabs-bar {
8
+ // If you want to overwrite tabs styles ---> add styles here
9
+ }
10
+ }
11
+
12
+ &__inner {
13
+ padding: 24px;
14
+ .info-section {
15
+ margin-bottom: 32px;
16
+
17
+ .section-heading {
18
+ @include font($size: $t3-text, $color: $primary-text-clr, $weight: 600);
19
+ line-height: 24px;
20
+ margin: 0 0 16px;
21
+ }
22
+ .paper {
23
+ max-width: 752px;
24
+ padding: 24px;
25
+ background-color: $white;
26
+ border: 1px solid $grey-light-clr;
27
+ border-radius: $radius-4;
28
+ }
29
+ .info-split {
30
+ display: flex;
31
+ margin-bottom: 24px;
32
+ &:nth-last-child(1) {
33
+ margin-bottom: 0;
34
+ }
35
+ &__lhs {
36
+ width: 20%;
37
+ p {
38
+ @include font($size: $t4-text, $color: $ink-lighter-clr);
39
+ line-height: 22px;
40
+ margin: 0;
41
+ }
42
+ }
43
+ &__rhs {
44
+ width: 80%;
45
+ p {
46
+ @include font($size: $t4-text, $color: #172b4d);
47
+ line-height: 19px;
48
+ margin: 0;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,225 @@
1
+ @import "../helpers/index.scss";
2
+
3
+ .cm-sidebar {
4
+ position: fixed;
5
+ top: 0;
6
+ left: 0;
7
+ width: 225px;
8
+ height: 100%;
9
+ background-color: #252525;
10
+ // overflow: hidden;
11
+ z-index: 2;
12
+
13
+ &__logo-header {
14
+ display: flex;
15
+ align-items: center;
16
+ padding: 16px;
17
+ img {
18
+ width: 32px;
19
+ height: 32px;
20
+ object-fit: cover;
21
+ }
22
+ }
23
+
24
+ &__quick-search {
25
+ position: relative;
26
+ padding: 12px;
27
+ box-shadow: inset 0px -1px 0px rgba(255, 255, 255, 0.15);
28
+ input {
29
+ width: 100%;
30
+ position: relative;
31
+ @include font($size: $t4-text, $color: $ink-lightest-clr);
32
+ line-height: 22px;
33
+ padding-left: 34px;
34
+ background-color: transparent;
35
+ border: none;
36
+ &:focus {
37
+ outline: none;
38
+ }
39
+ }
40
+ span {
41
+ position: absolute;
42
+ top: 14px;
43
+ left: 24px;
44
+ font-size: $t4-text;
45
+ color: $ink-lightest-clr;
46
+ }
47
+ }
48
+
49
+ &__menu-wrapper {
50
+ height: calc(100vh - 180px);
51
+ padding: 16px 0;
52
+ overflow-y: auto;
53
+ .menu-item {
54
+ font-size: $t4-text;
55
+ color: $ink-lightest-clr;
56
+ padding: 8px 24px;
57
+ transition: all 0.2s linear;
58
+ cursor: pointer;
59
+ .menu-icon {
60
+ margin-right: 8px;
61
+ }
62
+ .list-arrow {
63
+ font-size: 10px;
64
+ margin-left: 8px;
65
+ vertical-align: text-bottom;
66
+ }
67
+ &:hover {
68
+ color: $white;
69
+ background: rgba(255, 255, 255, 0.1);
70
+ }
71
+ }
72
+
73
+ .menu-sub-list {
74
+ .menu-sub-item {
75
+ font-size: $t4-text;
76
+ color: $ink-lightest-clr;
77
+ padding: 8px 8px 8px 45px;
78
+ transition: all 0.2s linear;
79
+ &:hover {
80
+ color: $white;
81
+ background: rgba(255, 255, 255, 0.1);
82
+ }
83
+ }
84
+ }
85
+ .menu-link {
86
+ color: inherit;
87
+ text-decoration: none;
88
+ }
89
+ }
90
+
91
+ &__tabs-wrapper {
92
+ height: calc(100vh - 115px);
93
+ padding: 16px 0;
94
+ overflow-y: auto;
95
+
96
+ .tab-link {
97
+ padding: 0;
98
+ text-decoration: none;
99
+ color: $white;
100
+ cursor: pointer;
101
+ .tab-item {
102
+ position: relative;
103
+ padding: 10px 0;
104
+ transition: all 0.2s linear;
105
+ cursor: pointer;
106
+ &:hover {
107
+ background-color: #4b4b4b;
108
+ }
109
+ &.active {
110
+ background-color: $black;
111
+ border-left: 4px solid $brand-color;
112
+ }
113
+ .tab-name {
114
+ color: $white;
115
+ }
116
+ }
117
+ }
118
+ }
119
+
120
+ &__footer {
121
+ position: absolute;
122
+ bottom: 0;
123
+ width: 100%;
124
+ padding: 20px 24px;
125
+ box-shadow: inset 0px 1px 0px rgba(255, 255, 255, 0.15);
126
+ .profile-name {
127
+ display: inline-flex;
128
+ align-items: center;
129
+ position: relative;
130
+ font-size: $t4-text;
131
+ line-height: 22px;
132
+ color: $ink-lightest-clr;
133
+ cursor: pointer;
134
+ .profile-avatar {
135
+ display: inline-flex;
136
+ align-items: center;
137
+ justify-content: center;
138
+ width: 22px;
139
+ height: 22px;
140
+ margin-right: 8px;
141
+ color: $white;
142
+ font-size: 10px;
143
+ font-weight: 900;
144
+ background-color: $brand-color;
145
+ border-radius: $circle;
146
+ vertical-align: middle;
147
+ }
148
+ }
149
+ .profile-popup {
150
+ position: absolute;
151
+ left: 228px;
152
+ bottom: 10px;
153
+ width: 268px;
154
+ height: 186px;
155
+ background-color: $white;
156
+ box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.16);
157
+ border-radius: $radius-4;
158
+ animation: fadeIn 0.2s linear;
159
+ .profile-info {
160
+ display: grid;
161
+ grid-template-columns: 1fr 32px;
162
+ grid-gap: 9px;
163
+ padding: 8px 16px;
164
+ box-shadow: inset 0px -1px 0px rgba(148, 151, 155, 0.15);
165
+ &__left {
166
+ .name-text {
167
+ font-size: $t4-text;
168
+ line-height: 22px;
169
+ color: $primary-text-clr;
170
+ margin: 0;
171
+ }
172
+ .email-text {
173
+ font-size: $t4-text;
174
+ line-height: 22px;
175
+ color: $ink-lightest-clr;
176
+ margin: 0;
177
+ }
178
+ }
179
+ &__right {
180
+ display: inline-flex;
181
+ align-items: center;
182
+ justify-content: center;
183
+ width: 32px;
184
+ height: 32px;
185
+ @include font($size: $t3-text, $color: $white, $weight: 600);
186
+ background-color: $brand-color;
187
+ border-radius: $circle;
188
+ vertical-align: middle;
189
+ }
190
+ }
191
+ .page-options {
192
+ padding: 8px 0;
193
+ box-shadow: inset 0px -1px 0px rgba(148, 151, 155, 0.15);
194
+ .page-link {
195
+ display: block;
196
+ font-size: $t4-text;
197
+ line-height: 22px;
198
+ color: $primary-text-clr;
199
+ padding: 4px 16px;
200
+ border: none;
201
+ transition: all 0.2s linear;
202
+ &:hover {
203
+ background-color: $grey-lighter-clr;
204
+ }
205
+ }
206
+ }
207
+ .auth-option {
208
+ padding: 8px 0;
209
+ .auth-link {
210
+ display: block;
211
+ font-size: $t4-text;
212
+ line-height: 22px;
213
+ color: $primary-text-clr;
214
+ padding: 4px 16px;
215
+ transition: all 0.2s linear;
216
+ &:hover {
217
+ background-color: $grey-lighter-clr;
218
+ }
219
+ }
220
+ }
221
+ }
222
+ }
223
+ }
224
+
225
+