cm-admin 3.0.4 → 3.0.6

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: 5a4959d23e72acb3973b23cd3c275cc64545fa0d99a899d6315df73026fd889d
4
- data.tar.gz: dd2daf0d768d1dc01409383c1966905975bfdead82aa126909228ec9b88e90dc
3
+ metadata.gz: edc4e96d677eaa2324f074cf028cf3defc717a49a64a64331e65d18c2b55ecce
4
+ data.tar.gz: d3cb35655e16e1c36ebb221be9782d6720f556ed0dba3acff74afdf45981f61d
5
5
  SHA512:
6
- metadata.gz: b323940b77edf010dd5079c53f2a17b5334c8e005f430a27097f9597e827343f5ab9342452a74060f9703d9c3ac7010454bdb99ace1353cf5679749a98f82cb3
7
- data.tar.gz: 412ff6701ea7ec48b982c8ee011fed1728ae9ac48334b80e7ca5b6f20f5a8d48d95d3f4f3c2ddbd3a945578b1baa84df4ecf026586ede4fb46783338abb20b2d
6
+ metadata.gz: '0686244e80d49a67a4caaa628c1dd05b6f09917fe6a74edd7707607f86d6e41325d7ba0da9d637080a8e0a616856f90d2f4d191a436a6a0fe724b1e94eeae674'
7
+ data.tar.gz: 0fd14c5144600550b7cde3644c1f44e30f3aaa3c3099feb849784d8673cb1eac9dfa88a7257a42bad27b1f943bee1fc27ce44ba6c7ec488c50bdf0d914d2a3d1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (3.0.4)
4
+ cm-admin (3.0.6)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -9,14 +9,10 @@
9
9
  .form-page {
10
10
  background-color: $white;
11
11
  &__header {
12
- @extend .position-sticky, .top-0, .bg-white;
12
+ @extend .top-0, .bg-white;
13
13
  z-index: 5;
14
14
  }
15
- &__body {
16
- padding: 24px;
17
- }
18
15
  .form-container {
19
- margin-bottom: 24px;
20
16
  .form-title {
21
17
  @extend .h6, .fw-semibold;
22
18
  color: $primary-text-clr;
@@ -33,6 +29,17 @@
33
29
  }
34
30
  }
35
31
  }
32
+
33
+ .form-section-container {
34
+ @extend .p-4;
35
+ margin-bottom: 64px;
36
+ }
37
+
38
+ .form-submit-button-container {
39
+ @extend .position-absolute, .bottom-0, .bg-white, .py-3, .px-4, .w-100;
40
+ border-top: 1px solid $gray-300;
41
+ z-index: 5;
42
+ }
36
43
  }
37
44
 
38
45
  //form field styles
@@ -151,4 +158,3 @@
151
158
  gap: 8px;
152
159
  }
153
160
  }
154
-
@@ -4,16 +4,14 @@
4
4
  .breadcrumb
5
5
  = link_to "#{@model.model_name.titleize.pluralize} /", cm_admin.send(:"cm_index_#{@model.name.underscore}_path"), class: 'text-reset'
6
6
  h4 = action_title
7
- / - if @model.current_action.page_description
8
- / p.mb-0.text-body-secondary = @model.current_action.page_description
9
7
  .entity-header__actions
10
8
  - if @model.current_action.name == 'index'
11
9
  - if has_valid_policy(@ar_object, :exportable)
12
10
  .export-container
13
11
  .dropdown
14
12
  button.btn-secondary.dropdown-toggle data-bs-toggle='dropdown'
15
- i.fa.fa-arrow-down
16
- | Export
13
+ i.fa.fa-arrow-down
14
+ | Export
17
15
  ul.dropdown-menu.export-popup
18
16
  li
19
17
  .popup-option.pointer data-bs-toggle='modal' data-bs-target='#exportmodal'
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '3.0.4'
2
+ VERSION = '3.0.6'
3
3
  end
@@ -40,7 +40,7 @@ module CmAdmin
40
40
  end
41
41
 
42
42
  def split_form_into_section(resource, form_obj, entities)
43
- content_tag :div do
43
+ content_tag :div, class: 'form-section-container' do
44
44
  entities.each do |entity|
45
45
  if entity.class == CmAdmin::Models::Row
46
46
  concat create_rows(resource, form_obj, entity)
@@ -187,13 +187,14 @@ module CmAdmin
187
187
  end
188
188
 
189
189
  concat split_form_into_section(resource, form_obj, entities)
190
- concat tag.br
191
- concat form_obj.submit 'Save', class: 'btn-cta', data: { behaviour: 'form_submit', form_class: "cm_#{form_obj.object.class.name.downcase}_form", turbo_submits_with: 'Submitting...' }
192
- concat (button_tag(type: 'button', class: 'btn-loading visually-hidden', data: { behaviour: 'form_submit_spinner' }) do
193
- concat content_tag(:span, '', class: 'spinner-border spinner-border-sm', role: 'status')
194
- concat ' Submitting...'
190
+ concat(content_tag(:div, class: 'form-submit-button-container') do
191
+ concat form_obj.submit 'Save', class: 'btn-cta', data: { behaviour: 'form_submit', form_class: "cm_#{form_obj.object.class.name.downcase}_form", turbo_submits_with: 'Submitting...' }
192
+ concat(button_tag(type: 'button', class: 'btn-loading visually-hidden', data: { behaviour: 'form_submit_spinner' }) do
193
+ concat content_tag(:span, '', class: 'spinner-border spinner-border-sm', role: 'status')
194
+ concat ' Submitting...'
195
+ end)
196
+ concat button_tag 'Discard', class: 'btn-secondary discard-form', data: { behaviour: 'discard_form' } unless @is_drawer_form
195
197
  end)
196
- concat button_tag 'Discard', class: 'btn-secondary discard-form', data: { behaviour: 'discard_form' } unless @is_drawer_form
197
198
  end
198
199
  end
199
200
 
@@ -38,7 +38,8 @@ module CmAdmin
38
38
  end
39
39
 
40
40
  def custom_action_items(custom_action, current_action_name)
41
- return unless custom_action.name.present? && policy([:cm_admin, @model.name.classify.constantize]).send(:"#{custom_action.name}?")
41
+ action_name = "#{custom_action.name}?".to_sym
42
+ return unless custom_action.name.present? && policy([:cm_admin, @model.name.classify.constantize]).respond_to?(action_name) && policy([:cm_admin, @model.name.classify.constantize]).send(action_name)
42
43
 
43
44
  scoped_model = "CmAdmin::#{@model.name}Policy::#{custom_action.name.classify}Scope".constantize.new(Current.user, @model.name.constantize).resolve
44
45
  has_scoped_record = if current_action_name == 'index'
@@ -125,7 +126,7 @@ module CmAdmin
125
126
 
126
127
  def bulk_action_button(bulk_action)
127
128
  concat(content_tag(:li, class: 'bulk-action-item', data: { action: bulk_action.name }) do
128
- button_to cm_admin.send("#{@model.name.underscore}_#{bulk_action.name}_path"), method: :post, params: { selected_ids: '' }, class: 'bulk-action-button dropdown-item' do
129
+ button_to cm_admin.send("cm_#{bulk_action.name}_#{@model.name.underscore}_path"), method: :post, params: { selected_ids: '' }, class: 'bulk-action-button dropdown-item' do
129
130
  concat(content_tag(:div, class: 'bulk-action-icon') do
130
131
  concat(content_tag(:i, '', class: bulk_action.icon_name))
131
132
  end)
@@ -147,7 +148,7 @@ module CmAdmin
147
148
 
148
149
  def bulk_action_page(bulk_action)
149
150
  concat(content_tag(:li, class: 'bulk-action-item', data: { action: bulk_action.name }) do
150
- link_to cm_admin.send("#{@model.name.underscore}_#{bulk_action.name}_path", @ar_object, bulk_action.url_params), class: 'dropdown-item' do
151
+ link_to cm_admin.send("cm_#{bulk_action.name}_#{@model.name.underscore}_path", @ar_object, bulk_action.url_params), class: 'dropdown-item' do
151
152
  concat(content_tag(:div, class: 'bulk-action-icon') do
152
153
  concat(content_tag(:i, '', class: bulk_action.icon_name))
153
154
  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: 3.0.4
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: exe
16
16
  cert_chain: []
17
- date: 2024-10-24 00:00:00.000000000 Z
17
+ date: 2024-10-30 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: caxlsx_rails