cm-admin 0.8.1 → 0.8.3
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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/views/cm_admin/main/_table.html.slim +1 -1
- data/app/views/cm_admin/main/_top_navbar.html.slim +14 -13
- data/lib/cm_admin/models/form_field.rb +2 -1
- data/lib/cm_admin/version.rb +1 -1
- data/lib/cm_admin/view_helpers/field_display_helper.rb +1 -1
- data/lib/cm_admin/view_helpers/form_field_helper.rb +1 -1
- data/lib/cm_admin.rb +1 -2
- data/tmp/cache/webpacker/last-compilation-digest-development +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46493821058fb3837c097bc0a0aa491c8a45ba858c20e079bd2f546f94bd6ef7
|
4
|
+
data.tar.gz: d711c110547d83c120f3d0750f3d6e49db925ab622baf2051686f51927c55203
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae3d4e6c410bf6197b2f932309a60c8f440a7b3f91de3d9f719a65debcda95e09ffe0b101e6ee7bd01dabda916ffeecb21cdbc2bd8b6f17ee17ceba6fe6022d6
|
7
|
+
data.tar.gz: afc522a55a080d8487b761875a407c286a109c84692a177f211f7abc1436ace836440742f544a8ac029d115494b831e903f71bb13fbd814af9be2dcd652153bb
|
data/Gemfile.lock
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
- @model.available_fields[:index].each_with_index do |column, index|
|
27
27
|
td.text-ellipsis
|
28
28
|
span class="#{column.field_type.to_s} #{column.cm_css_class} "
|
29
|
-
- if index == 0
|
29
|
+
- if index == 0 && !([:link, :custom, :attachment, :drawer, :image].include?(column.field_type))
|
30
30
|
= link_to ar_object.send(column.field_name), cm_admin.send("#{ar_object.model_name.singular}_show_path", ar_object.id)
|
31
31
|
- else
|
32
32
|
= show_field_value(ar_object, column)
|
@@ -9,19 +9,20 @@
|
|
9
9
|
p.title-sub-text = action_description
|
10
10
|
.cm-navbar__rhs
|
11
11
|
- if @model.current_action.name == 'index'
|
12
|
-
.
|
13
|
-
.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
12
|
+
- if has_valid_policy(@model.name, :exportable)
|
13
|
+
.export-container
|
14
|
+
.dropdown
|
15
|
+
button.secondary-btn data-bs-toggle='dropdown'
|
16
|
+
span
|
17
|
+
i.fa.fa-arrow-down
|
18
|
+
span
|
19
|
+
| Export
|
20
|
+
span
|
21
|
+
i.fa.fa-angle-down
|
22
|
+
ul.dropdown-menu.export-popup
|
23
|
+
li
|
24
|
+
.popup-option.pointer data-bs-toggle='modal' data-bs-target='#exportmodal'
|
25
|
+
span Export
|
25
26
|
- if @model.importer
|
26
27
|
= link_to 'Import', cm_admin.send(:"#{@model.name.underscore}_import_path"), class: 'primary-btn ml-2'
|
27
28
|
- new_action = @model.available_actions.select{|act| act if act.action_type.eql?(:default) && act.name.eql?('new')}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module CmAdmin
|
2
2
|
module Models
|
3
3
|
class FormField
|
4
|
-
attr_accessor :field_name, :label, :header, :input_type, :collection, :disabled, :helper_method
|
4
|
+
attr_accessor :field_name, :label, :header, :input_type, :collection, :disabled, :helper_method, :placeholder
|
5
5
|
VALID_INPUT_TYPES = [:integer, :decimal, :string, :single_select, :multi_select, :date, :date_time, :text, :single_file_upload, :multi_file_upload, :hidden, :rich_text].freeze
|
6
6
|
|
7
7
|
def initialize(field_name, input_type, attributes = {})
|
@@ -17,6 +17,7 @@ module CmAdmin
|
|
17
17
|
self.disabled = false
|
18
18
|
self.label = self.field_name.to_s.titleize
|
19
19
|
self.input_type = :string
|
20
|
+
self.placeholder = "Enter #{self.field_name.to_s.downcase.gsub('_', ' ')}"
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
data/lib/cm_admin/version.rb
CHANGED
@@ -66,7 +66,7 @@ module CmAdmin
|
|
66
66
|
if ar_object.send(field.field_name).attached?
|
67
67
|
image_tag(ar_object.send(field.field_name).url, height: field.height, width: field.height)
|
68
68
|
else
|
69
|
-
image_tag('/
|
69
|
+
image_tag('https://cm-admin.s3.ap-south-1.amazonaws.com/gem_static_assets/image_not_available.png', height: 50, width: 50)
|
70
70
|
end
|
71
71
|
end
|
72
72
|
end
|
@@ -13,7 +13,7 @@ module CmAdmin
|
|
13
13
|
when :string
|
14
14
|
return f.text_field field.field_name, class: "normal-input #{required_class}", disabled: field.disabled, value: value, placeholder: "Enter #{field.field_name.to_s.downcase.gsub('_', ' ')}"
|
15
15
|
when :single_select
|
16
|
-
return f.select field.field_name, options_for_select(select_collection_value(field), f.object.send(field.field_name)), {include_blank:
|
16
|
+
return f.select field.field_name, options_for_select(select_collection_value(field), f.object.send(field.field_name)), {include_blank: field.placeholder.to_s}, class: "normal-input #{required_class} select-2", disabled: field.disabled
|
17
17
|
when :multi_select
|
18
18
|
return f.select field.field_name, options_for_select(select_collection_value(field), f.object.send(field.field_name)), {include_blank: "Select #{field.field_name.to_s.downcase.gsub('_', ' ')}"}, class: "normal-input #{required_class} select-2", disabled: field.disabled, multiple: true
|
19
19
|
when :date
|
data/lib/cm_admin.rb
CHANGED
@@ -35,8 +35,7 @@ module CmAdmin
|
|
35
35
|
def initialize_model(entity, &block)
|
36
36
|
if entity.is_a?(Class)
|
37
37
|
return if CmAdmin::Model.find_by({name: entity.name})
|
38
|
-
|
39
|
-
config.cm_admin_models << cm_model
|
38
|
+
config.cm_admin_models << CmAdmin::Model.new(entity, &block)
|
40
39
|
end
|
41
40
|
end
|
42
41
|
end
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
41eaf97f2fb017cf52d8df48e6d8d6d35f997b2e
|
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.8.
|
4
|
+
version: 0.8.3
|
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-10-
|
13
|
+
date: 2022-10-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: caxlsx_rails
|