cm-admin 1.2.3 → 1.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2a5441ee465f81a38a87aca50f03be7b93364612a1c009c0459da7aa229f90d2
4
- data.tar.gz: 40b464190eb0c6f99fea77b435f32f8d7ea76eec1aa21484d52bf1a691bad10a
3
+ metadata.gz: 56179a4d588a2f01a6b817c6c2ad4adb47d3be819aa9ed2680fe1944d21fb807
4
+ data.tar.gz: 624bc396f461879c5ff551e2a1105808a90fed770391805d8c197a3d6cc0d650
5
5
  SHA512:
6
- metadata.gz: af42d7bf84785cb9d485a9f5d6c648ae2745d6fc684684c040fd9c2b65c280d253af6d29a6b0cf1972ba720975047aa94eb9133a430918ece96dd162be9389f0
7
- data.tar.gz: 8de410310ee77d14f76765d282e69bd0f9d5540e54142bcf1c4df7473b3734f837fe44dd2cd079ddbbea22080c642328b9541797d380ccdc7fd8dafb60fbd07d
6
+ metadata.gz: 04ae93d9491118e0cfe36d71035883af6b41ed04491fb654d4b0a422f0ea47c41f536778be308c9a9c01aeb891c91f2a075f294f671398135ebf6e8eaf9ba6c3
7
+ data.tar.gz: 62d3ac65b2049a1361822b02a533eb18d7aa3e3ef836f1dee981642f639c8a678a95b8a5fcffcb089f1b7b47534e96fe5f85f2396ac0eff3915091d4f8459174
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (1.2.3)
4
+ cm-admin (1.2.5)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -0,0 +1,8 @@
1
+ @import "../helpers/index";
2
+ @import "../dependency/bootstrap/scss/bootstrap";
3
+
4
+ .cm-admin .accordion {
5
+ @extend .accordion;
6
+ --bs-accordion-active-bg: var(--bs-gray-100);
7
+ --bs-accordion-btn-bg: var(--bs-gray-100);
8
+ }
@@ -1,5 +1,12 @@
1
- @import "../helpers/index.scss";
1
+ @import "../helpers/index";
2
+ @import "../dependency/bootstrap/scss/bootstrap";
2
3
 
4
+ // New alert styles
5
+ .cm-admin .alert {
6
+ @extend .alert-dismissible, .d-flex, .align-items-center;
7
+ }
8
+
9
+ //Old alert styles
3
10
  .flag-alert {
4
11
  max-width: 752px;
5
12
  padding: 24px;
@@ -40,62 +47,3 @@
40
47
  }
41
48
  }
42
49
  }
43
-
44
- .toast-alert {
45
- display: flex;
46
- align-items: center;
47
- max-width: 225px;
48
- padding: 8px 16px;
49
- border-radius: $radius-4;
50
- &.informative {
51
- background: $blue-light-clr;
52
- }
53
- &.successful {
54
- background: $green-light-clr;
55
- }
56
- &.warning {
57
- background: $yellow-light-clr;
58
- }
59
- &.error {
60
- background: $red-light-clr;
61
- }
62
- .toast-info {
63
- @include font($size: $t4-text, $color: $primary-text-clr);
64
- line-height: 22px;
65
- margin: 0;
66
- }
67
- .toast-close {
68
- @include font($size: $t4-text, $color: $ink-lighter-clr);
69
- margin-left: 24px;
70
- cursor: pointer;
71
- }
72
- }
73
-
74
- .inline-alert {
75
- @include font($size: $t4-text, $color: $primary-text-clr);
76
- line-height: 22px;
77
- span {
78
- margin-right: 4px;
79
- }
80
- &.informative {
81
- span {
82
- color: $blue-regular-clr;
83
- }
84
- }
85
- &.successful {
86
- span {
87
- color: $green-regular-clr;
88
- }
89
- }
90
- &.warning {
91
- span {
92
- color: $yellow-regular-clr;
93
- }
94
- }
95
- &.error {
96
- color: $red-regular-clr;
97
- span {
98
- color: $red-regular-clr;
99
- }
100
- }
101
- }
@@ -1,8 +1,9 @@
1
- @import './alerts';
2
- @import './buttons';
3
- @import './input';
4
- @import './status-tag';
5
- @import './dropdown-popup';
6
- @import './range';
7
- @import './modal';
8
- @import './drawer';
1
+ @import "./alerts";
2
+ @import "./buttons";
3
+ @import "./input";
4
+ @import "./status-tag";
5
+ @import "./dropdown-popup";
6
+ @import "./range";
7
+ @import "./modal";
8
+ @import "./drawer";
9
+ @import "./accordion";
@@ -1,4 +1,4 @@
1
- .modal.fade id="#{custom_action.name.classify}Modal-#{ar_object.id}" aria-hidden="true" aria-labelledby="#{custom_action.name.classify}ModalLabel" tabindex="1"
1
+ .modal.fade id="#{custom_action.name.classify}Modal-#{ar_object&.id}" aria-hidden="true" aria-labelledby="#{custom_action.name.classify}ModalLabel" tabindex="1"
2
2
  .modal-dialog
3
3
  .modal-content
4
4
  .modal-header
@@ -1,9 +1,11 @@
1
- - custom_action_with_modals = @model.available_actions.select{ |act| act if act.display_type == :modal }
1
+ - custom_action_with_modals = @model.available_actions.select{ |act| act if act.display_type == :modal && act.action_type == :custom }
2
+ - bulk_action_with_modals = @model.available_actions.select{ |act| act if act.display_type == :modal && act.action_type == :bulk_action }
2
3
  - destroy_action = available_actions(@model, 'destroy')
3
4
  - if @associated_model
4
5
  - custom_action_with_modals += @associated_model.available_actions.select{ |act| act if act.display_type == :modal }
5
-
6
6
  - if @current_action&.name == 'index'
7
+ - bulk_action_with_modals.each do |bulk_action|
8
+ = render partial: '/layouts/custom_action_modal', locals: { custom_action: bulk_action, ar_object: nil }
7
9
  - @ar_object.data.each do |ar_object|
8
10
  - custom_action_with_modals.each do |custom_action|
9
11
  = render partial: '/layouts/custom_action_modal', locals: { custom_action: custom_action, ar_object: ar_object }
@@ -3,6 +3,7 @@ require_relative 'actions/blocks'
3
3
  module CmAdmin
4
4
  module Models
5
5
  class BulkAction < Action
6
+ attr_accessor :modal_configuration
6
7
 
7
8
  def initialize(attributes = {}, &block)
8
9
  super
@@ -132,9 +132,9 @@ module CmAdmin
132
132
  # self.class.class_eval(&block)
133
133
  end
134
134
 
135
- def bulk_action(name: nil, display_name: nil, display_if: lambda { |arg| return true }, redirection_url: nil, icon_name: nil, verb: nil, display_type: nil, route_type: nil, partial: nil, &block)
135
+ def bulk_action(name: nil, display_name: nil, display_if: lambda { |arg| return true }, redirection_url: nil, icon_name: nil, verb: nil, display_type: nil, modal_configuration: {}, route_type: nil, partial: nil, &block)
136
136
  bulk_action = CmAdmin::Models::BulkAction.new(
137
- name: name, display_name: display_name, display_if: display_if,
137
+ name: name, display_name: display_name, display_if: display_if, modal_configuration: modal_configuration,
138
138
  redirection_url: redirection_url, icon_name: icon_name, action_type: :bulk_action,
139
139
  verb: verb, display_type: display_type, route_type: route_type, partial: partial, &block
140
140
  )
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '1.2.3'
2
+ VERSION = '1.2.5'
3
3
  end
@@ -111,8 +111,10 @@ module CmAdmin
111
111
  end
112
112
  elsif has_many_image_attached?(ar_object, field)
113
113
  ar_object.send(field.field_name).map do |asset|
114
- content_tag :a, href: rails_blob_path(asset, disposition: "attachment") do
115
- asset.filename.to_s
114
+ content_tag(:div) do
115
+ content_tag :a, href: rails_blob_path(asset, disposition: "attachment") do
116
+ asset.filename.to_s
117
+ end
116
118
  end
117
119
  end.join("\n").html_safe
118
120
  end
@@ -90,14 +90,14 @@ module CmAdmin
90
90
 
91
91
  def cm_single_file_upload_field(form_obj, cm_field, _value, required_class, _target_action)
92
92
  content_tag(:div) do
93
- concat form_obj.file_field cm_field.field_name, class: "form-control #{required_class}"
93
+ concat form_obj.file_field cm_field.field_name, class: "form-control #{required_class}", disabled: cm_field.disabled
94
94
  concat attachment_list(form_obj, cm_field, _value, required_class, _target_action)
95
95
  end
96
96
  end
97
97
 
98
98
  def cm_multi_file_upload_field(form_obj, cm_field, _value, required_class, _target_action)
99
99
  content_tag(:div) do
100
- concat form_obj.file_field cm_field.field_name, multiple: true, class: "form-control #{required_class}"
100
+ concat form_obj.file_field cm_field.field_name, multiple: true, class: "form-control #{required_class}", disabled: cm_field.disabled
101
101
  concat attachment_list(form_obj, cm_field, _value, required_class, _target_action)
102
102
  end
103
103
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cm-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - sajinmp
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-10-11 00:00:00.000000000 Z
13
+ date: 2023-10-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -213,6 +213,7 @@ files:
213
213
  - app/assets/stylesheets/cm_admin/base/table.scss
214
214
  - app/assets/stylesheets/cm_admin/base/tabs.scss
215
215
  - app/assets/stylesheets/cm_admin/cm_admin.css.scss
216
+ - app/assets/stylesheets/cm_admin/components/_accordion.scss
216
217
  - app/assets/stylesheets/cm_admin/components/_alerts.scss
217
218
  - app/assets/stylesheets/cm_admin/components/_buttons.scss
218
219
  - app/assets/stylesheets/cm_admin/components/_drawer.scss