Sha256: a31d853a88bca51190fec19dca731357151d42d22bc0d8293c1041a5333d52c3

Contents?: true

Size: 800 Bytes

Versions: 16

Compression:

Stored size: 800 Bytes

Contents

class CmsPagePresenter < BasePresenter

  presents :cms_page

  #------------------------------------------------------------------------------
  def label_published
    cms_page.is_published? ? h.colored_label('Published', :success) : h.colored_label('Draft')
  end
  
  # Prepare a title for admin Page views.  page/menu title with slug in <small>
  #------------------------------------------------------------------------------
  def admin_edit_title
    main_title  = (cms_page.title.present? ? cms_page.title : (cms_page.menutitle.present? ? cms_page.menutitle : '(no title)'))
    sub_title   = cms_page.slug

    #--- make sure it's built safely...
    html = "".html_safe
    html << main_title
    html << "<small>".html_safe
    html << sub_title
    html << "</small>".html_safe
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
dm_cms-4.2.3.10 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.9 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.8 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.7 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.6 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.5 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.4 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.3 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.2 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3.1 app/presenters/cms_page_presenter.rb
dm_cms-4.2.3 app/presenters/cms_page_presenter.rb
dm_cms-4.2.2.3 app/presenters/cms_page_presenter.rb
dm_cms-4.2.2.2 app/presenters/cms_page_presenter.rb
dm_cms-4.2.2.1 app/presenters/cms_page_presenter.rb
dm_cms-4.2.2 app/presenters/cms_page_presenter.rb
dm_cms-4.2.1.5 app/presenters/cms_page_presenter.rb