Sha256: 3a7726ca53b8cb967a8feb0bf997098fe31e67bcd761519af558077c6307c616

Contents?: true

Size: 1.08 KB

Versions: 7

Compression:

Stored size: 1.08 KB

Contents

class CamaleonCms::PostTagDecorator < CamaleonCms::TermTaxonomyDecorator
  delegate_all

  # return the public url for this post tag
  def the_url(*args)
    args = args.extract_options!
    args[:post_tag_id] = the_id
    args[:title] = the_title.parameterize
    args[:title] = the_slug unless args[:title].present?
    args[:locale] = get_locale unless args.include?(:locale)
    args[:format] = "html"
    as_path = args.delete(:as_path)
    h.cama_url_to_fixed("cama_post_tag#{_calc_locale(args[:locale])}_#{as_path.present? ? "path" : "url"}", args)
  end

  # return edit url for this post
  def the_edit_url
    h.edit_cama_admin_post_type_post_tag_url(object.post_type.id, object)
  end

  # return the post type of this post tag
  def the_post_type
    object.post_type.decorate
  end

  # ---------------------
  # add_post_type: true/false to include post type link
  # is_parent: true/false (internal control)
  def generate_breadcrumb(add_post_type = true, is_parent = false)
    object.post_type.decorate.generate_breadcrumb(add_post_type, true)
    h.breadcrumb_add(self.the_title)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
camaleon_cms-2.3.6 app/decorators/camaleon_cms/post_tag_decorator.rb
camaleon_cms-2.3.5 app/decorators/camaleon_cms/post_tag_decorator.rb
camaleon_cms-2.3.4 app/decorators/camaleon_cms/post_tag_decorator.rb
camaleon_cms-2.3.3 app/decorators/camaleon_cms/post_tag_decorator.rb
camaleon_cms-2.3.2 app/decorators/camaleon_cms/post_tag_decorator.rb
camaleon_cms-2.3.1 app/decorators/camaleon_cms/post_tag_decorator.rb
camaleon_cms-2.3.0 app/decorators/camaleon_cms/post_tag_decorator.rb