cm-admin 0.5.9 → 0.6.0
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79781db6dbcc1960715b78d50655f618144a805150a64072be3267cc1c79f110
|
|
4
|
+
data.tar.gz: 3cfa1956fe446d22cc275b5b0bf2b883a42b5c86136ebb4c0361058b3f73b96e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 209bd560223da704b275c9473ccf7b59f0ac074b39f3cfc6b01e37c56c1599209a551de4668c8614a7f98d6e9cbeef0043a51a3108b2d85a462289ae7e0f48c0
|
|
7
|
+
data.tar.gz: 46f11879d4b8fcb8fe0033c79397e4922a4714c18ae496c96962d949e344dd512af4250d4f4641e697f89465d7ad2a00bc36485a4de8b0291c6a812eb5d8e7b3
|
|
@@ -43,13 +43,14 @@
|
|
|
43
43
|
span
|
|
44
44
|
i.fa.fa-angle-down
|
|
45
45
|
.popup-card.table-export-popup.hidden
|
|
46
|
-
- if edit_action.any?
|
|
46
|
+
- if edit_action.any? && policy([:cm_admin, @model.name.classify.constantize]).edit?
|
|
47
47
|
= link_to "#{page_url('edit', ar_object)}" do
|
|
48
48
|
.popup-option Edit
|
|
49
49
|
- custom_actions.each do |custom_action|
|
|
50
|
-
- if custom_action.
|
|
51
|
-
|
|
52
|
-
.
|
|
50
|
+
- if custom_action.name.present? && policy([:cm_admin, @model.name.classify.constantize]).send(:"#{custom_action.name}?")
|
|
51
|
+
- if custom_action.display_if.call(ar_object)
|
|
52
|
+
= link_to custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb do
|
|
53
|
+
.popup-option = custom_action.name.titleize
|
|
53
54
|
|
|
54
55
|
.cm-pagination
|
|
55
56
|
.cm-pagination__lhs Showing #{@ar_object.pagy.from} to #{@ar_object.pagy.to} out of #{@ar_object.pagy.count}
|
|
@@ -21,20 +21,22 @@
|
|
|
21
21
|
.popup-option.pointer data-bs-toggle='modal' data-bs-target='#exportmodal'
|
|
22
22
|
span Export
|
|
23
23
|
- new_action = @model.available_actions.select{|act| act if act.action_type.eql?(:default) && act.name.eql?('new')}
|
|
24
|
-
- if new_action.any?
|
|
24
|
+
- if new_action.any? && policy([:cm_admin, @model.name.classify.constantize]).new?
|
|
25
25
|
= link_to 'Add', "#{page_url('new')}", class: 'primary-btn ml-2'
|
|
26
26
|
- @model.available_actions.select{|act| act if act.route_type == 'collection'}.each do |custom_action|
|
|
27
|
-
- if custom_action.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
- if custom_action.name.present? && policy([:cm_admin, @model.name.classify.constantize]).send(:"#{custom_action.name}?")
|
|
28
|
+
- if custom_action.display_type == :button
|
|
29
|
+
= link_to custom_action.name.titleize, @model.ar_model.table_name + '/' + custom_action.path, class: 'primary-btn ml-2', method: custom_action.verb
|
|
30
|
+
- elsif custom_action.display_type == :modal
|
|
31
|
+
= link_to custom_action.name.titleize, '', class: 'primary-btn ml-2', data: { bs_toggle: "modal", bs_target: "##{custom_action.name.classify}Modal" }
|
|
31
32
|
- elsif @model.current_action.name == 'show'
|
|
32
33
|
- @model.available_actions.select{|act| act if act.route_type == 'member'}.each do |custom_action|
|
|
33
|
-
- if custom_action.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
- if custom_action.name.present? && policy([:cm_admin, @model.name.classify.constantize]).send(:"#{custom_action.name}?")
|
|
35
|
+
- if custom_action.display_type == :button && custom_action.display_if.call(@ar_object)
|
|
36
|
+
= link_to custom_action.name.titleize, custom_action.path.gsub(':id', params[:id]), class: 'primary-btn ml-2', method: custom_action.verb
|
|
37
|
+
- elsif custom_action.display_type == :modal && custom_action.display_if.call(@ar_object)
|
|
38
|
+
= link_to custom_action.name.titleize, '', class: 'primary-btn ml-2', data: { bs_toggle: "modal", bs_target: "##{custom_action.name.classify}Modal" }
|
|
37
39
|
|
|
38
40
|
- edit_action = @model.available_actions.select{|act| act if act.action_type.eql?(:default) && act.name.eql?('edit')}
|
|
39
|
-
- if edit_action.any?
|
|
41
|
+
- if edit_action.any? && policy([:cm_admin, @model.name.classify.constantize]).edit?
|
|
40
42
|
= link_to "Edit #{@model.name}", "#{page_url('edit', @ar_object)}", class: 'primary-btn ml-2'
|
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: 0.
|
|
4
|
+
version: 0.6.0
|
|
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: 2022-03-
|
|
13
|
+
date: 2022-03-25 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: pagy
|