app/helpers/content_helper.rb in adva-0.1.4 vs app/helpers/content_helper.rb in adva-0.2.0
- old
+ new
@@ -29,20 +29,20 @@
end
def content_status(content)
return "<span> </span>" unless content.respond_to?(:published?)
klass = content.published? ? 'published' : 'pending'
- text = content.published? ? t(:'adva.titles.published') : t(:'adva.titles.pending')
+ text = content.published? ? "Published" : "Pending"
"<span title='#{text}' alt='#{text}' class='status #{klass}'>#{text}</span>"
end
def link_to_preview(*args)
options = args.extract_options!
content, text = *args.reverse
- text ||= :"adva.#{content.class.name.tableize}.links.preview"
+ text ||= "Preview"
url = show_path(content, :cl => content.class.locale, :namespace => nil)
options.reverse_merge!(:url => url, :class => "preview #{content.class.name.underscore}")
link_to_show(text, content, options)
end
@@ -62,12 +62,14 @@
link_to(text, send(route_name, :section_id => section.id, :category_id => category.id))
end
def links_to_content_categories(content, key = nil)
return if content.categories.empty?
- links = content.categories.map { |category| link_to_category content.section, category }
- key ? t(key, :links => links.join(', ')) : links
+ links = content.categories.map do |category|
+ link_to_category content.section, category
+ end
+ raw "in: #{links.join(', ')}"
end
def link_to_tag(*args, &block)
tag = args.pop
section = args.pop
@@ -82,10 +84,10 @@
end
def links_to_content_tags(content, key = nil)
return if content.tags.empty?
links = content.tags.map { |tag| link_to_tag content.section, tag }
- key ? t(key, links: links.join(', ')).html_safe : links
+ raw "tagged: #{links.join(', ')}"
end
def content_category_checkbox(content, category)
type = content.type.downcase
checked = content.categories.include?(category)