summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-06 17:48:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-06 17:48:19 +0000
commit8201761e7732faa3933899653de5951dcbd6b27c (patch)
treed13d476efca02a4b4bf45a3b06b08ccda1aa6e97 /app/helpers
parent43fb3211951ce170df5c7dd1b3f5da871470bdfc (diff)
downloadredmine-8201761e7732faa3933899653de5951dcbd6b27c.tar.gz
redmine-8201761e7732faa3933899653de5951dcbd6b27c.zip
Adds an option for displaying the issue description on the issue list (#3447).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10948 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/issues_helper.rb13
-rw-r--r--app/helpers/queries_helper.rb10
2 files changed, 18 insertions, 5 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 7f70f6255..5073571f6 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -371,12 +371,16 @@ module IssuesHelper
def issues_to_csv(issues, project, query, options={})
decimal_separator = l(:general_csv_decimal_separator)
encoding = l(:general_csv_encoding)
- columns = (options[:columns] == 'all' ? query.available_columns : query.columns)
+ columns = (options[:columns] == 'all' ? query.available_inline_columns : query.inline_columns)
+ if options[:description]
+ if description = query.available_columns.detect {|q| q.name == :description}
+ columns << description
+ end
+ end
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# csv header fields
- csv << [ "#" ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) } +
- (options[:description] ? [Redmine::CodesetUtil.from_utf8(l(:field_description), encoding)] : [])
+ csv << [ "#" ] + columns.collect {|c| Redmine::CodesetUtil.from_utf8(c.caption.to_s, encoding) }
# csv lines
issues.each do |issue|
@@ -398,8 +402,7 @@ module IssuesHelper
end
s.to_s
end
- csv << [ issue.id.to_s ] + col_values.collect {|c| Redmine::CodesetUtil.from_utf8(c.to_s, encoding) } +
- (options[:description] ? [Redmine::CodesetUtil.from_utf8(issue.description, encoding)] : [])
+ csv << [ issue.id.to_s ] + col_values.collect {|c| Redmine::CodesetUtil.from_utf8(c.to_s, encoding) }
end
end
export
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb
index 6ea879a35..6b9c0962d 100644
--- a/app/helpers/queries_helper.rb
+++ b/app/helpers/queries_helper.rb
@@ -50,6 +50,14 @@ module QueriesHelper
end
end
+ def available_block_columns_tags(query)
+ tags = ''.html_safe
+ query.available_block_columns.each do |column|
+ tags << content_tag('label', check_box_tag('c[]', column.name.to_s, query.has_column?(column)) + " #{column.caption}", :class => 'inline')
+ end
+ tags
+ end
+
def column_header(column)
column.sortable ? sort_header_tag(column.name.to_s, :caption => column.caption,
:default_order => column.default_order) :
@@ -70,6 +78,8 @@ module QueriesHelper
when 'String'
if column.name == :subject
link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
+ elsif column.name == :description
+ issue.description? ? content_tag('div', textilizable(issue, :description), :class => "wiki") : ''
else
h(value)
end