remove trailing white-spaces from issues helper source.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5831 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
6f0de178f9
commit
fb41e3dab4
@ -5,12 +5,12 @@
|
|||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
# as published by the Free Software Foundation; either version 2
|
# as published by the Free Software Foundation; either version 2
|
||||||
# of the License, or (at your option) any later version.
|
# of the License, or (at your option) any later version.
|
||||||
#
|
#
|
||||||
# This program is distributed in the hope that it will be useful,
|
# This program is distributed in the hope that it will be useful,
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
#
|
#
|
||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
@ -54,11 +54,11 @@ module IssuesHelper
|
|||||||
"<strong>#{@cached_label_assigned_to}</strong>: #{issue.assigned_to}<br />" +
|
"<strong>#{@cached_label_assigned_to}</strong>: #{issue.assigned_to}<br />" +
|
||||||
"<strong>#{@cached_label_priority}</strong>: #{issue.priority.name}"
|
"<strong>#{@cached_label_priority}</strong>: #{issue.priority.name}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def issue_heading(issue)
|
def issue_heading(issue)
|
||||||
h("#{issue.tracker} ##{issue.id}")
|
h("#{issue.tracker} ##{issue.id}")
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_issue_subject_with_tree(issue)
|
def render_issue_subject_with_tree(issue)
|
||||||
s = ''
|
s = ''
|
||||||
ancestors = issue.root? ? [] : issue.ancestors.visible.all
|
ancestors = issue.root? ? [] : issue.ancestors.visible.all
|
||||||
@ -74,7 +74,7 @@ module IssuesHelper
|
|||||||
s << '</div>' * (ancestors.size + 1)
|
s << '</div>' * (ancestors.size + 1)
|
||||||
s
|
s
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_descendants_tree(issue)
|
def render_descendants_tree(issue)
|
||||||
s = '<form><table class="list issues">'
|
s = '<form><table class="list issues">'
|
||||||
issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
|
issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
|
||||||
@ -89,7 +89,7 @@ module IssuesHelper
|
|||||||
s << '</form></table>'
|
s << '</form></table>'
|
||||||
s
|
s
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_custom_fields_rows(issue)
|
def render_custom_fields_rows(issue)
|
||||||
return if issue.custom_field_values.empty?
|
return if issue.custom_field_values.empty?
|
||||||
ordered_values = []
|
ordered_values = []
|
||||||
@ -108,7 +108,7 @@ module IssuesHelper
|
|||||||
s << "</tr>\n"
|
s << "</tr>\n"
|
||||||
s
|
s
|
||||||
end
|
end
|
||||||
|
|
||||||
def issues_destroy_confirmation_message(issues)
|
def issues_destroy_confirmation_message(issues)
|
||||||
issues = [issues] unless issues.is_a?(Array)
|
issues = [issues] unless issues.is_a?(Array)
|
||||||
message = l(:text_issues_destroy_confirmation)
|
message = l(:text_issues_destroy_confirmation)
|
||||||
@ -126,14 +126,14 @@ module IssuesHelper
|
|||||||
end
|
end
|
||||||
message
|
message
|
||||||
end
|
end
|
||||||
|
|
||||||
def sidebar_queries
|
def sidebar_queries
|
||||||
unless @sidebar_queries
|
unless @sidebar_queries
|
||||||
# User can see public queries and his own queries
|
# User can see public queries and his own queries
|
||||||
visible = ARCondition.new(["is_public = ? OR user_id = ?", true, (User.current.logged? ? User.current.id : 0)])
|
visible = ARCondition.new(["is_public = ? OR user_id = ?", true, (User.current.logged? ? User.current.id : 0)])
|
||||||
# Project specific queries and global queries
|
# Project specific queries and global queries
|
||||||
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
|
visible << (@project.nil? ? ["project_id IS NULL"] : ["project_id IS NULL OR project_id = ?", @project.id])
|
||||||
@sidebar_queries = Query.find(:all,
|
@sidebar_queries = Query.find(:all,
|
||||||
:select => 'id, name, is_public',
|
:select => 'id, name, is_public',
|
||||||
:order => "name ASC",
|
:order => "name ASC",
|
||||||
:conditions => visible.conditions)
|
:conditions => visible.conditions)
|
||||||
@ -144,13 +144,13 @@ module IssuesHelper
|
|||||||
def query_links(title, queries)
|
def query_links(title, queries)
|
||||||
# links to #index on issues/show
|
# links to #index on issues/show
|
||||||
url_params = controller_name == 'issues' ? {:controller => 'issues', :action => 'index', :project_id => @project} : params
|
url_params = controller_name == 'issues' ? {:controller => 'issues', :action => 'index', :project_id => @project} : params
|
||||||
|
|
||||||
content_tag('h3', title) +
|
content_tag('h3', title) +
|
||||||
queries.collect {|query|
|
queries.collect {|query|
|
||||||
link_to(h(query.name), url_params.merge(:query_id => query))
|
link_to(h(query.name), url_params.merge(:query_id => query))
|
||||||
}.join('<br />')
|
}.join('<br />')
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_sidebar_queries
|
def render_sidebar_queries
|
||||||
out = ''
|
out = ''
|
||||||
queries = sidebar_queries.select {|q| !q.is_public?}
|
queries = sidebar_queries.select {|q| !q.is_public?}
|
||||||
@ -182,7 +182,7 @@ module IssuesHelper
|
|||||||
label = l(:field_parent_issue)
|
label = l(:field_parent_issue)
|
||||||
value = "##{detail.value}" unless detail.value.blank?
|
value = "##{detail.value}" unless detail.value.blank?
|
||||||
old_value = "##{detail.old_value}" unless detail.old_value.blank?
|
old_value = "##{detail.old_value}" unless detail.old_value.blank?
|
||||||
|
|
||||||
when detail.prop_key == 'is_private'
|
when detail.prop_key == 'is_private'
|
||||||
value = l(detail.value == "0" ? :general_text_No : :general_text_Yes) unless detail.value.blank?
|
value = l(detail.value == "0" ? :general_text_No : :general_text_Yes) unless detail.value.blank?
|
||||||
old_value = l(detail.old_value == "0" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?
|
old_value = l(detail.old_value == "0" ? :general_text_No : :general_text_Yes) unless detail.old_value.blank?
|
||||||
@ -202,7 +202,7 @@ module IssuesHelper
|
|||||||
label ||= detail.prop_key
|
label ||= detail.prop_key
|
||||||
value ||= detail.value
|
value ||= detail.value
|
||||||
old_value ||= detail.old_value
|
old_value ||= detail.old_value
|
||||||
|
|
||||||
unless no_html
|
unless no_html
|
||||||
label = content_tag('strong', label)
|
label = content_tag('strong', label)
|
||||||
old_value = content_tag("i", h(old_value)) if detail.old_value
|
old_value = content_tag("i", h(old_value)) if detail.old_value
|
||||||
@ -214,11 +214,11 @@ module IssuesHelper
|
|||||||
value = content_tag("i", h(value)) if value
|
value = content_tag("i", h(value)) if value
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if detail.property == 'attr' && detail.prop_key == 'description'
|
if detail.property == 'attr' && detail.prop_key == 'description'
|
||||||
s = l(:text_journal_changed_no_detail, :label => label)
|
s = l(:text_journal_changed_no_detail, :label => label)
|
||||||
unless no_html
|
unless no_html
|
||||||
diff_link = link_to 'diff',
|
diff_link = link_to 'diff',
|
||||||
{:controller => 'journals', :action => 'diff', :id => detail.journal_id, :detail_id => detail.id},
|
{:controller => 'journals', :action => 'diff', :id => detail.journal_id, :detail_id => detail.id},
|
||||||
:title => l(:label_view_diff)
|
:title => l(:label_view_diff)
|
||||||
s << " (#{ diff_link })"
|
s << " (#{ diff_link })"
|
||||||
@ -248,7 +248,7 @@ module IssuesHelper
|
|||||||
return record.name if record
|
return record.name if record
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Renders issue children recursively
|
# Renders issue children recursively
|
||||||
def render_api_issue_children(issue, api)
|
def render_api_issue_children(issue, api)
|
||||||
return if issue.leaf?
|
return if issue.leaf?
|
||||||
@ -262,14 +262,14 @@ module IssuesHelper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def issues_to_csv(issues, project = nil)
|
def issues_to_csv(issues, project = nil)
|
||||||
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
|
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
|
||||||
decimal_separator = l(:general_csv_decimal_separator)
|
decimal_separator = l(:general_csv_decimal_separator)
|
||||||
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
|
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
|
||||||
# csv header fields
|
# csv header fields
|
||||||
headers = [ "#",
|
headers = [ "#",
|
||||||
l(:field_status),
|
l(:field_status),
|
||||||
l(:field_project),
|
l(:field_project),
|
||||||
l(:field_tracker),
|
l(:field_tracker),
|
||||||
l(:field_priority),
|
l(:field_priority),
|
||||||
@ -296,9 +296,9 @@ module IssuesHelper
|
|||||||
# csv lines
|
# csv lines
|
||||||
issues.each do |issue|
|
issues.each do |issue|
|
||||||
fields = [issue.id,
|
fields = [issue.id,
|
||||||
issue.status.name,
|
issue.status.name,
|
||||||
issue.project.name,
|
issue.project.name,
|
||||||
issue.tracker.name,
|
issue.tracker.name,
|
||||||
issue.priority.name,
|
issue.priority.name,
|
||||||
issue.subject,
|
issue.subject,
|
||||||
issue.assigned_to,
|
issue.assigned_to,
|
||||||
@ -310,7 +310,7 @@ module IssuesHelper
|
|||||||
issue.done_ratio,
|
issue.done_ratio,
|
||||||
issue.estimated_hours.to_s.gsub('.', decimal_separator),
|
issue.estimated_hours.to_s.gsub('.', decimal_separator),
|
||||||
issue.parent_id,
|
issue.parent_id,
|
||||||
format_time(issue.created_on),
|
format_time(issue.created_on),
|
||||||
format_time(issue.updated_on)
|
format_time(issue.updated_on)
|
||||||
]
|
]
|
||||||
custom_fields.each {|f| fields << show_value(issue.custom_value_for(f)) }
|
custom_fields.each {|f| fields << show_value(issue.custom_value_for(f)) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user