app/helpers/alchemy/admin/pages_helper.rb in alchemy_cms-2.5.0.b5 vs app/helpers/alchemy/admin/pages_helper.rb in alchemy_cms-2.5.0.b9
- old
+ new
@@ -50,11 +50,11 @@
jQuery(function($) {
Alchemy.Tinymce.customInits = [];"
custom_config_contents = Alchemy::Tinymce.custom_config_contents
content_names = custom_config_contents.collect{ |c| c['name'] }
if content_names.uniq.length != content_names.length
- raise "Duplicated content names with tinymce setting in elements.yml found. Please rename these contents."
+ raise TinymceError, "Duplicated content names with tinymce setting in elements.yml found. Please rename these contents."
end
custom_config_contents.each do |content|
next unless content['settings']['tinymce']
config = Alchemy::Tinymce.init.merge(content['settings']['tinymce'].symbolize_keys)
config = config.collect { |key, value| "#{key} : #{value.to_json}" }.join(', ')
@@ -82,16 +82,22 @@
end
def preview_sizes_for_select
options_for_select([
'auto',
- [t('240', :scope => 'preview_sizes'), 240],
- [t('320', :scope => 'preview_sizes'), 320],
- [t('480', :scope => 'preview_sizes'), 480],
- [t('768', :scope => 'preview_sizes'), 768],
- [t('1024', :scope => 'preview_sizes'), 1024],
- [t('1280', :scope => 'preview_sizes'), 1280]
+ [_t('240', :scope => 'preview_sizes'), 240],
+ [_t('320', :scope => 'preview_sizes'), 320],
+ [_t('480', :scope => 'preview_sizes'), 480],
+ [_t('768', :scope => 'preview_sizes'), 768],
+ [_t('1024', :scope => 'preview_sizes'), 1024],
+ [_t('1280', :scope => 'preview_sizes'), 1280]
])
+ end
+
+ # Returns the translated explanation of the pageĀ“s status.
+ #
+ def combined_page_status(page)
+ _t(page.status.to_a.map{ |k, v| "#{k}.#{v}" }.flatten, :scope => "page_states").delete_if(&:blank?).join("<br>").html_safe
end
end
end
end