Class: CamaleonCms::PostTagDecorator
- Inherits:
-
TermTaxonomyDecorator
- Object
- Draper::Decorator
- ApplicationDecorator
- TermTaxonomyDecorator
- CamaleonCms::PostTagDecorator
- Defined in:
- app/decorators/camaleon_cms/post_tag_decorator.rb
Overview
Camaleon CMS is a content management system
Copyright (C) 2015 by Owen Peredo Diaz
Email: [email protected]
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License (GPLv3) for more details.
Instance Method Summary collapse
-
#generate_breadcrumb(add_post_type = true, is_parent = false) ⇒ Object
——————— add_post_type: true/false to include post type link is_parent: true/false (internal control).
-
#the_edit_url ⇒ Object
return edit url for this post.
-
#the_post_type ⇒ Object
return the post type of this post tag.
-
#the_url(*args) ⇒ Object
return the public url for this post tag.
Methods inherited from TermTaxonomyDecorator
#the_content, #the_edit_link, #the_excerpt, #the_owner, #the_parent, #the_post, #the_posts, #the_slug, #the_status, #the_title
Methods included from CustomFieldsConcern
#render_fields, #the_attribute_field, #the_attribute_fields, #the_field, #the_field!, #the_fields, #the_fields_grouped
Methods inherited from ApplicationDecorator
#_calc_locale, #get_locale, #set_decoration_locale, #the_breadcrumb, #the_created_at, #the_id, #the_keywords, #the_slug, #the_updated_at
Methods included from MetasDecoratorMethods
Instance Method Details
#generate_breadcrumb(add_post_type = true, is_parent = false) ⇒ Object
add_post_type: true/false to include post type link is_parent: true/false (internal control)
37 38 39 40 |
# File 'app/decorators/camaleon_cms/post_tag_decorator.rb', line 37 def (add_post_type = true, is_parent = false) object.post_type.decorate.(add_post_type, true) h.(self.the_title) end |
#the_edit_url ⇒ Object
return edit url for this post
25 26 27 |
# File 'app/decorators/camaleon_cms/post_tag_decorator.rb', line 25 def the_edit_url h.edit_cama_admin_post_type_post_tag_url(object.post_type.id, object) end |
#the_post_type ⇒ Object
return the post type of this post tag
30 31 32 |
# File 'app/decorators/camaleon_cms/post_tag_decorator.rb', line 30 def the_post_type object.post_type.decorate end |
#the_url(*args) ⇒ Object
return the public url for this post tag
13 14 15 16 17 18 19 20 21 22 |
# File 'app/decorators/camaleon_cms/post_tag_decorator.rb', line 13 def the_url(*args) args = args. 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 |