cm-admin 1.5.7 → 1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2683d5547505d258f1bf7c0ea82236130ec6287ead5ab3670a29d909bc7a895
4
- data.tar.gz: ad8a5db9a2a05d60ba04ced18d09591c56b78dc0cf849823c9a63b296ec43454
3
+ metadata.gz: 0e49275db41af1ddf4329377297145c4d728982d58af3ea702def169013f82da
4
+ data.tar.gz: 4a893b0b951b845e3ebd6dd2d329d04666bf5e49453aa32a360155cd2e1ac47b
5
5
  SHA512:
6
- metadata.gz: 7630c3561997e736dc4a0400d2c734d3e383545f11a5173061196fc84ab12b27322ac6f3945168db80e50713158d341534573632b148c3f682314c7a32fbdc0f
7
- data.tar.gz: edef5e258984bdd78e2a195ad0434df645d13a8c8c4a84254ea9689b7ede1d1aaa6b0e1fad0a2e0ed87c415e1219f4406991411e8bb7f7dfc93b66a6f672ea4a
6
+ metadata.gz: 4871a8f88d35b886cd398dbb313de28c8633660d13a9da80964ef23c1dc6efb4b49d32f612709312f50a67a29015ce59d5e7316e191ef06a2f04b23ded4795c3
7
+ data.tar.gz: 0a31493b6dc0914e864f0344906362dc5595db536b839afe6a51fa94b0ba9847820f56a1f6456678e11dbf2ae851fc712ff72492f555081f7567531d27b7a086
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (1.5.6)
4
+ cm-admin (1.5.7)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -41,6 +41,10 @@ $(document).on("click", ".row-action-cell", function (e) {
41
41
  }
42
42
  });
43
43
 
44
+ $(document).on("mouseleave", ".row-action-cell", function () {
45
+ $(this).find(".table-export-popup").addClass("hidden");
46
+ });
47
+
44
48
  $(document).on("click", ".drawer-btn", function (e) {
45
49
  e.stopPropagation();
46
50
  var drawer_el = $(this).parent().closest(".drawer").find(".cm-drawer");
@@ -20,7 +20,6 @@
20
20
  right: 30px;
21
21
  width: 156px;
22
22
  padding: 8px 0;
23
- animation: fadeIn .2s ease-in-out;
24
23
  .popup-option {
25
24
  padding: 8px 16px;
26
25
  @include font($size: $t4-text, $color: $primary-text-clr);
@@ -34,6 +33,14 @@
34
33
  margin-right: 8px;
35
34
  }
36
35
  }
36
+ button {
37
+ width: 100%;
38
+ margin: 0;
39
+ padding: 0;
40
+ background: transparent;
41
+ border: none;
42
+ text-align: left;
43
+ }
37
44
  }
38
45
  }
39
46
 
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '1.5.7'
2
+ VERSION = '1.5.8'
3
3
  end
@@ -126,16 +126,17 @@ module CmAdmin
126
126
  end
127
127
 
128
128
  def set_form_with_sections(resource, entities, url, method)
129
- polymorphic_name, associated_id, associated_class = extract_referrer_query_params
130
- form_for(resource, url: url, method: method, html: { class: "cm_#{resource.class.name.downcase}_form" } ) do |form_obj|
129
+ url_with_query_params = extract_query_params(url)
130
+
131
+ form_for(resource, url: url_with_query_params || url, method: method, html: { class: "cm_#{resource.class.name.downcase}_form" } ) do |form_obj|
131
132
  if params[:referrer]
132
133
  concat form_obj.text_field "referrer", class: "normal-input", hidden: true, value: params[:referrer], name: 'referrer'
133
134
  end
134
- if params[:polymorphic_name].present? || polymorphic_name.present?
135
- concat form_obj.text_field ( params[:polymorphic_name] || polymorphic_name ) + '_type', class: "normal-input", hidden: true, value: ( params[:associated_class] || associated_class ).classify
136
- concat form_obj.text_field ( params[:polymorphic_name] || polymorphic_name ) + '_id', class: "normal-input", hidden: true, value: ( params[:associated_id] || associated_id )
137
- elsif (params[:associated_class] && params[:associated_id] || associated_id.present? && associated_class.present? )
138
- concat form_obj.text_field ( params[:associated_class] || associated_class ) + '_id', class: "normal-input", hidden: true, value: ( params[:associated_id] || associated_id )
135
+ if params[:polymorphic_name].present?
136
+ concat form_obj.text_field params[:polymorphic_name] + '_type', class: "normal-input", hidden: true, value: params[:associated_class].classify
137
+ concat form_obj.text_field params[:polymorphic_name] + '_id', class: "normal-input", hidden: true, value: params[:associated_id]
138
+ elsif params[:associated_class] && params[:associated_id]
139
+ concat form_obj.text_field params[:associated_class] + '_id', class: "normal-input", hidden: true, value: params[:associated_id]
139
140
  end
140
141
 
141
142
  concat split_form_into_section(resource, form_obj, entities)
@@ -145,18 +146,16 @@ module CmAdmin
145
146
  end
146
147
 
147
148
 
148
- def extract_referrer_query_params
149
- uri = URI.parse(request.referrer)
150
-
151
- return unless uri.query.present?
152
-
153
- query_params = CGI.parse(uri.query)
149
+ def extract_query_params(url)
150
+ query_params = {}
151
+ if params[:polymorphic_name].present? || params[:associated_id].present? && params[:associated_class].present?
152
+ query_params[:polymorphic_name] = params[:polymorphic_name]
153
+ query_params[:associated_id] = params[:associated_id]
154
+ query_params[:associated_class] = params[:associated_class]
155
+ query_params[:referrer] = params[:referrer] if params[:referrer].present?
154
156
 
155
- polymorphic_name = query_params['polymorphic_name'].first
156
- associated_id = query_params['associated_id'].first
157
- associated_class = query_params['associated_class'].first
158
-
159
- return polymorphic_name, associated_id, associated_class
157
+ return url + '?' + query_params.to_query unless query_params.empty?
158
+ end
160
159
  end
161
160
  end
162
161
  end
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.5.7
4
+ version: 1.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - sajinmp
@@ -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.5.3
501
+ rubygems_version: 3.3.7
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