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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/views/cm_admin/main/_card.html.slim +2 -2
- data/app/views/cm_admin/main/_table.html.slim +2 -2
- data/lib/cm_admin/model.rb +2 -2
- data/lib/cm_admin/models/dsl_method.rb +5 -2
- data/lib/cm_admin/version.rb +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: 1ececfae1032574362b71ffb26c47007efbfaefc7ebda5aa82cf99786146f99d
|
4
|
+
data.tar.gz: 1f3f944038ea3f1102656e9ffeaf3a22c587de8ae7d7b433e397d48d3b1fe5d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3426a35c54e2b0eac13b6e7b05b3056fac953c2e21b44731d77482aa5d23a6642d78da984c16d17275ca815dfa97548f71a4f485dbca4b827ad9ac5eb376444
|
7
|
+
data.tar.gz: 0f863ebd46889e605972b226f1e2b20327cd79b855bd46b800168a60bc611661ed44a12335099f18797d329096b5dd8cf5117f526fec4643c2583fda0cd61d58
|
data/Gemfile.lock
CHANGED
@@ -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.
|
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.
|
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 }
|
data/lib/cm_admin/model.rb
CHANGED
@@ -121,8 +121,8 @@ module CmAdmin
|
|
121
121
|
@additional_permitted_fields = fields
|
122
122
|
end
|
123
123
|
|
124
|
-
def
|
125
|
-
@display_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'},
|
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'},
|
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|
|
data/lib/cm_admin/version.rb
CHANGED
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.
|
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-
|
17
|
+
date: 2024-10-03 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: caxlsx_rails
|