iquest-simple_table 0.3.0 → 0.3.1
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/lib/iquest/simple_table/table_builder.rb +10 -8
- data/lib/iquest/simple_table/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f98602aed6cd5980db8ed1d92b50a7fbb7994894
         | 
| 4 | 
            +
              data.tar.gz: 34531ff1eeccb26163a9f6a17aae49e693bbefb4
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f7d25fe0f1d94a2840908281aae021824d73825aebe88b181fc259586973a0736c4f2f66cb24ce2157b358b727e34a4ee078888b08965202ffa0e9a1caa5f2f0
         | 
| 7 | 
            +
              data.tar.gz: 2b7e1168d26d268ea6e81e8ad5b46244ae62e0384b12921aea95a82d35638ff21737a2f49ced47d388404fb21e02b6b43fa6c0d313edeb0311e4a210183ab5c3
         | 
| @@ -7,7 +7,7 @@ module Iquest | |
| 7 7 | 
             
                  delegate :capture, :content_tag, :link_to, :paginate, :page_entries_info, :params, to: :parent
         | 
| 8 8 | 
             
                  delegate :sort_link, :search_form_for, to: :parent
         | 
| 9 9 | 
             
                  delegate :polymorphic_path, :polymorphic_url, to: :parent
         | 
| 10 | 
            -
                  delegate :l, :t, to: :parent
         | 
| 10 | 
            +
                  delegate :l, :t, :dom_id, to: :parent
         | 
| 11 11 |  | 
| 12 12 | 
             
                  def initialize(parent, collection_or_search, options = {})
         | 
| 13 13 | 
             
                    @parent = parent
         | 
| @@ -34,7 +34,7 @@ module Iquest | |
| 34 34 | 
             
                    @collection = @collection.decorate if @collection.respond_to?(:decorate)
         | 
| 35 35 | 
             
                    options[:search_url] ||= polymorphic_path(@klass) rescue NoMethodError        
         | 
| 36 36 | 
             
                    @options = options
         | 
| 37 | 
            -
                    @table_id = "table_#{ | 
| 37 | 
            +
                    @table_id = "table_#{@klass}".pluralize.parameterize
         | 
| 38 38 | 
             
                    @columns = {}.with_indifferent_access
         | 
| 39 39 | 
             
                    @actions = []
         | 
| 40 40 | 
             
                    @collection_actions = []
         | 
| @@ -104,8 +104,8 @@ module Iquest | |
| 104 104 | 
             
                  end
         | 
| 105 105 |  | 
| 106 106 | 
             
                  private
         | 
| 107 | 
            -
                  def render_table_without_search
         | 
| 108 | 
            -
                    table = content_tag :table, class: @options[:html][:class] << %w(table table-hover table-striped) do
         | 
| 107 | 
            +
                  def render_table_without_search        
         | 
| 108 | 
            +
                    table = content_tag :table, id: @table_id, class: @options[:html][:class] << %w(table table-hover table-striped) do
         | 
| 109 109 | 
             
                      render_table_header + render_table_body + render_table_footer
         | 
| 110 110 | 
             
                    end
         | 
| 111 111 |  | 
| @@ -194,7 +194,8 @@ module Iquest | |
| 194 194 | 
             
                  end
         | 
| 195 195 |  | 
| 196 196 | 
             
                  def render_table_row(item)
         | 
| 197 | 
            -
                     | 
| 197 | 
            +
                    row_id = "row_#{dom_id(item)}" rescue nil
         | 
| 198 | 
            +
                    content_tag :tr, id: row_id do
         | 
| 198 199 | 
             
                      rendered_columns = columns.map do |col|
         | 
| 199 200 | 
             
                        render_value_cell(col, item)
         | 
| 200 201 | 
             
                      end.join.html_safe
         | 
| @@ -231,9 +232,10 @@ module Iquest | |
| 231 232 | 
             
                    value = get_value(attr, obj)
         | 
| 232 233 | 
             
                    formatter = options[:formatter]
         | 
| 233 234 | 
             
                    cell_value = render_value(obj, value, &formatter)
         | 
| 234 | 
            -
                     | 
| 235 | 
            -
                     | 
| 236 | 
            -
                     | 
| 235 | 
            +
                    cell_classes = []
         | 
| 236 | 
            +
                    cell_classes << "rowlink-skip" if include_link?(cell_value)
         | 
| 237 | 
            +
                    cell_classes << "#{options[:class]}"
         | 
| 238 | 
            +
                    content_tag :td, class: cell_classes.join(' ') do
         | 
| 237 239 | 
             
                      cell_value
         | 
| 238 240 | 
             
                    end
         | 
| 239 241 | 
             
                  end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: iquest-simple_table
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.3. | 
| 4 | 
            +
              version: 0.3.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Pavel Dusanek
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014-10- | 
| 11 | 
            +
            date: 2014-10-29 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: ransack_simple_form
         |