diff options
author | Go MAEDA <maeda@farend.jp> | 2019-03-17 13:36:03 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-03-17 13:36:03 +0000 |
commit | bd5977d97eaf92f852c1bfe499052b6b07ab8aae (patch) | |
tree | 714a9672c2007f78dbe7c2c5a649e24505ae9863 /app/helpers/application_helper.rb | |
parent | 72a163d8b30978f23059ba2a2083675a38bd5680 (diff) | |
download | redmine-bd5977d97eaf92f852c1bfe499052b6b07ab8aae.tar.gz redmine-bd5977d97eaf92f852c1bfe499052b6b07ab8aae.zip |
Support frozen_string_literal in app/**/*.rb (#26561).
Contributed by Pavel Rosický.
git-svn-id: http://svn.redmine.org/redmine/trunk@17987 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r-- | app/helpers/application_helper.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 23520d953..8dab89735 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang @@ -292,7 +292,7 @@ module ApplicationHelper end def toggle_link(name, id, options={}) - onclick = "$('##{id}').toggle(); " + onclick = +"$('##{id}').toggle(); " onclick << (options[:focus] ? "$('##{options[:focus]}').focus(); " : "this.blur(); ") onclick << "$(window).scrollTop($('##{options[:focus]}').position().top); " if options[:scroll] onclick << "return false;" @@ -336,7 +336,7 @@ module ApplicationHelper # The given collection may be a subset of the whole project tree # (eg. some intermediate nodes are private and can not be seen) def render_project_nested_lists(projects, &block) - s = '' + s = +'' if projects.any? ancestors = [] original_project = @project @@ -366,7 +366,7 @@ module ApplicationHelper end def render_page_hierarchy(pages, node=nil, options={}) - content = '' + content = +'' if pages[node] content << "<ul class=\"pages-hierarchy\">\n" pages[node].each do |page| @@ -383,7 +383,7 @@ module ApplicationHelper # Renders flash messages def render_flash_messages - s = '' + s = +'' flash.each do |k,v| s << content_tag('div', v.html_safe, :class => "flash #{k}", :id => "flash_#{k}") end @@ -422,7 +422,7 @@ module ApplicationHelper def render_projects_for_jump_box(projects, selected=nil) jump = params[:jump].presence || current_menu_item - s = ''.html_safe + s = (+'').html_safe project_tree(projects) do |project, level| padding = level * 16 text = content_tag('span', project.name, :style => "padding-left:#{padding}px;") @@ -483,7 +483,7 @@ module ApplicationHelper end def principals_check_box_tags(name, principals) - s = '' + s = +'' principals.each do |principal| s << "<label>#{ check_box_tag name, principal.id, false, :id => nil } #{h principal}</label>\n" end @@ -492,11 +492,11 @@ module ApplicationHelper # Returns a string for users/groups option tags def principals_options_for_select(collection, selected=nil) - s = '' + s = +'' if collection.include?(User.current) s << content_tag('option', "<< #{l(:label_me)} >>", :value => User.current.id) end - groups = '' + groups = +'' collection.sort.each do |element| selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id.to_s == selected (element.is_a?(Group) ? groups : s) << %(<option value="#{element.id}"#{selected_attribute}>#{h element.name}</option>) @@ -728,7 +728,7 @@ module ApplicationHelper def parse_non_pre_blocks(text, obj, macros) s = StringScanner.new(text) tags = [] - parsed = '' + parsed = +'' while !s.eos? s.scan(/(.*?)(<(\/)?(pre|code)(.*?)>|\z)/im) text, full_tag, closing, tag = s[1], s[2], s[3], s[4] @@ -1208,10 +1208,10 @@ module ApplicationHelper if headings.empty? '' else - div_class = 'toc' + div_class = +'toc' div_class << ' right' if right_align div_class << ' left' if left_align - out = "<ul class=\"#{div_class}\"><li><strong>#{l :label_table_of_contents}</strong></li><li>" + out = +"<ul class=\"#{div_class}\"><li><strong>#{l :label_table_of_contents}</strong></li><li>" root = headings.map(&:first).min current = root started = false @@ -1272,7 +1272,7 @@ module ApplicationHelper # Renders a list of error messages def render_error_messages(errors) - html = "" + html = +"" if errors.present? html << "<div id='errorExplanation'><ul>\n" errors.each do |error| |