Module: CamaleonCms::Admin::PostTypeHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/camaleon_cms/admin/post_type_helper.rb

Overview

encoding: utf-8

Instance Method Summary collapse

Instance Method Details

#post_type_html_inputs(post_type, taxonomy = "categories", name = "categories", type = "checkbox", values = [], class_cat = "categorychecklist", required = false) ⇒ Object

taxonomy -> (categories || post_tags)


13
14
15
16
17
# File 'app/helpers/camaleon_cms/admin/post_type_helper.rb', line 13

def post_type_html_inputs(post_type, taxonomy="categories", name ="categories", type="checkbox", values=[], class_cat="categorychecklist" , required = false)
  categories = post_type.send(taxonomy)
  categories = categories.eager_load(:children, :post_type_parent, :parent) if taxonomy == "categories" || taxonomy == "children"
  post_type_taxonomy_html_(categories,taxonomy, name, type, values, class_cat, required)
end

#post_type_list_taxonomy(taxonomies, color = "primary") ⇒ Object

taxonomies -> (categories || post_tags)


25
26
27
28
29
30
31
# File 'app/helpers/camaleon_cms/admin/post_type_helper.rb', line 25

def post_type_list_taxonomy(taxonomies, color="primary")
  html = ""
  taxonomies.decorate.each do |f|
    html += "<a class='cama_ajax_request' href='#{cama_admin_post_type_taxonomy_posts_path(@post_type.id, f.taxonomy, f.id)}'><span class='label label-#{color} label-form'>#{f.the_title}</span></a> "
  end
  return html
end

#post_type_status(status, color = "default") ⇒ Object


19
20
21
22
# File 'app/helpers/camaleon_cms/admin/post_type_helper.rb', line 19

def post_type_status(status, color="default")
  html = "<span class='label label-#{color} label-form'>#{status}</span>"

end