Sha256: ea93676f1dceb14b5bf3cce93becb9d6cde446f09c9692f8a3f577160405fa24

Contents?: true

Size: 711 Bytes

Versions: 10

Compression:

Stored size: 711 Bytes

Contents

module Georgia
  class PageDecorator < Georgia::ApplicationDecorator
    decorates_association :current_revision

    delegate :excerpt_or_text, :meta_description, to: :current_revision

    def template_path
      "pages/templates/#{current_revision.template}"
    end

    def state_icon
      if public?
        h.icon_tag('icon-ok icon-success')
      else
        h.icon_tag('icon-remove icon-failure')
      end
    end

    def status_tag(options={})
      options[:class] ||= ''
      options[:class] << ' label'
      options[:class] << " label-#{public? ? 'success' : 'warning'}"
      h.content_tag(:span, state, options)
    end

    def state
      public? ? 'public' : 'private'
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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