cm-admin 1.4.3 → 1.4.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 +4 -4
- data/Gemfile.lock +1 -3
- data/app/assets/javascripts/cm_admin/scaffolds.js +2 -1
- data/app/assets/stylesheets/cm_admin/base/form.scss +28 -0
- data/app/assets/stylesheets/cm_admin/components/_drawer.scss +3 -0
- data/app/controllers/cm_admin/resource_controller.rb +2 -2
- data/app/views/cm_admin/main/_associated_table.html.slim +1 -1
- data/app/views/cm_admin/main/_show_content.html.slim +1 -1
- data/app/views/cm_admin/main/_tabs.html.slim +4 -1
- data/app/views/cm_admin/main/history.html.slim +1 -1
- data/app/views/cm_admin/main/show.html.slim +1 -1
- data/app/views/layouts/_custom_action_modal.html.slim +1 -1
- data/app/views/layouts/cm_admin.html.slim +3 -3
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/form_field_helper.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00cd64c6ef60a6e6a8764533d677a742765dc47b30db30fb64e302d350faaaac
|
4
|
+
data.tar.gz: 6a9ab9b8dd72eedf62c31892753103f1c73570ff3a17c6cea60edddfaa52f9b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02c38abf40ff1651525e1b103bafaf920e18a320abd5fc631779fa6b5d99944bc9546c1145ddfa2a0cd2ef5b78b94eab45fb06b012d66fc74e64e3550d24b8ad
|
7
|
+
data.tar.gz: 63051f6070b8ab489b3d6e55b397cdb7e7e8402284d3436c80cb46d821613a62303544acee2fd0c9bc876bd3631062f9191d3d11334cd50d2b0b461aabe9dc8f
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cm-admin (1.4.
|
4
|
+
cm-admin (1.4.5)
|
5
5
|
caxlsx_rails
|
6
6
|
cocoon (~> 1.2.15)
|
7
7
|
csv-importer (~> 0.8.2)
|
@@ -143,8 +143,6 @@ GEM
|
|
143
143
|
nio4r (2.7.0)
|
144
144
|
nokogiri (1.16.0-arm64-darwin)
|
145
145
|
racc (~> 1.4)
|
146
|
-
nokogiri (1.16.0-x86_64-linux)
|
147
|
-
racc (~> 1.4)
|
148
146
|
pagy (4.11.0)
|
149
147
|
parallel (1.22.1)
|
150
148
|
parser (3.1.2.1)
|
@@ -18,6 +18,7 @@ import 'flatpickr'
|
|
18
18
|
import 'jgrowl'
|
19
19
|
import Select2 from "select2"
|
20
20
|
Select2()
|
21
|
+
jqueryJgrowl()
|
21
22
|
|
22
23
|
// import '@nathanvda/cocoon'
|
23
24
|
import 'daterangepicker'
|
@@ -38,7 +39,7 @@ document.addEventListener("turbo:load", function () {
|
|
38
39
|
$('.select-2').select2({
|
39
40
|
theme: "bootstrap-5",
|
40
41
|
});
|
41
|
-
|
42
|
+
|
42
43
|
});
|
43
44
|
|
44
45
|
$(document).on('click', '.menu-item', function(e) {
|
@@ -72,3 +72,31 @@
|
|
72
72
|
visibility: hidden;
|
73
73
|
}
|
74
74
|
}
|
75
|
+
|
76
|
+
.form-modal {
|
77
|
+
.form-info-text {
|
78
|
+
@extend .text-body, .mb-3;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
// Simple form UI
|
83
|
+
.simple_form {
|
84
|
+
.input {
|
85
|
+
@extend .mb-3;
|
86
|
+
}
|
87
|
+
label {
|
88
|
+
@extend .form-label;
|
89
|
+
}
|
90
|
+
input {
|
91
|
+
@extend .form-control;
|
92
|
+
}
|
93
|
+
input[type="submit"] {
|
94
|
+
width: auto;
|
95
|
+
float: right;
|
96
|
+
@extend .mt-3;
|
97
|
+
}
|
98
|
+
.select-2 {
|
99
|
+
appearance: auto;
|
100
|
+
@extend .form-control;
|
101
|
+
}
|
102
|
+
}
|
@@ -35,7 +35,7 @@ module CmAdmin
|
|
35
35
|
resource_identifier
|
36
36
|
respond_to do |format|
|
37
37
|
if request.xhr?
|
38
|
-
format.html { render partial: '/cm_admin/main/show_content' }
|
38
|
+
format.html { render partial: '/cm_admin/main/show_content', locals: { via_xhr: true } }
|
39
39
|
else
|
40
40
|
format.html { render '/cm_admin/main/' + action_name }
|
41
41
|
end
|
@@ -162,7 +162,7 @@ module CmAdmin
|
|
162
162
|
format.html { redirect_to request.referrer, alert: "<b>#{@action.name.titleize} is unsuccessful</b><br /><ul>#{error_messages}</ul>" }
|
163
163
|
end
|
164
164
|
rescue => exception
|
165
|
-
format.html { redirect_to request.referrer, alert: "<b>#{@action.name.titleize} is unsuccessful</b><br /><
|
165
|
+
format.html { redirect_to request.referrer, alert: "<div><b>#{@action.name.titleize} is unsuccessful</b><br /><ul><li>#{exception.message}</li></ul></div>" }
|
166
166
|
end
|
167
167
|
end
|
168
168
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
p.table-top__total-count = "#{humanized_ar_collection_count(@associated_ar_object.pagy.count, @action.child_records.to_s)}"
|
6
6
|
.table-top__column-action
|
7
7
|
- if @associated_model && @associated_model.available_actions.map(&:name).include?('new') && has_valid_policy(@associated_ar_object, 'new')
|
8
|
-
- association = @ar_object.class.reflect_on_all_associations.select{|x| x.name == @associated_model.name.tableize.to_sym }.first
|
8
|
+
- association = @ar_object.class.reflect_on_all_associations.select{|x| x.name == @associated_model.name.tableize.to_sym }.first
|
9
9
|
- polymorphic_name = (association && association.inverse_of && association.inverse_of.options[:polymorphic]) ? association.inverse_of.name : ''
|
10
10
|
a href="#{CmAdmin::Engine.mount_path}/#{@associated_model.name.tableize}/new?associated_id=#{@ar_object.id}&associated_class=#{@ar_object.class.name.underscore}&polymorphic_name=#{polymorphic_name}&referrer=#{request.path}"
|
11
11
|
button.btn-secondary Add
|
@@ -4,7 +4,10 @@ ul.tabs
|
|
4
4
|
- if nav_item.custom_action.empty? || (nav_item.custom_action.present? && policy([:cm_admin, @model.name.classify.constantize]).send(:"#{nav_item.custom_action}?"))
|
5
5
|
li.nav-item
|
6
6
|
- nav_item_action_name = nav_item.custom_action.present? ? nav_item.custom_action : 'show'
|
7
|
-
|
7
|
+
- if via_xhr
|
8
|
+
= link_to tab_display_name(nav_item.nav_item_name), cm_admin.send("#{@ar_object.model_name.singular}_#{nav_item_action_name}_path", @ar_object.id), class: "nav-link #{ nav_item_action_name == action_name ? 'active' : ''}", target: '_blank'
|
9
|
+
- else
|
10
|
+
= link_to tab_display_name(nav_item.nav_item_name), cm_admin.send("#{@ar_object.model_name.singular}_#{nav_item_action_name}_path", @ar_object.id), class: "nav-link #{ nav_item_action_name == action_name ? 'active' : ''}"
|
8
11
|
// current_action_name is defined when action trail is added to that model
|
9
12
|
- if policy([:cm_admin, @model.name.classify.constantize]).send(:history?)
|
10
13
|
li.nav-item
|
@@ -1,2 +1,2 @@
|
|
1
1
|
.show-page
|
2
|
-
= render partial: 'cm_admin/main/show_content'
|
2
|
+
= render partial: 'cm_admin/main/show_content', via_xhr: false
|
@@ -6,6 +6,6 @@
|
|
6
6
|
button.btn-close aria-label="Close" data-bs-dismiss="modal" type="button"
|
7
7
|
.modal-body
|
8
8
|
- if custom_action.partial
|
9
|
-
= render partial: custom_action.partial
|
9
|
+
= render partial: custom_action.partial, locals: { custom_action: custom_action, ar_object: ar_object }
|
10
10
|
- else
|
11
11
|
= render partial: 'cm_admin/main/custom_action_modal_form', locals: { custom_action: custom_action, ar_object: ar_object }
|
@@ -31,7 +31,7 @@ html
|
|
31
31
|
.show-page
|
32
32
|
.show-page__header.page-top-bar
|
33
33
|
== render 'cm_admin/main/top_navbar'
|
34
|
-
== render 'cm_admin/main/tabs'
|
34
|
+
== render 'cm_admin/main/tabs', via_xhr: false
|
35
35
|
.show-page__inner
|
36
36
|
= yield
|
37
37
|
- elsif defined?(@action) && (@action&.layout_type.to_s == 'cm_association_index' || @action.parent == "index")
|
@@ -39,7 +39,7 @@ html
|
|
39
39
|
.show-page__header.page-top-bar
|
40
40
|
== render 'cm_admin/main/top_navbar'
|
41
41
|
- if @ar_object.model_name
|
42
|
-
== render 'cm_admin/main/tabs'
|
42
|
+
== render 'cm_admin/main/tabs', via_xhr: false
|
43
43
|
- if @associated_model && @associated_model.filters.present?
|
44
44
|
.filters-bar
|
45
45
|
== render partial: 'cm_admin/main/filters', locals: { filters: @associated_model.filters }
|
@@ -47,6 +47,6 @@ html
|
|
47
47
|
- else
|
48
48
|
= yield
|
49
49
|
= render 'layouts/cm_flash_message'
|
50
|
-
- unless (@current_action
|
50
|
+
- unless (@current_action&.view_type == :kanban || params[:view_type] == 'kanban')
|
51
51
|
= render 'layouts/custom_action_modals'
|
52
52
|
|
data/lib/cm_admin/version.rb
CHANGED
@@ -142,7 +142,7 @@ module CmAdmin
|
|
142
142
|
|
143
143
|
def attachment_list(form_obj, cm_field, _value, required_class, _target_action)
|
144
144
|
attached = form_obj.object.send(cm_field.field_name)
|
145
|
-
return if attached.instance_of?(Paperclip::Attachment)
|
145
|
+
return if defined?(::Paperclip) && attached.instance_of?(::Paperclip::Attachment)
|
146
146
|
|
147
147
|
content_tag(:div) do
|
148
148
|
if attached.class == ActiveStorage::Attached::Many
|
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.4.
|
4
|
+
version: 1.4.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: 2024-01
|
13
|
+
date: 2024-03-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: caxlsx_rails
|
@@ -498,7 +498,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
498
498
|
- !ruby/object:Gem::Version
|
499
499
|
version: '0'
|
500
500
|
requirements: []
|
501
|
-
rubygems_version: 3.2.
|
501
|
+
rubygems_version: 3.2.3
|
502
502
|
signing_key:
|
503
503
|
specification_version: 4
|
504
504
|
summary: CmAdmin is a robust gem designed to assist in creating admin panels for Rails
|