Sha256: 3b37baafa9935e80c6676d725e3bb05ac22f0004f18f29fc2d8f4a3cdc674eb8

Contents?: true

Size: 742 Bytes

Versions: 10

Compression:

Stored size: 742 Bytes

Contents

module Georgia
  class SubpagePortlet < Portlet

    delegate :position, :title, :url, to: :portlet

    def to_s
      output = ActiveSupport::SafeBuffer.new
      output << handle_tag
      output << position_input_tag
      output << title_tag
      output << actions_tag
      portlet_tag(output)
    end

    private

    def position_input_tag
      hidden_field_tag("page_tree[#{id}][position]", position, class: 'js-position')
    end

    def title_tag
      content_tag(:h4, (title + url_tag).html_safe, class: 'title')
    end

    def url_tag
      content_tag(:small, url)
    end

    def actions_tag
      content_tag(:div, class: 'actions') do
        link_to(icon_tag('pencil'), [:edit, portlet])
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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