cm-admin 3.0.4 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/stylesheets/cm_admin/base/form.scss +12 -6
- data/app/views/cm_admin/main/_top_navbar.html.slim +2 -4
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/form_helper.rb +8 -7
- data/lib/cm_admin/view_helpers/page_info_helper.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edc4e96d677eaa2324f074cf028cf3defc717a49a64a64331e65d18c2b55ecce
|
4
|
+
data.tar.gz: d3cb35655e16e1c36ebb221be9782d6720f556ed0dba3acff74afdf45981f61d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0686244e80d49a67a4caaa628c1dd05b6f09917fe6a74edd7707607f86d6e41325d7ba0da9d637080a8e0a616856f90d2f4d191a436a6a0fe724b1e94eeae674'
|
7
|
+
data.tar.gz: 0fd14c5144600550b7cde3644c1f44e30f3aaa3c3099feb849784d8673cb1eac9dfa88a7257a42bad27b1f943bee1fc27ce44ba6c7ec488c50bdf0d914d2a3d1
|
data/Gemfile.lock
CHANGED
@@ -9,14 +9,10 @@
|
|
9
9
|
.form-page {
|
10
10
|
background-color: $white;
|
11
11
|
&__header {
|
12
|
-
@extend .
|
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
|
-
|
16
|
-
|
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'
|
data/lib/cm_admin/version.rb
CHANGED
@@ -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
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
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
|
-
|
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("#{
|
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("#{
|
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
|
+
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-
|
17
|
+
date: 2024-10-30 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: caxlsx_rails
|