cm-admin 1.1.8 → 1.1.9

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.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.vscode/settings.json +3 -0
  4. data/Gemfile.lock +1 -1
  5. data/app/assets/stylesheets/cm_admin/base/navbar.scss +11 -38
  6. data/app/assets/stylesheets/cm_admin/base/quicksearch.scss +3 -4
  7. data/app/assets/stylesheets/cm_admin/base/show.scss +4 -15
  8. data/app/assets/stylesheets/cm_admin/base/table.scss +2 -14
  9. data/app/assets/stylesheets/cm_admin/components/_buttons.scss +28 -140
  10. data/app/assets/stylesheets/cm_admin/dependency/bootstrap.min.css +4 -5
  11. data/app/assets/stylesheets/cm_admin/pages/import_page.scss +3 -10
  12. data/app/views/cm_admin/main/_actions_dropdown.html.slim +1 -3
  13. data/app/views/cm_admin/main/_associated_table.html.slim +1 -1
  14. data/app/views/cm_admin/main/_nested_fields.html.slim +2 -1
  15. data/app/views/cm_admin/main/_nested_table_form.html.slim +1 -1
  16. data/app/views/cm_admin/main/_tabs.html.slim +1 -1
  17. data/app/views/cm_admin/main/_top_navbar.html.slim +11 -17
  18. data/app/views/cm_admin/main/history.html.slim +3 -4
  19. data/app/views/cm_admin/main/import_form.html.slim +2 -2
  20. data/app/views/cm_admin/main/new.html.slim +1 -1
  21. data/app/views/cm_admin/main/show.html.slim +3 -4
  22. data/app/views/layouts/_quick_links.html.slim +2 -2
  23. data/app/views/layouts/cm_admin.html.slim +10 -12
  24. data/lib/cm_admin/version.rb +1 -1
  25. data/lib/cm_admin/view_helpers/form_helper.rb +2 -1
  26. data/lib/cm_admin/view_helpers/manage_column_popup_helper.rb +2 -2
  27. data/lib/cm_admin/view_helpers/page_info_helper.rb +4 -4
  28. data/lib/cm_admin/view_helpers.rb +2 -1
  29. metadata +3 -2
@@ -25,7 +25,7 @@
25
25
  line-height: 22px;
26
26
  margin-bottom: 0;
27
27
  }
28
- }
28
+ }
29
29
  &__body {
30
30
  padding: 16px 24px;
31
31
  .body-title {
@@ -63,9 +63,6 @@
63
63
 
64
64
  .actions-wrapper {
65
65
  margin-top: 32px;
66
- button {
67
- padding: 5px 10px;
68
- }
69
66
  }
70
67
 
71
68
  //form UI
@@ -90,7 +87,7 @@
90
87
  margin-bottom: 16px;
91
88
  text-transform: uppercase;
92
89
  }
93
- .steps-wrapper {
90
+ .steps-wrapper {
94
91
  .steps-title {
95
92
  @include font($size: size(16), $weight: bold);
96
93
  font-family: $primary-font;
@@ -116,10 +113,6 @@
116
113
  }
117
114
  }
118
115
  }
119
- .import-btn {
120
- padding: 5px 10px;
121
- }
122
116
  }
123
-
124
117
  }
125
- }
118
+ }
@@ -5,11 +5,9 @@
5
5
  - if custom_actions.any? || edit_action.present? || destroy_action.present?
6
6
  td.row-action-cell
7
7
  .row-action-tool
8
- button.secondary-btn.tool-btn
8
+ button.btn-ghost.dropdown-toggle
9
9
  span
10
10
  i.fa.fa-bars.bolder
11
- span
12
- i.fa.fa-angle-down
13
11
  .popup-card.table-export-popup.hidden
14
12
  - if edit_action.present?
15
13
  = link_to cm_admin.send("#{current_model.name.underscore}_edit_path", ar_object.id) do
@@ -8,7 +8,7 @@
8
8
  - association = @ar_object.class.reflect_on_all_associations.select{|x| x.name == @associated_model.name.tableize.to_sym }.first
9
9
  - polymorphic_name = (association && association.inverse_of && association.inverse_of.options[:polymorphic]) ? association.inverse_of.name : ''
10
10
  a href="#{CmAdmin::Engine.mount_path}/#{@associated_model.name.tableize}/new?associated_id=#{@ar_object.id}&associated_class=#{@ar_object.class.name.underscore}&polymorphic_name=#{polymorphic_name}&referrer=#{request.path}"
11
- button.secondary-btn.column-btn Add
11
+ button.btn-secondary Add
12
12
  / button.secondary-btn.column-btn data-target="#columnActionModal" data-toggle="modal" type="button"
13
13
  / span
14
14
  / i.fa.fa-columns.bolder
@@ -15,7 +15,8 @@
15
15
  | Chapter 1
16
16
  .field-remove-action
17
17
  - if @reflections.select {|x| x if x.name == assoc_name}.first.macro == :has_many
18
- = link_to_remove_association "", f, class: 'fa fa-trash ghost-btn accordion-delete-btn'
18
+ .accordion-delete-btn
19
+ = link_to_remove_association "", f, class: 'fa fa-trash btn-ghost'
19
20
  div.accordion-collapse.collapse.show[aria-labelledby="headingOne" id="#{assoc_name}-#{f.object.id}"]
20
21
  .accordion-body
21
22
  - fields.each do |field|
@@ -7,4 +7,4 @@
7
7
  = render partial: '/cm_admin/main/nested_fields', locals: { f: record, assoc_name: assoc_name, section: section }
8
8
  - if @reflections.select {|x| x if x.name == assoc_name}.first.macro == :has_many
9
9
  .links
10
- = link_to_add_association "+ Add #{assoc_name.to_s.titleize}", f, table_name, partial: '/cm_admin/main/nested_fields', render_options: {locals: { assoc_name: assoc_name, section: section }}, class: 'd-inline-block secondary-btn mt-2'
10
+ = link_to_add_association "+ Add #{assoc_name.to_s.titleize}", f, table_name, partial: '/cm_admin/main/nested_fields', render_options: {locals: { assoc_name: assoc_name, section: section }}, class: 'd-inline-block btn-secondary mt-2'
@@ -1,4 +1,4 @@
1
- ul.nav.nav-pills
1
+ ul.tabs
2
2
  - @model.available_tabs.each do |nav_item|
3
3
  - if nav_item.display_if.call(@ar_object)
4
4
  - if nav_item.custom_action.empty? || (nav_item.custom_action.present? && policy([:cm_admin, @model.name.classify.constantize]).send(:"#{nav_item.custom_action}?"))
@@ -1,33 +1,27 @@
1
- .cm-navbar
2
- .cm-navbar__lhs
1
+ .entity-header
2
+ .entity-header__info
3
3
  - if cm_admin.method_defined?(:"#{@model.name.underscore}_index_path") && (@model.current_action.name == 'show' || @model.current_action.layout_type.present?)
4
- .bread-crumb-area
5
- .breadcrumb-text
6
- = link_to "#{@model.name.titleize.pluralize} /", cm_admin.send(:"#{@model.name.underscore}_index_path")
7
- .nav-title-area
8
- p.title-text = action_title
9
- p.title-sub-text = action_description
10
- .cm-navbar__rhs
4
+ .breadcrumb
5
+ = link_to "#{@model.name.titleize.pluralize} /", cm_admin.send(:"#{@model.name.underscore}_index_path"), class: 'text-reset'
6
+ h4 = action_title
7
+ p.mb-0.text-body-secondary = action_description
8
+ .entity-header__actions
11
9
  - if @model.current_action.name == 'index'
12
10
  - if has_valid_policy(@model.name, :exportable)
13
11
  .export-container
14
12
  .dropdown
15
- button.secondary-btn data-bs-toggle='dropdown'
16
- span
13
+ button.btn-secondary.dropdown-toggle data-bs-toggle='dropdown'
17
14
  i.fa.fa-arrow-down
18
- span
19
15
  | Export
20
- span
21
- i.fa.fa-angle-down
22
16
  ul.dropdown-menu.export-popup
23
17
  li
24
18
  .popup-option.pointer data-bs-toggle='modal' data-bs-target='#exportmodal'
25
19
  span Export
26
20
  - if @model.importer && has_valid_policy(@model.name, :importable)
27
- = link_to 'Import', cm_admin.send(:"#{@model.name.underscore}_import_path"), class: 'primary-btn ml-2'
21
+ = link_to 'Import', cm_admin.send(:"#{@model.name.underscore}_import_path"), class: 'btn-primary ml-2'
28
22
  - new_action = @model.available_actions.select{|act| act if act.action_type.eql?(:default) && act.name.eql?('new')}
29
23
  - if new_action.any? && policy([:cm_admin, @model.name.classify.constantize]).new?
30
- = link_to 'Add', cm_admin.send(:"#{@model.name.underscore}_new_path"), class: 'primary-btn ml-2'
24
+ = link_to 'Add', cm_admin.send(:"#{@model.name.underscore}_new_path"), class: 'btn-primary ml-2'
31
25
  - @model.available_actions.select{|act| act if act.route_type == 'collection'}.each do |custom_action|
32
26
  = custom_action_items(custom_action, 'index')
33
27
  - elsif @model.current_action.name == 'show'
@@ -36,4 +30,4 @@
36
30
 
37
31
  - edit_action = @model.available_actions.select{|act| act if act.action_type.eql?(:default) && act.name.eql?('edit')}
38
32
  - if edit_action.any? && policy([:cm_admin, @model.name.classify.constantize]).edit?
39
- = link_to "Edit #{@model.name.titleize.pluralize}", cm_admin.send(:"#{@model.name.underscore}_edit_path", @ar_object), class: 'primary-btn ml-2'
33
+ = link_to "Edit #{@model.name.titleize.pluralize}", cm_admin.send(:"#{@model.name.underscore}_edit_path", @ar_object), class: 'btn-primary ml-2'
@@ -1,8 +1,7 @@
1
1
  .show-page.cm-page-container
2
- .show-page__tabs.sticky-container.page-top-bar
3
- .cm-tabs-bar
4
- == render 'cm_admin/main/top_navbar'
5
- == render 'cm_admin/main/tabs'
2
+ .show-page__header.sticky-container.page-top-bar
3
+ == render 'cm_admin/main/top_navbar'
4
+ == render 'cm_admin/main/tabs'
6
5
  .show-page__inner.scrollable
7
6
  .history-box
8
7
  - @ar_object.action_trails.each do |at|
@@ -12,7 +12,7 @@
12
12
  p.success-msg Your file has been uploaded and it will be processed soon.
13
13
  / p.success-msg-info An email will be sent once the process is completed. If there are any problems with the import, we'll let you know through an email.
14
14
  .actions-wrapper
15
- a.secondary-btn href="#{cm_admin.send(:"#{@model.name.underscore}_import_path")}" Import new data
15
+ a.btn-secondary href="#{cm_admin.send(:"#{@model.name.underscore}_import_path")}" Import new data
16
16
  / button.cta-btn.ml-2 Back to Page_Name
17
17
  - else
18
18
  = simple_form_for(FileImport.new, url: "/admin/#{@model.ar_model.table_name}/import", method: :post, html: { class: "csv-import-form" }) do |f|
@@ -32,4 +32,4 @@
32
32
  li Add your data on the file without changing the format
33
33
  li Save the file as a csv
34
34
  li Upload the file in the field above
35
- = f.button :submit, class: "cta-btn import-btn", value: 'Import data'
35
+ = f.button :submit, class: "btn-cta", value: 'Import data'
@@ -16,4 +16,4 @@
16
16
  - @ar_object.errors.full_messages.each do |error_message|
17
17
  li = error_message
18
18
 
19
- = generate_form(@ar_object.class.name.constantize.new, @model)
19
+ = generate_form(@ar_object, @model)
@@ -1,8 +1,7 @@
1
1
  .show-page.cm-page-container
2
- .show-page__tabs.sticky-container.page-top-bar
3
- .cm-tabs-bar
4
- == render 'cm_admin/main/top_navbar'
5
- == render 'cm_admin/main/tabs'
2
+ .show-page__header.sticky-container.page-top-bar
3
+ == render 'cm_admin/main/top_navbar'
4
+ == render 'cm_admin/main/tabs'
6
5
  .show-page__inner.scrollable
7
6
  - if @action.partial
8
7
  == render @action.partial
@@ -19,7 +19,7 @@
19
19
  span.move-arrow
20
20
  i.fa.fa-long-arrow-down
21
21
  span Select
22
- button.text-btn.enter-btn
22
+ p.enter-text
23
23
  | ENTER
24
- button.text-btn.open-btn
24
+ p.open-text
25
25
  | open
@@ -25,22 +25,20 @@ html
25
25
  .panel-area
26
26
  - if defined?(@action) && (@action&.layout_type.to_s == 'cm_association_show' || @action.parent == "show")
27
27
  .show-page.cm-page-container
28
- .show-page__tabs.sticky-container.page-top-bar
29
- .cm-tabs-bar
30
- == render 'cm_admin/main/top_navbar'
31
- == render 'cm_admin/main/tabs'
28
+ .show-page__header.sticky-container.page-top-bar
29
+ == render 'cm_admin/main/top_navbar'
30
+ == render 'cm_admin/main/tabs'
32
31
  .show-page__inner.scrollable
33
32
  = yield
34
33
  - elsif defined?(@action) && (@action&.layout_type.to_s == 'cm_association_index' || @action.parent == "index")
35
34
  .show-page.cm-page-container
36
- .show-page__tabs.sticky-container.page-top-bar
37
- .cm-tabs-bar
38
- == render 'cm_admin/main/top_navbar'
39
- - if @ar_object.model_name
40
- == render 'cm_admin/main/tabs'
41
- - if @associated_model && @associated_model.filters.present?
42
- .filters-bar
43
- == render partial: 'cm_admin/main/filters', locals: { filters: @associated_model.filters }
35
+ .show-page__header.sticky-container.page-top-bar
36
+ == render 'cm_admin/main/top_navbar'
37
+ - if @ar_object.model_name
38
+ == render 'cm_admin/main/tabs'
39
+ - if @associated_model && @associated_model.filters.present?
40
+ .filters-bar
41
+ == render partial: 'cm_admin/main/filters', locals: { filters: @associated_model.filters }
44
42
  = yield
45
43
  - else
46
44
  = yield
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '1.1.8'
2
+ VERSION = '1.1.9'
3
3
  end
@@ -94,7 +94,8 @@ module CmAdmin
94
94
  end
95
95
  concat split_form_into_section(resource, form_obj, sections_array)
96
96
  concat tag.br
97
- concat form_obj.submit 'Save', class: 'cta-btn mt-3 form_submit', data: {form_class: "cm_#{form_obj.object.class.name.downcase}_form"}
97
+ # TODO: form_submit class is used for JS functionality, Have to remove
98
+ concat form_obj.submit 'Save', class: 'btn-cta mt-3 form_submit', data: {form_class: "cm_#{form_obj.object.class.name.downcase}_form"}
98
99
  end
99
100
  end
100
101
  end
@@ -65,8 +65,8 @@ module CmAdmin
65
65
 
66
66
  def manage_column_footer
67
67
  concat(content_tag(:div, class: 'modal-footer') do
68
- concat tag.button 'Close', class: 'gray-border-btn', data: {bs_dismiss: 'modal'}
69
- concat tag.button 'Save', class: 'cta-btn'
68
+ concat tag.button 'Close', class: 'btn-secondary', data: {bs_dismiss: 'modal'}
69
+ concat tag.button 'Save', class: 'btn-cta'
70
70
  end)
71
71
  return
72
72
  end
@@ -67,7 +67,7 @@ module CmAdmin
67
67
  when :modal
68
68
  custom_modal_button(custom_action)
69
69
  when :page
70
- link_to custom_action_title(custom_action), "#{@model.ar_model.table_name}/#{custom_action.path}", class: 'secondary-btn ml-2', method: custom_action.verb
70
+ link_to custom_action_title(custom_action), "#{@model.ar_model.table_name}/#{custom_action.path}", class: 'btn-secondary ml-2', method: custom_action.verb
71
71
  end
72
72
  end
73
73
  end
@@ -83,14 +83,14 @@ module CmAdmin
83
83
 
84
84
  def custom_action_button(custom_action, current_action_name)
85
85
  if current_action_name == "index"
86
- button_to custom_action_title(custom_action), @model.ar_model.table_name + '/' + custom_action.path, class: 'secondary-btn ml-2', method: custom_action.verb
86
+ button_to custom_action_title(custom_action), @model.ar_model.table_name + '/' + custom_action.path, class: 'btn-secondary ml-2', method: custom_action.verb
87
87
  elsif current_action_name == "show"
88
- button_to custom_action_title(custom_action), custom_action.path.gsub(':id', params[:id]), class: 'secondary-btn ml-2', method: custom_action.verb
88
+ button_to custom_action_title(custom_action), custom_action.path.gsub(':id', params[:id]), class: 'btn-secondary ml-2', method: custom_action.verb
89
89
  end
90
90
  end
91
91
 
92
92
  def custom_modal_button(custom_action)
93
- link_to custom_action_title(custom_action), '', class: 'secondary-btn ml-2', data: { bs_toggle: "modal", bs_target: "##{custom_action.name.classify}Modal" }
93
+ link_to custom_action_title(custom_action), '', class: 'btn-secondary ml-2', data: { bs_toggle: "modal", bs_target: "##{custom_action.name.classify}Modal" }
94
94
  end
95
95
 
96
96
  def custom_action_title(custom_action)
@@ -53,7 +53,8 @@ module CmAdmin
53
53
  concat hidden_field_tag 'class_name', klass.name.to_s, id: 'export-to-file-klass'
54
54
  concat checkbox_row(klass)
55
55
  concat tag.hr
56
- concat submit_tag 'Export', class: 'btn btn-primary btn-bordered export-to-file-btn'
56
+ # TODO: export-to-file-btn class is used for JS functionality, Have to remove
57
+ concat submit_tag 'Export', class: 'btn-primary export-to-file-btn'
57
58
  end
58
59
  end
59
60
  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.1.8
4
+ version: 1.1.9
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: 2023-08-11 00:00:00.000000000 Z
13
+ date: 2023-08-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -172,6 +172,7 @@ files:
172
172
  - ".rubocop.yml"
173
173
  - ".stylelintrc.json"
174
174
  - ".travis.yml"
175
+ - ".vscode/settings.json"
175
176
  - CODE_OF_CONDUCT.md
176
177
  - Gemfile
177
178
  - Gemfile.lock