cm-admin 0.6.7 → 0.6.8
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/app/assets/stylesheets/cm_admin/base/common.scss +3 -2
- data/app/views/cm_admin/main/_associated_table.html.slim +14 -11
- data/app/views/cm_admin/main/_table.html.slim +2 -2
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/field_display_helper.rb +34 -36
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8601dead14fb3dc0870bf087262dd3d8e52377f52da8c79c5d2ef5ed922a61a6
|
4
|
+
data.tar.gz: da9c5dd5ef0f560859234c673100e1fb0ed06c6d50bb9ea05e0cb067928cbbd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 227ebd136acf518706de80706f9555a424fa9b18748cf8fe9bcfc6694681bf402acbb9dfa9f669fd91688f236e4aab74e7dfa9737fdc4245faa9f637f479935e
|
7
|
+
data.tar.gz: 3f434f1aa0f507c66ec3eed00d880c749125c6a5aa4ae82f52aff4b89ef07331b254fc8baf1474bc4fd79894d215d3bb13e64f24d8ad6d3287abd279eb125907
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.table-top
|
3
3
|
p.table-top__total-count = "#{@associated_ar_object.pagy.count} #{@action.child_records.to_s.gsub('_', ' ')} found"
|
4
4
|
.table-top__column-action
|
5
|
-
button.secondary-btn.column-btn data-target="#columnActionModal" data-toggle="modal" type="button"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
/ button.secondary-btn.column-btn data-target="#columnActionModal" data-toggle="modal" type="button"
|
6
|
+
/ span
|
7
|
+
/ i.fa.fa-columns.bolder
|
8
|
+
/ span
|
9
|
+
/ i.fa.fa-angle-down
|
10
10
|
|
11
11
|
.new-admin-table.scrollable
|
12
12
|
table.cm-table
|
@@ -46,10 +46,13 @@
|
|
46
46
|
- if custom_action.display_if.call(ar_object)
|
47
47
|
.popup-option
|
48
48
|
- if custom_action.display_type == :button
|
49
|
-
= link_to
|
49
|
+
= link_to cm_admin.send("#{@associated_model.name.underscore}_index_path") + '/' + custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb do
|
50
|
+
span
|
51
|
+
i class="#{custom_action.icon_name}"
|
52
|
+
= custom_action.name.humanize
|
50
53
|
- elsif custom_action.display_type == :modal
|
51
|
-
= link_to custom_action.name.
|
52
|
-
|
54
|
+
= link_to custom_action.name.humanize, '', data: { bs_toggle: 'modal', bs_target: "##{custom_action.name.classify}Modal-#{ar_object.id.to_s}" }
|
55
|
+
|
53
56
|
.cm-pagination
|
54
57
|
.cm-pagination__lhs Showing #{@associated_ar_object.pagy.from} to #{@associated_ar_object.pagy.to} out of #{@associated_ar_object.pagy.count}
|
55
58
|
.cm-pagination__rhs
|
@@ -57,11 +60,11 @@
|
|
57
60
|
|
58
61
|
- @associated_ar_object.data.each do |ar_object|
|
59
62
|
- @associated_model && @associated_model.available_actions.select{|act| act if (act.route_type == 'member' && act.display_type == :modal)}.each do |custom_action|
|
60
|
-
.modal.fade id="#{custom_action.name.classify}Modal-#{ar_object.id.to_s}" aria-hidden=
|
63
|
+
.modal.fade id="#{custom_action.name.classify}Modal-#{ar_object.id.to_s}" aria-hidden='true' aria-labelledby="#{custom_action.name.classify}ModalLabel" tabindex='1'
|
61
64
|
.modal-dialog
|
62
65
|
.modal-content
|
63
66
|
.modal-header
|
64
67
|
h5.modal-title id="#{custom_action.name.classify}ModalLabel" = custom_action.name.classify
|
65
|
-
button.btn-close aria-label=
|
68
|
+
button.btn-close aria-label='Close' data-bs-dismiss='modal'
|
66
69
|
.modal-body
|
67
|
-
= render partial: custom_action.partial, locals: { ar_object: ar_object }
|
70
|
+
= render partial: custom_action.partial, locals: { ar_object: ar_object }
|
@@ -53,11 +53,11 @@
|
|
53
53
|
- custom_actions.each do |custom_action|
|
54
54
|
- if custom_action.name.present? && has_valid_policy(@model.name, custom_action.name)
|
55
55
|
- if custom_action.display_if.call(ar_object)
|
56
|
-
= link_to cm_admin.send("#{@model.name.
|
56
|
+
= link_to cm_admin.send("#{@model.name.underscore}_index_path") + '/' + custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb do
|
57
57
|
.popup-option
|
58
58
|
span
|
59
59
|
i class="#{custom_action.icon_name}"
|
60
|
-
= custom_action.name.
|
60
|
+
= custom_action.name.humanize
|
61
61
|
|
62
62
|
.cm-pagination
|
63
63
|
.cm-pagination__lhs Showing #{@ar_object.pagy.from} to #{@ar_object.pagy.to} out of #{@ar_object.pagy.count}
|
data/lib/cm_admin/version.rb
CHANGED
@@ -25,43 +25,41 @@ module CmAdmin
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def show_field_value(ar_object, field)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
case field.field_type || :string
|
29
|
+
when :integer
|
30
|
+
ar_object.send(field.field_name).to_s
|
31
|
+
when :decimal
|
32
|
+
ar_object.send(field.field_name).to_f.round(field.precision).to_s if ar_object.send(field.field_name)
|
33
|
+
when :string
|
34
|
+
ar_object.send(field.field_name).to_s
|
35
|
+
when :datetime
|
36
|
+
ar_object.send(field.field_name).strftime(field.format || "%d/%m/%Y").to_s if ar_object.send(field.field_name)
|
37
|
+
when :text
|
38
|
+
ar_object.send(field.field_name)
|
39
|
+
when :custom
|
40
|
+
send(field.helper_method, ar_object, field.field_name)
|
41
|
+
when :link
|
42
|
+
if field.custom_link
|
43
|
+
link = field.custom_link
|
44
|
+
else
|
45
|
+
link = ar_object.send(field.field_name)
|
46
|
+
end
|
47
|
+
content_tag :a, href: link do
|
35
48
|
ar_object.send(field.field_name).to_s
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
content_tag
|
49
|
-
|
50
|
-
end
|
51
|
-
when :enum
|
52
|
-
ar_object.send(field.field_name).to_s.titleize
|
53
|
-
when :tag
|
54
|
-
tag_class = field.tag_class.dig("#{ar_object.send(field.field_name.to_s)}".to_sym).to_s
|
55
|
-
content_tag :span, class: "status-tag #{tag_class}" do
|
56
|
-
ar_object.send(field.field_name).to_s.upcase
|
57
|
-
end
|
58
|
-
when :attachment
|
59
|
-
concat show_attachment_value(ar_object, field)
|
60
|
-
when :drawer
|
61
|
-
content_tag :span do
|
62
|
-
concat content_tag(:span, truncate(ar_object.send(field.field_name).to_s, length: 25))
|
63
|
-
concat content_tag(:span, 'View', class: 'drawer-btn')
|
64
|
-
end
|
49
|
+
end
|
50
|
+
when :enum
|
51
|
+
ar_object.send(field.field_name).to_s.titleize
|
52
|
+
when :tag
|
53
|
+
tag_class = field.tag_class.dig("#{ar_object.send(field.field_name.to_s)}".to_sym).to_s
|
54
|
+
content_tag :span, class: "status-tag #{tag_class}" do
|
55
|
+
ar_object.send(field.field_name).to_s.upcase
|
56
|
+
end
|
57
|
+
when :attachment
|
58
|
+
concat show_attachment_value(ar_object, field)
|
59
|
+
when :drawer
|
60
|
+
content_tag :div, class: 'd-flex' do
|
61
|
+
concat content_tag(:div, ar_object.send(field.field_name).to_s, class: 'text-ellipsis')
|
62
|
+
concat content_tag(:div, 'View', class: 'drawer-btn')
|
65
63
|
end
|
66
64
|
end
|
67
65
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cm-admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sajinmp
|
8
8
|
- anbublacky
|
9
9
|
- AdityaTiwari2102
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-05-
|
13
|
+
date: 2022-05-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pagy
|
@@ -239,7 +239,7 @@ licenses:
|
|
239
239
|
metadata:
|
240
240
|
homepage_uri: https://github.com/commutatus/cm-admin
|
241
241
|
source_code_uri: https://github.com/commutatus/cm-admin
|
242
|
-
post_install_message:
|
242
|
+
post_install_message:
|
243
243
|
rdoc_options: []
|
244
244
|
require_paths:
|
245
245
|
- lib
|
@@ -254,8 +254,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
254
254
|
- !ruby/object:Gem::Version
|
255
255
|
version: '0'
|
256
256
|
requirements: []
|
257
|
-
rubygems_version: 3.2.
|
258
|
-
signing_key:
|
257
|
+
rubygems_version: 3.2.32
|
258
|
+
signing_key:
|
259
259
|
specification_version: 4
|
260
260
|
summary: This is an admin panel gem
|
261
261
|
test_files: []
|