Sha256: f9e9e59c3f427c2982a4c4afd5f7319200ec3e6b68e7361b55bcf7c6b09a222a

Contents?: true

Size: 1.5 KB

Versions: 6

Compression:

Stored size: 1.5 KB

Contents

module UiBibz::Ui::Core::Navs

  # Create a PageLink
  #
  # This element is an extend of UiBibz::Ui::Core::Navs::Component.
  #
  # ==== Attributes
  #
  # * +content+ - Content of element
  # * +options+ - Options of element
  # * +html_options+ - Html Options of element
  #
  # ==== Options
  #
  # You can add HTML attributes using the +html_options+.
  # You can pass arguments in options attribute:
  # * +state+ - status of élement with symbol value:
  #   (+:active+)
  # * +url+ - String
  # * +badge+ - String
  # * +link_html_options+ - Hash
  #
  # ==== Signatures
  #
  #   UiBibz::Ui::Core::Navs::PageLink.new(content, options = nil, html_options = nil)
  #
  #   UiBibz::Ui::Core::Navs::PageLink.new(options = nil, html_options = nil) do
  #     content
  #   end
  #
  # ==== Examples
  #
  #   UiBibz::Ui::Core::Navs::PageLink.new(content, { badge: 15, url: '/', state: :active, link_html_options: { class: 'link1' }},{ class: 'test' }).render
  #
  #   UiBibz::Ui::Core::Navs::PageLink.new({glyph: { name: 'eye', size: 3 }, { class: 'test' }) do
  #     'Home'
  #   end.render
  #
  class PaginationLink < UiBibz::Ui::Core::Component

    # See UiBibz::Ui::Core::Component.initialize
    def initialize content = nil, options = nil, html_options = nil, &block
      super
    end

    # Render html tag
    def render
      content_tag :li, html_options do
        link_to content, options[:url], class: 'page-link'
      end
    end

    private

    def component_html_classes
      "page-item"
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ui_bibz-2.0.0.beta2.5 lib/ui_bibz/ui/core/navs/components/pagination_link.rb
ui_bibz-2.0.0.beta2.4 lib/ui_bibz/ui/core/navs/components/pagination_link.rb
ui_bibz-2.0.0.beta2.3 lib/ui_bibz/ui/core/navs/components/pagination_link.rb
ui_bibz-2.0.0.beta2.2 lib/ui_bibz/ui/core/navs/components/pagination_link.rb
ui_bibz-2.0.0.beta2.1 lib/ui_bibz/ui/core/navs/components/pagination_link.rb
ui_bibz-2.0.0.beta2 lib/ui_bibz/ui/core/navs/components/pagination_link.rb