cm-admin 0.5.0 → 0.5.2

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: 2047ac958ebd117645f7089227af0177f495f1cf640791c3e2f9fb2920fc1f04
4
- data.tar.gz: 3f81a0d55a072ec52cb51b54e04cfd77edc87e562275539045ec39ca98e5b6ca
3
+ metadata.gz: ee189fda2ffbbbebebbf187b269408ae2b95a17e8373133fe5d0a8046abc4375
4
+ data.tar.gz: e6a788a92b95d4492dc86cbdcdc6abd518d3a361f802a88449ed923ebf02cc72
5
5
  SHA512:
6
- metadata.gz: b7f8ac87cb03febd769e5f11a8e4819eff5cb978727c1bc55d73680970147b1e28c15293d1d819dbec11c290fc090126a32bdc3db1f30d7202013bbf4a43c25b
7
- data.tar.gz: 370da992ee711a9e2d15d665e4ee2e595ab4767e3761c58d603ad3a6abef95b1f09412e8d92e7ea0dea3763f1ce1332a735f42a9d5b27e7e35f05800fcc6d863
6
+ metadata.gz: 4eff826866357c66a2ff35980f3ef2a66576649b4c9285442f045986ee2a9435fb96dfa7f0761fe6b61df2f26941e62b13385d4aa6c7546808f5736d08437ae3
7
+ data.tar.gz: 281ba123d2514c2f51abe820f7f16eee2448b5efcea11ee06acee96b2ac3851663ff836a05cfe91b704f49e11f4c28c0e3490c1cf5ee4076cc68724b22b6c728
@@ -26,7 +26,7 @@
26
26
  td.text-ellipsis
27
27
  span class="#{column.cm_css_class}"
28
28
  - if index == 0
29
- = link_to ar_object.send(column.field_name), "/cm_admin/#{@model.ar_model.table_name}/#{ar_object.id}"
29
+ = link_to ar_object.send(column.field_name), "/cm_admin/#{ar_object.model_name.collection}/#{ar_object.id}"
30
30
  - else
31
31
  = show_field_value(ar_object, column)
32
32
  td.row-action-cell
@@ -10,6 +10,8 @@ html
10
10
  = stylesheet_pack_tag 'cm_admin/application', 'data-turbolinks-track': 'reload'
11
11
  link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" /
12
12
  = javascript_pack_tag 'cm_admin/application', 'data-turbolinks-track': 'reload'
13
+ = javascript_include_tag 'cm_admin/custom', 'data-turbolinks-track': 'reload'
14
+ = stylesheet_link_tag 'cm_admin/custom', media: 'all', 'data-turbolinks-track': 'reload'
13
15
  script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"
14
16
  script src="https://raw.githack.com/SortableJS/Sortable/master/Sortable.js"
15
17
  body
data/cm_admin.gemspec CHANGED
@@ -3,8 +3,8 @@ require_relative 'lib/cm_admin/version'
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "cm-admin"
5
5
  spec.version = CmAdmin::VERSION
6
- spec.authors = ["sajinmp", "anbublacky", "manikandan0603"]
7
- spec.email = ["sajinprasadkm@gmail.com", "anbublacky@gmail.com"]
6
+ spec.authors = ["sajinmp", "anbublacky", "AdityaTiwari2102"]
7
+ spec.email = ["sajinprasadkm@gmail.com", "anbublacky@gmail.com", "taditya.tiwari007@gmail.com"]
8
8
 
9
9
  spec.summary = %q{This is an admin panel gem}
10
10
  spec.description = %q{This is an admin panel gem}
data/config/routes.rb CHANGED
@@ -12,7 +12,7 @@ CmAdmin::Engine.routes.draw do
12
12
  CmAdmin.cm_admin_models.each do |model|
13
13
  model.available_actions.sort_by {|act| act.class}.each do |act|
14
14
  scope model.name.tableize do
15
- send(act.verb, act.path.present? ? act.path : act.name, to: "#{model.name.underscore}##{act.name}")
15
+ send(act.verb, act.path.present? ? act.path : act.name, to: "#{model.name.underscore}##{act.name}", as: "#{model.name.underscore}_#{act.name}")
16
16
  end
17
17
  end
18
18
  end
@@ -12,6 +12,8 @@ module CmAdmin
12
12
  initializer 'RailsAdmin precompile hook', group: :all do |app|
13
13
  app.config.assets.precompile += %w(
14
14
  cm_admin/cm_admin.css
15
+ cm_admin/custom.js
16
+ cm_admin/custom.css
15
17
  )
16
18
  end
17
19
 
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -22,7 +22,7 @@ module CmAdmin
22
22
 
23
23
  def form_with_all_fields(resource, method)
24
24
  columns = resource.class.columns.dup
25
- table_name = resource.class.table_name
25
+ table_name = resource.model_name.collection
26
26
  columns.reject! { |i| REJECTABLE.include?(i.name) }
27
27
  url = CmAdmin::Engine.mount_path + "/#{table_name}/#{resource.id}"
28
28
  set_form_for_fields(resource, columns, url, method)
@@ -30,7 +30,7 @@ module CmAdmin
30
30
 
31
31
  def form_with_mentioned_fields(resource, available_fields, method)
32
32
  # columns = resource.class.columns.select { |i| available_fields.map(&:field_name).include?(i.name.to_sym) }
33
- table_name = resource.class.table_name
33
+ table_name = resource.model_name.collection
34
34
  # columns.reject! { |i| REJECTABLE.include?(i.name) }
35
35
  url = CmAdmin::Engine.mount_path + "/#{table_name}/#{resource.id}"
36
36
  set_form_for_fields(resource, available_fields, url, method)
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.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sajinmp
8
8
  - anbublacky
9
- - manikandan0603
9
+ - AdityaTiwari2102
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-01-20 00:00:00.000000000 Z
13
+ date: 2022-01-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pagy
@@ -86,6 +86,7 @@ description: This is an admin panel gem
86
86
  email:
87
87
  - sajinprasadkm@gmail.com
88
88
  - anbublacky@gmail.com
89
+ - taditya.tiwari007@gmail.com
89
90
  executables: []
90
91
  extensions: []
91
92
  extra_rdoc_files: []
@@ -227,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
228
  - !ruby/object:Gem::Version
228
229
  version: '0'
229
230
  requirements: []
230
- rubygems_version: 3.0.3
231
+ rubygems_version: 3.2.32
231
232
  signing_key:
232
233
  specification_version: 4
233
234
  summary: This is an admin panel gem