diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index db14797..c71ee1a 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -493,23 +493,24 @@ module ApplicationHelper def profile_cat_icons( profile ) if profile.class == Enterprise - icons = - profile.product_categories.map{ |c| c.size > 1 ? c[1] : nil }. - compact.uniq.map{ |c| - cat_name = c.gsub( /[-_\s,.;'"]+/, '_' ) - cat_icon = "/images/icons-cat/#{cat_name}.png" - if ! File.exists? RAILS_ROOT.to_s() + '/public/' + cat_icon - cat_icon = '/images/icons-cat/undefined.png' - end - content_tag 'span', - content_tag( 'span', c ), - :title => c, - :class => 'product-cat-icon cat_icon_' + cat_name, - :style => "background-image:url(#{cat_icon})" - }.join "\n" - content_tag 'div', - content_tag( 'span', _('Principal Product Categories'), :class => 'header' ) +"\n"+ icons, - :class => 'product-category-icons' + icons = profile.product_categories.map{ |c| c.size > 1 ? c[1] : nil }. + compact.uniq.map do |c| + cat_name = c.gsub( /[-_\s,.;'"]+/, '_' ) + cat_icon = "/images/icons-cat/#{cat_name}.png" + if ! File.exists? RAILS_ROOT.to_s() + '/public/' + cat_icon + cat_icon = '/images/icons-cat/undefined.png' + end + content_tag('span', + content_tag( 'span', c ), + :title => c, + :class => 'product-cat-icon cat_icon_' + cat_name, + :style => "background-image:url(#{cat_icon})" + ) + end.join("\n").html_safe + content_tag('div', + content_tag( 'span', _('Principal Product Categories'), :class => 'header' ) +"\n"+ icons, + :class => 'product-category-icons' + ) else '' end @@ -633,10 +634,10 @@ module ApplicationHelper # FIXME ([toplevel] + toplevel.children_for_menu).each do |cat| if cat.top_level? - result << '
' + result << '
'.html_safe result << icon_button( :down, _('open'), '#', :onclick => 'open_close_cat(this); return false' ) result << content_tag('h5', toplevel.name) - result << '
    ' + result << '
      '.html_safe else checkbox_id = "#{object_name}_#{cat.full_name.downcase.gsub(/\s+|\//, '_')}" result << content_tag('li', labelled_check_box( @@ -647,7 +648,7 @@ module ApplicationHelper :class => ( object.category_ids.include?(cat.id) ? 'cat_checked' : '' ) ) + "\n" end end - result << '
' + result << '
'.html_safe end content_tag('div', result) @@ -787,10 +788,10 @@ module ApplicationHelper :class => 'lineitem' + (line_item+=1).to_s() ) +"\n" if line_item == line_size line_item = 0 - html += "
\n" + html += "
\n".html_safe end } - html += "
\n" if line_size == 0 || ( values.size % line_size ) > 0 + html += "
\n".html_safe if line_size == 0 || ( values.size % line_size ) > 0 column = object.class.columns_hash[method.to_s] text = ( column ? @@ -977,7 +978,7 @@ module ApplicationHelper end def link_to_email(email) - javascript_tag('var array = ' + email.split('@').to_json + '; document.write("" + array.join("@") + "")') + javascript_tag('var array = ' + email.split('@').to_json + '; document.write("" + array.join("@") + "")'.html_safe) end def stylesheet(*args) @@ -987,7 +988,7 @@ module ApplicationHelper def article_to_html(article, options = {}) options.merge!(:page => params[:npage]) content = article.to_html(options) - content = content.kind_of?(Proc) ? self.instance_eval(&content) : content + content = content.kind_of?(Proc) ? self.instance_eval(&content).html_safe : content.html_safe @plugins && @plugins.each do |plugin| content = plugin.parse_content(content) end @@ -1003,7 +1004,7 @@ module ApplicationHelper end def ui_icon(icon_class, extra_class = '') - "" + "".html_safe end def ui_button(label, url, html_options = {}) @@ -1035,13 +1036,13 @@ module ApplicationHelper end def collapsed_item_icon - "" + "".html_safe end def expanded_item_icon - "" + "".html_safe end def leaf_item_icon - "" + "".html_safe end def display_category_menu(block, categories, root = true) @@ -1300,9 +1301,7 @@ module ApplicationHelper titles = tabs.inject(''){ |result, tab| result << content_tag(:li, link_to(tab[:title], '#'+tab[:id]), :class => 'tab') } contents = tabs.inject(''){ |result, tab| result << content_tag(:div, tab[:content], :id => tab[:id]) } - content_tag :div, :class => 'ui-tabs' do - content_tag(:ul, titles) + contents - end + content_tag(:div, content_tag(:ul, titles) + raw(contents), :class => 'ui-tabs') end def jquery_token_input_messages_json(hintText = _('Type in an keyword'), noResultsText = _('No results'), searchingText = _('Searching...')) diff --git a/app/helpers/profile_editor_helper.rb b/app/helpers/profile_editor_helper.rb index 7cb999e..9479418 100644 --- a/app/helpers/profile_editor_helper.rb +++ b/app/helpers/profile_editor_helper.rb @@ -136,7 +136,7 @@ module ProfileEditorHelper concat( content_tag( 'div', - capture(&block) + '
 ', + capture(&block) + content_tag('br', '', :style => 'clear: left'), :class => 'control-panel') ) end diff --git a/app/helpers/tags_helper.rb b/app/helpers/tags_helper.rb index a0096e3..6139018 100644 --- a/app/helpers/tags_helper.rb +++ b/app/helpers/tags_helper.rb @@ -68,7 +68,7 @@ module TagsHelper :title => n_( 'one item', '%d items', count ) % count end - end.join("\n") + end.join("\n").html_safe end end diff --git a/app/models/article_block.rb b/app/models/article_block.rb index bb802be..6a12e11 100644 --- a/app/models/article_block.rb +++ b/app/models/article_block.rb @@ -12,7 +12,7 @@ class ArticleBlock < Block block = self lambda do block_title(block.title) + - (block.article ? article_to_html(block.article, :gallery_view => false) : _('Article not selected yet.')) + (block.article ? article_to_html(block.article, :gallery_view => false).html_safe : _('Article not selected yet.')) end end diff --git a/app/models/feed_reader_block.rb b/app/models/feed_reader_block.rb index 3ab06ff..142aedf 100644 --- a/app/models/feed_reader_block.rb +++ b/app/models/feed_reader_block.rb @@ -47,11 +47,11 @@ class FeedReaderBlock < Block def formatted_feed_content if error_message.blank? - "" + "".html_safe else - '

' + error_message + '

' + "

#{error_message}

".html_safe end end diff --git a/app/models/link_list_block.rb b/app/models/link_list_block.rb index 586f844..39267e6 100644 --- a/app/models/link_list_block.rb +++ b/app/models/link_list_block.rb @@ -80,7 +80,7 @@ class LinkListBlock < Block def icons_options ICONS.map do |i| - "" + "".html_safe end end diff --git a/app/models/profile_list_block.rb b/app/models/profile_list_block.rb index ad1371e..d5f8e91 100644 --- a/app/models/profile_list_block.rb +++ b/app/models/profile_list_block.rb @@ -49,13 +49,12 @@ class ProfileListBlock < Block send(:profile_image_link, item, :minor ) }.join("\n ") if list.empty? - list = '
'+ _('None') +'
' + list = content_tag 'div', _('None'), :class => 'common-profile-list-block-none' else list = content_tag 'ul', nl +' '+ list + nl end block_title(title) + nl + - '
' + - nl + list + nl + '
' + content_tag('div', nl + list + nl + content_tag('br', '', :style => 'clear:both')) end end diff --git a/app/models/tags_block.rb b/app/models/tags_block.rb index c034dc6..667a1a1 100644 --- a/app/models/tags_block.rb +++ b/app/models/tags_block.rb @@ -30,11 +30,11 @@ class TagsBlock < Block end block_title(title) + - "\n
\n"+ + "\n
\n".html_safe+ tag_cloud( tags, :id, owner.public_profile_url.merge(:controller => 'profile', :action => 'tags'), :max_size => 16, :min_size => 9 ) + - "\n
\n"; + "\n
\n".html_safe end def footer diff --git a/app/models/uploaded_file.rb b/app/models/uploaded_file.rb index caa30b6..5be009e 100644 --- a/app/models/uploaded_file.rb +++ b/app/models/uploaded_file.rb @@ -113,7 +113,7 @@ class UploadedFile < Article content_tag( 'div', - link_to_previous + content_tag('span', _('image %d of %d'), :class => 'total-of-images') % [current_index + 1, total_of_images] + link_to_next, + link_to_previous + (content_tag('span', _('image %d of %d'), :class => 'total-of-images') % [current_index + 1, total_of_images]).html_safe + link_to_next, :class => 'gallery-navigation' ) end.to_s + diff --git a/app/views/box_organizer/_highlights_block.rhtml b/app/views/box_organizer/_highlights_block.rhtml index 90be8b3..1d2d42d 100644 --- a/app/views/box_organizer/_highlights_block.rhtml +++ b/app/views/box_organizer/_highlights_block.rhtml @@ -5,7 +5,7 @@ <% for image in @block.images do %> - <%= select_tag 'block[images][][image_id]', content_tag(:option) + option_groups_from_collection_for_select(@block.folder_choices, :images, :name, :id, :name, image[:image_id].to_i), :style => "width: 100px" %>

+ <%= select_tag 'block[images][][image_id]', content_tag(:option) + option_groups_from_collection_for_select(@block.folder_choices, :images, :name, :id, :name, image[:image_id].to_i).html_safe, :style => "width: 100px" %>

<%= text_field_tag 'block[images][][address]', image[:address], :class => 'highlight-address', :size => 10 %> <%= text_field_tag 'block[images][][position]', image[:position], :class => 'highlight-position', :size => 3 %> @@ -17,7 +17,7 @@ <%= link_to_function(_('New highlight'), nil, :class => 'button icon-add with-text') do |page| page.insert_html :bottom, 'highlights', content_tag('tr', - content_tag('td', select_tag('block[images][][image_id]', content_tag(:option) + option_groups_from_collection_for_select(@block.folder_choices, :images, :name, :id, :name), :style => "width: 100px")) + + content_tag('td', select_tag('block[images][][image_id]', content_tag(:option) + option_groups_from_collection_for_select(@block.folder_choices, :images, :name, :id, :name).html_safe, :style => "width: 100px")) + content_tag('td', text_field_tag('block[images][][address]', nil, :class => 'highlight-address', :size => 10)) + content_tag('td', text_field_tag('block[images][][position]', nil, :class => 'highlight-position', :size => 3)) + content_tag('td', text_field_tag('block[images][][title]', nil, :class => 'highlight-position', :size => 10)) diff --git a/app/views/favorite_enterprises/index.rhtml b/app/views/favorite_enterprises/index.rhtml index aded584..3fdd2cb 100644 --- a/app/views/favorite_enterprises/index.rhtml +++ b/app/views/favorite_enterprises/index.rhtml @@ -5,7 +5,7 @@