From b2b65f39affc7e3754f2326e3924177877934f00 Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Sun, 2 Jun 2019 18:21:16 +0000 Subject: [PATCH 1/5] Remove trailing whitespaces from app --- app/controllers/attachments_controller.rb | 2 +- app/controllers/previews_controller.rb | 2 +- app/helpers/members_helper.rb | 4 ++-- app/helpers/search_helper.rb | 2 +- app/helpers/workflows_helper.rb | 6 +++--- app/models/mail_handler.rb | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index c5f615d..5d70584 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -239,7 +239,7 @@ class AttachmentsController < ApplicationController def detect_content_type(attachment, is_thumb = false) content_type = attachment.content_type if content_type.blank? || content_type == "application/octet-stream" - content_type = + content_type = Redmine::MimeType.of(attachment.filename).presence || "application/octet-stream" end diff --git a/app/controllers/previews_controller.rb b/app/controllers/previews_controller.rb index 716d27c..e431ab0 100644 --- a/app/controllers/previews_controller.rb +++ b/app/controllers/previews_controller.rb @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class PreviewsController < ApplicationController - before_action :find_project, :except => :text + before_action :find_project, :except => :text before_action :find_attachments def issue diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index 369677e..11e8430 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -36,7 +36,7 @@ module MembersHelper s + content_tag('span', links, :class => 'pagination') end - # Returns inheritance information for an inherited member role + # Returns inheritance information for an inherited member role def render_role_inheritance(member, role) content = member.role_inheritance(role).map do |h| if h.is_a?(Project) @@ -45,7 +45,7 @@ module MembersHelper l(:label_inherited_from_group, :name => h.name.to_s) end end.compact.uniq - + if content.present? content_tag('span', content.join(", "), :class => "info") end diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index a8eb3b3..5ba88a6 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -63,7 +63,7 @@ module SearchHelper :all_words => params[:all_words], :scope => params[:scope], t => 1) end (''.html_safe) unless links.empty? end end diff --git a/app/helpers/workflows_helper.rb b/app/helpers/workflows_helper.rb index 6138179..c09310a 100644 --- a/app/helpers/workflows_helper.rb +++ b/app/helpers/workflows_helper.rb @@ -21,7 +21,7 @@ module WorkflowsHelper def options_for_workflow_select(name, objects, selected, options={}) option_tags = ''.html_safe multiple = false - if selected + if selected if selected.size == objects.size selected = 'all' else @@ -51,7 +51,7 @@ module WorkflowsHelper options = [["", ""], [l(:label_readonly), "readonly"]] options << [l(:label_required), "required"] unless field_required?(field) html_options = {} - + if perm = permissions[status.id][name] if perm.uniq.size > 1 || perm.size < @roles.size * @trackers.size options << [l(:label_no_change_option), "no_change"] @@ -76,7 +76,7 @@ module WorkflowsHelper def transition_tag(workflows, old_status, new_status, name) w = workflows.select {|w| w.old_status == old_status && w.new_status == new_status}.size - + tag_name = "transitions[#{ old_status.try(:id) || 0 }][#{new_status.id}][#{name}]" if old_status == new_status check_box_tag(tag_name, "1", true, diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 82cbc07..44aed82 100755 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -459,7 +459,7 @@ class MailHandler < ActionMailer::Base end end - # Returns the text content of the email. + # Returns the text content of the email. # If the value of Setting.mail_handler_preferred_body_part is 'html', # it returns text converted from the text/html part of the email. # Otherwise, it returns text/plain part. -- 2.1.4