rails-theme-helper 0.1.0 → 0.1.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/app/controllers/concerns/rails_theme/pagination.rb +28 -0
- data/app/helpers/rails_theme/layout_helper.rb +1 -1
- data/app/views/application/_pagination.html.erb +2 -1
- data/lib/rails-theme-helper/version.rb +1 -1
- data/lib/rails_theme/bootstrap/link_renderer.rb +5 -5
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: a9aff299414baf2daf57cb77406923e59f793b0c
         | 
| 4 | 
            +
              data.tar.gz: e6d6944dc95607c5e1ddc724a2ecc65ab669e28e
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 71164e1849d575f1e22531db1e6f18644756f245ee77a3e4aa8ef7311971862efd1a223476db4a76a0d201c6e758845fb69910483e38df99fd8525dabc052b84
         | 
| 7 | 
            +
              data.tar.gz: 4ed526d34197635375ccd6cca66451622b12bf65be68fdfd6c996dcf46f586c386104a3315df01ab1807a4ad72598b300ed8990c3bac4b03c612fb018b87105b
         | 
| @@ -0,0 +1,28 @@ | |
| 1 | 
            +
            require 'active_support/concern'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module RailsTheme
         | 
| 4 | 
            +
              module Pagination
         | 
| 5 | 
            +
                extend ActiveSupport::Concern
         | 
| 6 | 
            +
                included do
         | 
| 7 | 
            +
                  before_action :clear_pagination_options
         | 
| 8 | 
            +
                end
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                module ClassMethods
         | 
| 11 | 
            +
                end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                protected
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                def clear_pagination_options
         | 
| 16 | 
            +
                  RailsTheme::Bootstrap::LinkRenderer.link_options = nil
         | 
| 17 | 
            +
                end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
                def set_ajax_tab_pagination_render_options tab_name
         | 
| 20 | 
            +
                  RailsTheme::Bootstrap::LinkRenderer.link_options = {
         | 
| 21 | 
            +
                    'data-remote' => true,
         | 
| 22 | 
            +
                    'data-type' => :html,
         | 
| 23 | 
            +
                    'data-toggle' => 'tab',
         | 
| 24 | 
            +
                    'data-target' => "##{tab_name}"
         | 
| 25 | 
            +
                  }
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
              end
         | 
| 28 | 
            +
            end
         | 
| @@ -30,7 +30,7 @@ module RailsTheme | |
| 30 30 | 
             
                  protected
         | 
| 31 31 |  | 
| 32 32 | 
             
                  def html_container(html)
         | 
| 33 | 
            -
                    tag : | 
| 33 | 
            +
                    tag :ul, html, container_attributes
         | 
| 34 34 | 
             
                  end
         | 
| 35 35 |  | 
| 36 36 | 
             
                  def page_number(page)
         | 
| @@ -39,12 +39,12 @@ module RailsTheme | |
| 39 39 | 
             
                    unless page == current_page
         | 
| 40 40 | 
             
                      tag :li, link(page, page, options)
         | 
| 41 41 | 
             
                    else
         | 
| 42 | 
            -
                      tag :li, link(page,  | 
| 42 | 
            +
                      tag :li, link(page, nil, {}), class: 'active'
         | 
| 43 43 | 
             
                    end
         | 
| 44 44 | 
             
                  end
         | 
| 45 45 |  | 
| 46 46 | 
             
                  def gap
         | 
| 47 | 
            -
                    tag :li, link(super,  | 
| 47 | 
            +
                    tag :li, link(super, nil), class: 'disabled'
         | 
| 48 48 | 
             
                  end
         | 
| 49 49 |  | 
| 50 50 | 
             
                  def previous_or_next_page(page, text, class_name)
         | 
| @@ -55,9 +55,9 @@ module RailsTheme | |
| 55 55 | 
             
                    if page
         | 
| 56 56 | 
             
                      tag :li, link(text, page, options), class: class_name
         | 
| 57 57 | 
             
                    else
         | 
| 58 | 
            -
                      tag :li, link(text,  | 
| 58 | 
            +
                      tag :li, link(text, nil, {}), class: class_name + ' disabled'
         | 
| 59 59 | 
             
                    end
         | 
| 60 60 | 
             
                  end
         | 
| 61 | 
            -
                end | 
| 61 | 
            +
                end
         | 
| 62 62 | 
             
              end
         | 
| 63 63 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rails-theme-helper
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tse-Ching Ho
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014- | 
| 11 | 
            +
            date: 2014-05-07 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: railties
         | 
| @@ -65,6 +65,7 @@ files: | |
| 65 65 | 
             
            - README.md
         | 
| 66 66 | 
             
            - Rakefile
         | 
| 67 67 | 
             
            - app/assets/stylesheets/rails_theme/simple_layout.css.sass
         | 
| 68 | 
            +
            - app/controllers/concerns/rails_theme/pagination.rb
         | 
| 68 69 | 
             
            - app/helpers/rails_theme/bootstrap/button_helper.rb
         | 
| 69 70 | 
             
            - app/helpers/rails_theme/bootstrap/dropdown_helper.rb
         | 
| 70 71 | 
             
            - app/helpers/rails_theme/bootstrap/form_helper.rb
         |