cm-admin 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23f6fccd6392ef215ea1e9c8927722e5c8cfe249d04515e49c9aab6daebf9b26
4
- data.tar.gz: 6a39df0f21e575502cbe688c69a8a53ba458d81a98fc4dd455fabc6d293d5772
3
+ metadata.gz: 8601dead14fb3dc0870bf087262dd3d8e52377f52da8c79c5d2ef5ed922a61a6
4
+ data.tar.gz: da9c5dd5ef0f560859234c673100e1fb0ed06c6d50bb9ea05e0cb067928cbbd0
5
5
  SHA512:
6
- metadata.gz: 8f944d24b0601cf979f84589fc957d9951c75cfaa1eec722819d581436dd2f496fa2fc73a8c42d98f23c1e73e46d5e40188fb93174fb8bb01a63898e3c0a5e4a
7
- data.tar.gz: 6cb1770919c12717fa95119b12d6be1727589e4bc67f54de96af164718fd4b9d9f60feb091e46db6b5b879669cd964c9c0d87acf65f06b09ea38496f6b647a90
6
+ metadata.gz: 227ebd136acf518706de80706f9555a424fa9b18748cf8fe9bcfc6694681bf402acbb9dfa9f669fd91688f236e4aab74e7dfa9737fdc4245faa9f637f479935e
7
+ data.tar.gz: 3f434f1aa0f507c66ec3eed00d880c749125c6a5aa4ae82f52aff4b89ef07331b254fc8baf1474bc4fd79894d215d3bb13e64f24d8ad6d3287abd279eb125907
@@ -199,9 +199,10 @@
199
199
  margin-left: 2px;
200
200
  }
201
201
 
202
- .text-ellipsis div {
203
- overflow: hidden;
202
+ .text-ellipsis {
204
203
  text-overflow: ellipsis;
204
+ white-space: nowrap;
205
+ overflow: hidden;
205
206
  }
206
207
 
207
208
  @keyframes shakeError {
@@ -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
- span
7
- i.fa.fa-columns.bolder
8
- span
9
- i.fa.fa-angle-down
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 custom_action.name.titleize, custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb
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.titleize, '', data: { bs_toggle: "modal", bs_target: "##{custom_action.name.classify}Modal-#{ar_object.id.to_s}" }
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="true" aria-labelledby="#{custom_action.name.classify}ModalLabel" tabindex="1"
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="Close" data-bs-dismiss="modal" type="button"
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.downcase}_index_path") + '/' + custom_action.path.gsub(':id', ar_object.id.to_s), method: custom_action.verb do
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.titleize
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}
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = "0.6.7"
2
+ VERSION = "0.6.8"
3
3
  end
@@ -25,43 +25,41 @@ module CmAdmin
25
25
  end
26
26
 
27
27
  def show_field_value(ar_object, field)
28
- content_tag(:span) do
29
- case field.field_type || :string
30
- when :integer
31
- ar_object.send(field.field_name).to_s
32
- when :decimal
33
- ar_object.send(field.field_name).to_f.round(field.precision).to_s if ar_object.send(field.field_name)
34
- when :string
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
- when :datetime
37
- ar_object.send(field.field_name).strftime(field.format || "%d/%m/%Y").to_s if ar_object.send(field.field_name)
38
- when :text
39
- ar_object.send(field.field_name)
40
- when :custom
41
- send(field.helper_method, ar_object, field.field_name)
42
- when :link
43
- if field.custom_link
44
- link = field.custom_link
45
- else
46
- link = ar_object.send(field.field_name)
47
- end
48
- content_tag :a, href: link do
49
- ar_object.send(field.field_name).to_s
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.7
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-11 00:00:00.000000000 Z
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.3
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: []