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 +4 -4
- data/app/views/cm_admin/main/_table.html.slim +1 -1
- data/app/views/layouts/cm_admin.html.slim +2 -0
- data/cm_admin.gemspec +2 -2
- data/config/routes.rb +1 -1
- data/lib/cm_admin/engine.rb +2 -0
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/form_helper.rb +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee189fda2ffbbbebebbf187b269408ae2b95a17e8373133fe5d0a8046abc4375
|
4
|
+
data.tar.gz: e6a788a92b95d4492dc86cbdcdc6abd518d3a361f802a88449ed923ebf02cc72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/#{
|
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", "
|
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
|
data/lib/cm_admin/engine.rb
CHANGED
data/lib/cm_admin/version.rb
CHANGED
@@ -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.
|
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.
|
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.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sajinmp
|
8
8
|
- anbublacky
|
9
|
-
-
|
9
|
+
- AdityaTiwari2102
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-01-
|
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.
|
231
|
+
rubygems_version: 3.2.32
|
231
232
|
signing_key:
|
232
233
|
specification_version: 4
|
233
234
|
summary: This is an admin panel gem
|