Sha256: 43b44803317539e324e524437dc8823d128d4e86f971f9ebc83fb894bb84a692

Contents?: true

Size: 1.76 KB

Versions: 19

Compression:

Stored size: 1.76 KB

Contents

module Leather
  module LeatherHelpers
    def modal_toggle(text, id = 'modal', html_options = {})
      link_to text, "##{id}", data: { toggle: "modal" }, class: html_options[:class]
    end

    def modal(id = 'modal', html_options = {}, &block)
      render partial: 'leather/modal', locals: { id: id, block: capture(&block), html_options: html_options }
    end

    def modal_header(title = '', &block)
      render partial: 'leather/modal_header', locals: { title: title }
    end

    def modal_body(&block)
      render partial: 'leather/modal_body', locals: { block: capture(&block) }
    end

    def modal_footer(&block)
      render partial: 'leather/modal_footer', locals: { block: capture(&block) }
    end

    def navbar(title, brand_link, html_options = {}, &block)
      html_options = { class: "navbar-default" }.merge(html_options)
      render partial: 'leather/navbar', locals: { title: title, brand_link: brand_link, block: capture(&block), html_options: html_options }
    end

    def navbar_with_container(html_options = {}, &block)
      html_options[:container_mode] = :with
      navbar(html_options, &block)
    end

    def navbar_in_container(html_options = {}, &block)
      html_options[:container_mode] = :in
      navbar(html_options, &block)
    end

    def nav_list(html_options = {}, &block)
      render partial: 'leather/nav_list', locals: { block: capture(&block), html_options: html_options }
    end

    def nav_item(text, href, options = {})
      render partial: 'leather/nav_item', locals: { text: text, href: href, options: options }
    end

    def dropdown_nav_item(text, href, options = {}, &block)
      render partial: 'leather/dropdown_nav_item', locals: { block: capture(&block), text: text, href: href, options: options }
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
leather-0.2.22 lib/leather/leather_helpers.rb
leather-0.2.21 lib/leather/leather_helpers.rb
leather-0.2.20 lib/leather/leather_helpers.rb
leather-0.2.19 lib/leather/leather_helpers.rb
leather-0.2.18 lib/leather/leather_helpers.rb
leather-0.2.17 lib/leather/leather_helpers.rb
leather-0.2.16 lib/leather/leather_helpers.rb
leather-0.2.15 lib/leather/leather_helpers.rb
leather-0.2.14 lib/leather/leather_helpers.rb
leather-0.2.13 lib/leather/leather_helpers.rb
leather-0.2.12 lib/leather/leather_helpers.rb
leather-0.2.11 lib/leather/leather_helpers.rb
leather-0.2.10 lib/leather/leather_helpers.rb
leather-0.2.9 lib/leather/leather_helpers.rb
leather-0.2.8 lib/leather/leather_helpers.rb
leather-0.2.7 lib/leather/leather_helpers.rb
leather-0.2.6 lib/leather/leather_helpers.rb
leather-0.2.5 lib/leather/leather_helpers.rb
leather-0.2.4 lib/leather/leather_helpers.rb