cm-admin 1.4.3 → 1.4.4
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 -3
- 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/_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
- 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: 111a7989194da82d40d228465f63a6cd20142e17510b10debbd23f6036c70cf7
|
4
|
+
data.tar.gz: ed711867e9c03d15fe18d74c44dc802332c8e044ed4a6132007f2a71ff6034d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce7e56508d5482eb781bf7315b43d90ab49542f89b3e9f66734d85834f72157da858a0edd1a6566da4438cf96850637fb9ca37632f87a58005ad391d3fcfd409
|
7
|
+
data.tar.gz: 918556deeefdb621deb50e6715992f255638060bce3f448b0c7ed0d322c60d5251a81de35bacbc4b73ccae4eb943c55359b09cde1b750a76ef4fee59fe1d4e29
|
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.4)
|
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)
|
@@ -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
|
@@ -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
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.4
|
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-
|
13
|
+
date: 2024-02-09 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
|