cm-admin 1.1.7 → 1.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.vscode/settings.json +3 -0
  4. data/Gemfile.lock +1 -1
  5. data/app/assets/javascripts/cm_admin/scaffolds.js +1 -1
  6. data/app/assets/stylesheets/cm_admin/base/navbar.scss +13 -39
  7. data/app/assets/stylesheets/cm_admin/base/quicksearch.scss +3 -4
  8. data/app/assets/stylesheets/cm_admin/base/show.scss +4 -15
  9. data/app/assets/stylesheets/cm_admin/base/table.scss +2 -14
  10. data/app/assets/stylesheets/cm_admin/cm_admin.css.scss +1 -0
  11. data/app/assets/stylesheets/cm_admin/components/_buttons.scss +29 -135
  12. data/app/assets/stylesheets/cm_admin/dependency/bootstrap.min.css +4 -5
  13. data/app/assets/stylesheets/cm_admin/dependency/jquery-jgrowl.min.css +1 -0
  14. data/app/assets/stylesheets/cm_admin/helpers/_variable.scss +31 -30
  15. data/app/assets/stylesheets/cm_admin/pages/import_page.scss +3 -10
  16. data/app/controllers/cm_admin/resource_controller.rb +13 -9
  17. data/app/views/cm_admin/main/_actions_dropdown.html.slim +1 -3
  18. data/app/views/cm_admin/main/_associated_table.html.slim +1 -1
  19. data/app/views/cm_admin/main/_nested_fields.html.slim +2 -1
  20. data/app/views/cm_admin/main/_nested_table_form.html.slim +1 -1
  21. data/app/views/cm_admin/main/_tabs.html.slim +1 -1
  22. data/app/views/cm_admin/main/_top_navbar.html.slim +11 -17
  23. data/app/views/cm_admin/main/history.html.slim +3 -4
  24. data/app/views/cm_admin/main/import_form.html.slim +2 -2
  25. data/app/views/cm_admin/main/new.html.slim +1 -1
  26. data/app/views/cm_admin/main/show.html.slim +3 -4
  27. data/app/views/layouts/_cm_flash_message.html.slim +3 -3
  28. data/app/views/layouts/_quick_links.html.slim +2 -2
  29. data/app/views/layouts/cm_admin.html.slim +10 -12
  30. data/lib/cm_admin/models/filter.rb +55 -29
  31. data/lib/cm_admin/models/form_field.rb +18 -3
  32. data/lib/cm_admin/models/utils/helpers.rb +14 -0
  33. data/lib/cm_admin/version.rb +1 -1
  34. data/lib/cm_admin/view_helpers/filter_helper.rb +1 -1
  35. data/lib/cm_admin/view_helpers/form_field_helper.rb +16 -17
  36. data/lib/cm_admin/view_helpers/form_helper.rb +2 -1
  37. data/lib/cm_admin/view_helpers/manage_column_popup_helper.rb +2 -2
  38. data/lib/cm_admin/view_helpers/page_info_helper.rb +4 -4
  39. data/lib/cm_admin/view_helpers.rb +2 -1
  40. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5aba23127b4e8223782b919d0c5c767b156262e55198835fb738c72fd9c5fa68
4
- data.tar.gz: 89a3df2239cc6a56eb3360afe1502654c2ad83b1921c5f8f7dedcc1d8eaf3407
3
+ metadata.gz: e07101649ddc2392e7d61139cbbd68d863b22703ec2537cd9e6d3195cc53f5c9
4
+ data.tar.gz: a11705aaa45d84749296de25055339207b33f202a467eac3b38d2c60aa667f59
5
5
  SHA512:
6
- metadata.gz: 66c416a85d9e84c5d9122adc0a14d8728ce51934711839db9a261ddba9aeae8d13d3033f3e06f3c359b5a3c7a62ed74c2d253aa1c038865ba77486f7ddc6fbf7
7
- data.tar.gz: 5d91df86bb2cb64be4158688473c316c8e3c16b77bb11ed7a0a1e683f7e2af67e84b7240a45262ab79384cf1fdc238880f2da02525686ba73d43f9c5c98253c2
6
+ metadata.gz: da131f09f37cabf79ef6ce2c23604cb412053be927ea9c79666f3f356d7618ddfdc6faed36c657821e2c60757c67aa5fc1bfddf838705d861f76898ae0c235f8
7
+ data.tar.gz: 6f0354f7eac71e8f691152e23f0653a228fff5e9b2407d51cff6320cf07cf8de01a46a08835717c6e7d7ececf5655f2942a870b73ea48321f3797b4bc82dbced
data/.gitignore CHANGED
@@ -11,3 +11,4 @@ public/cm-admin-packs/
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
13
  .rubocop-*
14
+ .DS_Store
@@ -0,0 +1,3 @@
1
+ {
2
+ "cSpell.words": ["cmad"]
3
+ }
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (1.1.7)
4
+ cm-admin (1.1.9)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -16,7 +16,6 @@ import 'bootstrap'
16
16
  import '@popperjs/core'
17
17
  import 'flatpickr'
18
18
  import 'jgrowl'
19
- jqueryJgrowl()
20
19
  import Select2 from "select2"
21
20
  Select2()
22
21
 
@@ -37,6 +36,7 @@ document.addEventListener("turbo:load", function () {
37
36
  mode: 'range'
38
37
  })
39
38
  $('.select-2').select2();
39
+ jqueryJgrowl()
40
40
  });
41
41
 
42
42
  $(document).on('click', '.menu-item', function(e) {
@@ -1,57 +1,31 @@
1
1
  @import "../helpers/index.scss";
2
+ @import "bootstrap/scss/bootstrap";
2
3
 
3
- .cm-navbar {
4
- top: 0;
5
- right: 0;
6
- left: 225px;
7
- display: flex;
8
- justify-content: space-between;
9
- align-items: flex-start;
10
- min-height: 102px;
11
- padding: 24px;
12
- background-color: $white;
13
- z-index: 2;
14
- &__lhs {
15
- .bread-crumb-area {
16
- .breadcrumb-text {
17
- @include font($size: $t4-text, $color: $ink-lighter-clr);
18
- line-height: 22px;
19
- margin: 0 0 16px;
20
- a {
21
- color: inherit;
22
- }
23
- }
24
- }
25
- .nav-title-area {
26
- .title-text {
27
- @include font($size: 24px, $color: $primary-text-clr, $weight: 600);
28
- line-height: 32px;
29
- margin: 0 0 8px;
30
- }
31
- .title-sub-text {
32
- @include font($size: $t4-text, $color: $primary-text-clr);
33
- line-height: 22px;
34
- margin: 0;
35
- }
4
+ .entity-header {
5
+ @extend .d-flex.justify-content-between.align-items-start.p-4;
6
+ min-height: 109px; // Height needs to be removed once all the layouts are revamped
7
+ background-color: var(--bs-white);
8
+ &__info {
9
+ .breadcrumb {
10
+ @include font($size: $t4-text, $color: var(--bs-tertiary-color));
11
+ line-height: 22px;
36
12
  }
37
13
  }
38
14
 
39
- &__rhs {
40
- display: flex;
41
- align-items: center;
42
-
15
+ &__actions {
16
+ @extend .d-flex.align-items-start;
43
17
  .export-container {
44
18
  position: relative;
45
19
  .export-popup {
46
20
  top: 45px;
47
21
  width: 156px;
48
22
  padding: 8px 0;
49
- animation: fadeIn .2s ease-in-out;
23
+ animation: fadeIn 0.2s ease-in-out;
50
24
  .popup-option {
51
25
  padding: 8px 16px;
52
26
  @include font($size: $t4-text, $color: $primary-text-clr);
53
27
  line-height: 22px;
54
- transition: all .2s linear;
28
+ transition: all 0.2s linear;
55
29
  cursor: pointer;
56
30
  &:hover {
57
31
  background-color: $grey-lighter-clr;
@@ -52,16 +52,15 @@
52
52
  }
53
53
  }
54
54
  }
55
- .enter-btn {
55
+ .enter-text {
56
56
  @include font($size: $t6-text, $color: $ink-lightest-clr, $weight: 600);
57
57
  line-height: 16px;
58
58
  margin: 0 8px 0 24px;
59
- padding: 0;
60
59
  }
61
- .open-btn {
60
+ .open-text {
62
61
  @include font($size: $t6-text, $color: $ink-lightest-clr);
63
62
  line-height: 16px;
64
- padding: 0;
63
+ margin: 0;
65
64
  }
66
65
  }
67
66
  .active-item {
@@ -1,25 +1,14 @@
1
1
  @import "../helpers/index.scss";
2
+ @import "bootstrap/scss/bootstrap";
2
3
 
3
4
  .show-page {
4
5
  overflow: auto;
5
6
 
6
- &__tabs {
7
- .cm-tabs-bar {
8
- background-color: $white;
9
- width: 100%;
10
- .nav-pills {
11
- margin-left: 10px;
12
- }
7
+ &__header {
8
+ .tabs {
9
+ @extend .nav.nav-pills.ml-2;
13
10
  .nav-link {
14
- position: static;
15
- left: 0%;
16
- right: 0%;
17
11
  @include font($size: $t4-text, $color: $ink-lighter-clr);
18
- line-height: 22px;
19
- flex: none;
20
- order: 0;
21
- flex-grow: 0;
22
- background-color: $white;
23
12
  border-radius: 0px;
24
13
  }
25
14
  .nav-link.active {
@@ -34,21 +34,13 @@
34
34
  line-height: 22px;
35
35
  margin: 0;
36
36
  }
37
- &__column-action {
38
- .column-btn {
39
- padding: 4px 8px;
40
- span:nth-child(2) {
41
- margin: 0 0 0 4px;
42
- }
43
- }
44
- }
45
37
  }
46
38
 
47
39
  //Table UI styles
48
40
  .new-admin-table {
49
41
  min-width: 720px;
50
42
  max-width: fit-content;
51
- // max-height: calc(100vh - 240px); Height is dynamic
43
+ // max-height: calc(100vh - 240px); Height is dynamic
52
44
  overflow: auto;
53
45
  .cm-table {
54
46
  table-layout: fixed;
@@ -170,10 +162,6 @@
170
162
  padding: 0px;
171
163
  }
172
164
  }
173
- .tool-btn {
174
- background-color: transparent;
175
- border: none;
176
- }
177
165
  }
178
166
  }
179
167
  }
@@ -236,7 +224,7 @@
236
224
  &__name {
237
225
  @include font($size: $t4-text, $color: $primary-text-clr);
238
226
  line-height: 22px;
239
- margin-left: 4px;
227
+ margin-left: 4px;
240
228
  p {
241
229
  margin: 0;
242
230
  }
@@ -26,6 +26,7 @@
26
26
  *= require 'cm_admin/dependency/bootstrap.min'
27
27
  *= require 'cm_admin/dependency/flatpickr.min'
28
28
  *= require 'cm_admin/dependency/fontawesome.all'
29
+ *= require 'cm_admin/dependency/jquery-jgrowl.min'
29
30
  *= require 'cm_admin/scaffold'
30
31
  *= require_self
31
32
  */
@@ -1,148 +1,42 @@
1
- @import '../helpers/index.scss';
1
+ @import "../helpers/index.scss";
2
+ @import "bootstrap/scss/bootstrap";
2
3
 
3
- .cta-btn {
4
- padding: 5px 10px;
5
- @include font($size: $t4-text, $color: $white, $weight: bold);
6
- background-color: $brand-color;
7
- border: none;
8
- border-radius: $radius-4;
9
- transition: all .2s linear;
10
- &:hover {
11
- color: $white;
12
- background: $cta-hover-gradient;
13
- transform: scale(1.05);
14
- }
15
- &:focus {
16
- outline: 3px auto rgba(47, 128, 237, 0.3);
17
- outline-offset: 1px;
18
- }
19
- &.disabled {
20
- color: $disabled-clr;
21
- background: $grey-lighter-clr;
22
- cursor: not-allowed !important;
23
- &:hover {
24
- background-color: $grey-lighter-clr;
25
- }
4
+ // Custom style for icon btn
5
+ .btn-icon {
6
+ i {
7
+ margin-right: 4px;
26
8
  }
27
9
  }
28
10
 
29
- .primary-btn {
30
- padding: 5px 10px;
31
- @include font($size: $t4-text, $color: $brand-color, $weight: bold);
32
- background-color: $white;
33
- border: 1px solid $brand-color;
34
- border-radius: $radius-4;
35
- transition: all .2s linear;
36
- &:hover {
37
- color: $brand-color;
38
- background-color: #E6E4FA;
39
- transform: scale(1.05);
40
- }
41
- &:focus {
42
- outline: 3px auto rgba(47, 128, 237, 0.3);
43
- outline-offset: 2px;
44
- }
45
- &.disabled {
46
- color: $disabled-clr;
47
- background: $white;
48
- border: 1px solid $grey-regular-clr;
49
- cursor: not-allowed !important;
50
- &:hover {
51
- background-color: $white;
52
- }
53
- }
11
+ // New buttons with bootstrap button styles
12
+ .cm-admin .btn-cta {
13
+ @include button-variant($primary, $primary);
14
+ @extend .btn.btn-sm.btn-icon;
54
15
  }
55
16
 
56
- .secondary-btn {
57
- padding: 5px 10px;
58
- @include font($size: $t4-text, $color: $primary-text-clr, $weight: bold);
59
- background-color: $white;
60
- border: 1px solid $ink-regular-clr;
61
- border-radius: $radius-4;
62
- transition: all .2s linear;
63
- &:hover {
64
- color: $primary-text-clr;
65
- background-color: $grey-light-clr;
66
- transform: scale(1.05);
67
- }
68
- &:focus {
69
- outline: 3px auto rgba(47, 128, 237, 0.3);
70
- outline-offset: 2px;
71
- }
72
- &.disabled {
73
- color: $disabled-clr;
74
- background: $white;
75
- border: 1px solid $grey-regular-clr;
76
- cursor: not-allowed !important;
77
- &:hover {
78
- background-color: $white;
79
- }
80
- }
81
- span:nth-child(2) {
82
- margin: 0 4px 0 8px;
83
- }
84
- span:nth-child(3) {
85
- @include font($size: 10px, $color: $ink-lighter-clr, $weight: bold);
86
- }
17
+ .cm-admin .btn-primary {
18
+ @extend .btn.btn-outline-primary.btn-sm.btn-icon;
87
19
  }
88
20
 
89
- .gray-border-btn {
90
- padding: 5px 10px;
91
- @include font($size: $t4-text, $color: $primary-text-clr, $weight: bold);
92
- background-color: $white;
93
- border: 1px solid $ink-regular-clr;
94
- border-radius: $radius-4;
95
- transition: all .2s linear;
96
- &:hover {
97
- color: $primary-text-clr;
98
- background-color: $grey-light-clr;
99
- transform: scale(1.05);
100
- }
101
- &:focus {
102
- outline: 3px auto rgba(47, 128, 237, 0.3);
103
- outline-offset: 2px;
104
- }
105
- &.disabled {
106
- color: $disabled-clr;
107
- background: $white;
108
- border: 1px solid $grey-regular-clr;
109
- cursor: not-allowed !important;
110
- &:hover {
111
- background-color: $white;
112
- }
113
- }
21
+ .cm-admin .btn-secondary {
22
+ @extend .btn.btn-outline-secondary.btn-sm.btn-icon;
114
23
  }
115
24
 
116
- .ghost-btn {
117
- padding: 5px 10px;
118
- @include font($size: $t4-text, $color: $primary-text-clr, $weight: bold);
119
- background-color: transparent;
120
- border: none;
121
- border-radius: $radius-4;
122
- transition: all .2s linear;
123
- &:hover {
124
- color: $primary-text-clr;
125
- background: $grey-light-clr;
126
- transform: scale(1.05);
127
- }
128
- &:focus {
129
- outline: 3px auto rgba(47, 128, 237, 0.3);
130
- }
131
- &.disabled {
132
- color: $disabled-clr;
133
- background: $grey-light-clr;
134
- border: none;
135
- cursor: not-allowed !important;
136
- &:hover {
137
- background-color: $grey-light-clr;
138
- }
139
- }
25
+ .cm-admin .btn-ghost {
26
+ @extend .btn.btn-light.btn-sm.btn-icon;
140
27
  }
141
28
 
142
- .text-btn {
143
- border: none;
144
- background-color: transparent;
145
- &:focus {
146
- outline: none;
147
- }
29
+ .cm-admin .btn-danger {
30
+ @extend .btn.btn-outline-danger.btn-sm.btn-icon;
31
+ }
32
+
33
+ .cm-admin .btn-link {
34
+ @extend .btn.btn-link.btn-sm.btn-icon;
35
+ text-decoration: underline;
148
36
  }
37
+
38
+ // button mixin - We can use if needed
39
+ // @include button-variant($background: #6554e0, $border: #6554e0);
40
+
41
+ //Outline button mixin - We can use if needed
42
+ // @include button-outline-variant($color: #6554e0);