cm-admin 2.2.0 → 2.2.1

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: ab22f4bef2b77930d17a0910dbc5ee20f0773f9f025d7e7ba7fde8a55be7e5f8
4
- data.tar.gz: ba334104c29113fbec5440dbe31b13b8fb8513efd6a8be7308928815141256a0
3
+ metadata.gz: 1ececfae1032574362b71ffb26c47007efbfaefc7ebda5aa82cf99786146f99d
4
+ data.tar.gz: 1f3f944038ea3f1102656e9ffeaf3a22c587de8ae7d7b433e397d48d3b1fe5d3
5
5
  SHA512:
6
- metadata.gz: 67c7bf36f684d04d976fbad85a58f5910a84762f2e750918b3ab2eef6b7c9b4471bb9ff6f8b1594bb8dc7f3bf9910cf6b4560d9e80ad8ae24d6a8b56321901ae
7
- data.tar.gz: 47b9d696e72e73ef748ffc51301891dc2fa3667f3f201ec61643167d13b286d0dc289ec7ddd4a867700c93a1b23bdbb5395b747d82e7fc71e00c39fc42e77e44
6
+ metadata.gz: c3426a35c54e2b0eac13b6e7b05b3056fac953c2e21b44731d77482aa5d23a6642d78da984c16d17275ca815dfa97548f71a4f485dbca4b827ad9ac5eb376444
7
+ data.tar.gz: 0f863ebd46889e605972b226f1e2b20327cd79b855bd46b800168a60bc611661ed44a12335099f18797d329096b5dd8cf5117f526fec4643c2583fda0cd61d58
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cm-admin (2.2.0)
4
+ cm-admin (2.2.1)
5
5
  caxlsx_rails
6
6
  cocoon (~> 1.2.15)
7
7
  csv-importer (~> 0.8.2)
@@ -1,7 +1,7 @@
1
1
  // Card view right now is application specific, so card partial will be overwritten in the application
2
2
 
3
3
  .table-top
4
- p.table-top__total-count = "#{humanized_ar_collection_count(@ar_object.pagy.count, @model.table_name)}"
4
+ p.table-top__total-count = "#{humanized_ar_collection_count(@ar_object.pagy.count, @model.formatted_name)}"
5
5
  .table-top__column-action
6
6
  .btn-group[role="group" aria-label="Basic example"]
7
7
  a.btn.btn-ghost href="#{cm_admin.send("#{@model.name.underscore}_index_path")}?page=#{params[:page] || 1}"
@@ -68,4 +68,4 @@
68
68
  p.count-text.m-0 Showing #{@ar_object.pagy.from} to #{@ar_object.pagy.to} out of #{@ar_object.pagy.count}
69
69
  == render partial: 'cm_admin/main/cm_pagy_nav', locals: { pagy: @ar_object.pagy }
70
70
 
71
- / = render partial: 'cm_admin/main/member_custom_action_modal', locals: { cm_model: @model, ar_collection: @ar_object }
71
+ / = render partial: 'cm_admin/main/member_custom_action_modal', locals: { cm_model: @model, ar_collection: @ar_object }
@@ -1,5 +1,5 @@
1
1
  .table-top
2
- p.table-top__total-count = "#{humanized_ar_collection_count(@ar_object.pagy.count, @model.table_name)}"
2
+ p.table-top__total-count = "#{humanized_ar_collection_count(@ar_object.pagy.count, @model.formatted_name)}"
3
3
  .table-top__column-action
4
4
  - if @current_action.view_type == :card_view
5
5
  .btn-group[role="group" aria-label="Card Toggle"]
@@ -55,4 +55,4 @@
55
55
  p.count-text.m-0 Showing #{@ar_object.pagy.from} to #{@ar_object.pagy.to} out of #{@ar_object.pagy.count}
56
56
  == render partial: 'cm_admin/main/cm_pagy_nav', locals: { pagy: @ar_object.pagy }
57
57
 
58
- / = render partial: 'cm_admin/main/member_custom_action_modal', locals: { cm_model: @model, ar_collection: @ar_object }
58
+ / = render partial: 'cm_admin/main/member_custom_action_modal', locals: { cm_model: @model, ar_collection: @ar_object }
@@ -121,8 +121,8 @@ module CmAdmin
121
121
  @additional_permitted_fields = fields
122
122
  end
123
123
 
124
- def table_name
125
- @display_name.present? ? @display_name : @ar_model.table_name
124
+ def formatted_name
125
+ @display_name != @name ? @display_name : @ar_model.table_name
126
126
  end
127
127
 
128
128
  def alert_box(options = {})
@@ -378,12 +378,15 @@ module CmAdmin
378
378
  end
379
379
 
380
380
  # Configure sortable columns for model
381
+ # @note default sort direction will be ascending
381
382
  # @param columns [Array] the array of hash for column and display name
382
383
  # @example Sortable Columns
383
- # sortable_columns([{column: 'id', display_name: 'ID'}, {column: 'updated_at', display_name: 'Last Updated At'}])
384
+ # sortable_columns([{column: 'id', display_name: 'ID'},
385
+ # {column: 'updated_at', display_name: 'Last Updated At'}])
384
386
  #
385
387
  # @example Sortable Columns with default column and direction
386
- # sortable_columns([{column: 'id', display_name: 'ID', default: true, default_direction: 'desc'}, {column: 'updated_at', display_name: 'Last Updated At'}])
388
+ # sortable_columns([{column: 'id', display_name: 'ID', default: true, default_direction: 'desc'},
389
+ # {column: 'updated_at', display_name: 'Last Updated At'}])
387
390
  def sortable_columns(columns)
388
391
  @sort_columns = columns
389
392
  default_column = columns.filter do |column|
@@ -1,3 +1,3 @@
1
1
  module CmAdmin
2
- VERSION = '2.2.0'
2
+ VERSION = '2.2.1'
3
3
  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: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: exe
16
16
  cert_chain: []
17
- date: 2024-10-01 00:00:00.000000000 Z
17
+ date: 2024-10-03 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: caxlsx_rails