Sha256: eb87e571ced39c5fce85f2f7969a3f8220ddee6d206a01cb860b2b752dc03e1c

Contents?: true

Size: 778 Bytes

Versions: 13

Compression:

Stored size: 778 Bytes

Contents

# This handy simplification is adapted from SphinxSearch (thanks)
# and originally came from Ultrasphinx
# it saves us a lot of including and bodging to make will_paginate's template calls work in the Page model

module Library
  class LinkRenderer < WillPaginate::LinkRenderer
    def initialize(tag)
      @tag = tag
    end
  
    def page_link(page, text, attributes = {})
      linkclass = %{ class="#{attributes[:class]}"} if attributes[:class]
      linkrel = %{ rel="#{attributes[:rel]}"} if attributes[:rel]
      %Q{<a href="#{@tag.locals.page.url}?page=#{page}"#{linkrel}#{linkclass}>#{text}</a>}
    end

    def page_span(page, text, attributes = {})
      spanclass = attributes[:class]
      %{<span class="#{attributes[:class]}">#{text}</span>}
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
radiant-taggable-extension-2.0.5 lib/link_renderer.rb
radiant-taggable-extension-2.0.4 lib/link_renderer.rb
radiant-taggable-extension-2.0.3 lib/link_renderer.rb
radiant-taggable-extension-2.0.2 lib/link_renderer.rb
radiant-taggable-extension-2.0.1 lib/link_renderer.rb
radiant-taggable-extension-2.0.0 lib/link_renderer.rb
radiant-taggable-extension-2.0.0.rc2 lib/link_renderer.rb
radiant-taggable-extension-2.0.0.rc1 lib/link_renderer.rb
radiant-library-extension-2.1.1 lib/library/link_renderer.rb
radiant-library-extension-2.1.0 lib/library/link_renderer.rb
radiant-library-extension-2.0.3 lib/library/link_renderer.rb
radiant-library-extension-2.0.1 lib/library/link_renderer.rb
radiant-library-extension-2.0.0 lib/library/link_renderer.rb