Sha256: 2367d2672a4eaa70a862db9a20b8fdbfdb16e65568e1cbe3edbbd6234b1a7fab

Contents?: true

Size: 583 Bytes

Versions: 10

Compression:

Stored size: 583 Bytes

Contents

module Georgia
  class Portlet < Presenter

    attr_reader :portlet

    def initialize view_context, portlet, args={}
      @portlet = portlet
      super
    end

    def id
      @id ||= @portlet.persisted? ? @portlet.id : rand(10 ** 8)
    end

    def portlet_tag content, options={}
      content_tag :li, content, options.reverse_merge(class: 'portlet', id: dom_id(portlet), data: {portlet: id})
    end

    def handle_tag
      content_tag(:span, icon_tag('ellipsis-v'), class: 'handle')
    end

    private

    def persisted?
      @portlet.persisted?
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
georgia-0.8.0 app/presenters/georgia/portlet.rb
georgia-0.7.8 app/presenters/georgia/portlet.rb
georgia-0.7.7 app/presenters/georgia/portlet.rb
georgia-0.7.6 app/presenters/georgia/portlet.rb
georgia-0.7.5 app/presenters/georgia/portlet.rb
georgia-0.7.4 app/presenters/georgia/portlet.rb
georgia-0.7.3 app/presenters/georgia/portlet.rb
georgia-0.7.2 app/presenters/georgia/portlet.rb
georgia-0.7.1 app/presenters/georgia/portlet.rb
georgia-0.7.0 app/presenters/georgia/portlet.rb