first version of multi categories and tags
This commit is contained in:
1 parent
96455f31e1
commit
b315215bed
12 files changed
+142
-34
No files matched your search
@@ -84,17 +84,17 @@ module Admin::PagePartsHelper
|
||||
|
||||
def tag_checked_value(part,radio_value)
|
||||
if radio_value.blank?
|
||||
(part.nil? || part[:tag].blank?)? true : false
|
||||
(part.nil? || part[:tag].blank?) ? true : false
|
||||
else
|
||||
part and (part[:tag] == radio_value.to_s) ? true : false
|
||||
part and (part[:tag].include?(radio_value.to_s)) ? true : false
|
||||
end
|
||||
end
|
||||
|
||||
def category_checked_value(part,radio_value)
|
||||
if radio_value.blank?
|
||||
(part.nil? || part[:category].blank?)? true : false
|
||||
(part.nil? || part[:category].blank?) ? true : false
|
||||
else
|
||||
part and (part[:category] == radio_value.to_s) ? true : false
|
||||
part and (part[:category].include?(radio_value.to_s)) ? true : false
|
||||
end
|
||||
end
|
||||
|
||||
@@ -117,6 +117,19 @@ module Admin::PagePartsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def nil_checkbox_button(part,tag_or_cate)
|
||||
field_name = case part
|
||||
when PagePart
|
||||
'page_part'
|
||||
when Page
|
||||
'page'
|
||||
end
|
||||
content_tag :label,:class=>"radio inline" do
|
||||
op = check_box_tag("#{field_name}[#{tag_or_cate}][]", 'nil' , eval("#{tag_or_cate}_checked_value(part,'')"),:class=>'select_all')
|
||||
op << I18n.t("default_widget.no_value")
|
||||
end
|
||||
end
|
||||
|
||||
def nil_radio_button(part,tag_or_cate)
|
||||
field_name = case part
|
||||
when PagePart
|
||||
|
||||
Reference in new issue
Block a user