From cd6620164a3b81206a6a10fd0a6a55ef472b286f Mon Sep 17 00:00:00 2001 From: Isaac Massot Date: Thu, 26 Sep 2019 10:07:23 +0200 Subject: [PATCH] add class to td and upgrade version for a new release (#21) * add class to td and upgrade version for a new release * apply requested changes and doc * add custom class to actions --- CHANGELOG.md | 8 ++++++-- README.md | 1 + app/helpers/ct_table_for/application_helper.rb | 4 ++-- docs/index.md | 1 + lib/ct_table_for/engine.rb | 2 ++ lib/ct_table_for/version.rb | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c55629d..641d277 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ # Changelog -## version 1.0.4 to be released +## version 1.0.5 to be released - ... -## version 1.0.3 to +## version 1.0.4 + +- add class to td, for custom styles + +## version 1.0.3 - fix allow currency and sortable attributes work together - fix display format of data time diff --git a/README.md b/README.md index 34288d5..25320fe 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ CtTableFor.setup do |config| config.table_for_truncate_length = 50 config.table_for_truncate_separator = " " config.table_for_truncate_omission = "..." + config.table_for_td_default_prefix_class = "td-item" end ``` You can also define the breakpoint in your `sass` before importing `table_for`: diff --git a/app/helpers/ct_table_for/application_helper.rb b/app/helpers/ct_table_for/application_helper.rb index 6926702..c9dba1d 100644 --- a/app/helpers/ct_table_for/application_helper.rb +++ b/app/helpers/ct_table_for/application_helper.rb @@ -110,7 +110,7 @@ def table_for_cell model, record, attribute, cell_options: {} nil end - html << %Q{} + html << %Q{} case value when NilClass html << %Q{} @@ -179,7 +179,7 @@ def table_for_cell_for_locale model, attribute, value, cell_options: {} def table_for_actions(record, options: {} ) return "" if options[:actions].blank? html = "" - html << %Q{} + html << %Q{} html << %Q{
} nesting = (options[:actions][:premodel] || []) + [record] buttons = options[:actions][:buttons].map{ |b| b.split("|")} diff --git a/docs/index.md b/docs/index.md index 6d42bb5..81b7283 100644 --- a/docs/index.md +++ b/docs/index.md @@ -86,6 +86,7 @@ CtTableFor.setup do |config| config.table_for_truncate_length = 50 config.table_for_truncate_separator = " " config.table_for_truncate_omission = "..." + config.table_for_td_default_prefix_class = "td-item" end ``` You can also define the breakpoint in your `sass` before importing `table_for`: diff --git a/lib/ct_table_for/engine.rb b/lib/ct_table_for/engine.rb index eebf94e..f97e417 100644 --- a/lib/ct_table_for/engine.rb +++ b/lib/ct_table_for/engine.rb @@ -12,6 +12,7 @@ class << self mattr_accessor :table_for_truncate_length mattr_accessor :table_for_truncate_separator mattr_accessor :table_for_truncate_omission + mattr_accessor :table_for_td_default_prefix_class self.table_for_wrapper_default_class = "table-responsive" self.table_for_default_class = "table table-striped table-bordered table-condensed table-hover" @@ -25,6 +26,7 @@ class << self self.table_for_truncate_length = 50 self.table_for_truncate_separator = " " self.table_for_truncate_omission = "..." + self.table_for_td_default_prefix_class = "td-item" end # this function maps the vars from your app into your engine diff --git a/lib/ct_table_for/version.rb b/lib/ct_table_for/version.rb index 6e5a42e..007aa2f 100644 --- a/lib/ct_table_for/version.rb +++ b/lib/ct_table_for/version.rb @@ -1,3 +1,3 @@ module CtTableFor - VERSION = '1.0.3' + VERSION = '1.0.4' end