summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-27 20:43:25 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-27 20:43:25 +0000
commite6b9ddad18fb78b7dd17e9f422c9467ec14faa74 (patch)
treebc179795b9bc8ec802b9ac5e549ab3284b1f3642 /app/helpers
parent7056649a4be931a315fd4b4ad2be79ed8b9850e4 (diff)
downloadredmine-e6b9ddad18fb78b7dd17e9f422c9467ec14faa74.tar.gz
redmine-e6b9ddad18fb78b7dd17e9f422c9467ec14faa74.zip
Mailer#url_for not called in views with Rails 3.1.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9023 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--app/helpers/issues_helper.rb15
2 files changed, 9 insertions, 8 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index f04d59e6d..2b0797614 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -99,7 +99,7 @@ module ApplicationHelper
action = options.delete(:download) ? 'download' : 'show'
link_to(h(text),
{:controller => 'attachments', :action => action,
- :id => attachment, :filename => attachment.filename },
+ :id => attachment, :filename => attachment.filename }.merge(options),
options)
end
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 29444e703..66f0b003d 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -163,7 +163,8 @@ module IssuesHelper
# Returns the textual representation of a journal details
# as an array of strings
- def details_to_strings(details, no_html=false)
+ def details_to_strings(details, no_html=false, options={})
+ options[:only_path] = (options[:only_path] == false ? false : true)
strings = []
values_by_field = {}
details.each do |detail|
@@ -181,23 +182,23 @@ module IssuesHelper
next
end
end
- strings << show_detail(detail, no_html)
+ strings << show_detail(detail, no_html, options)
end
values_by_field.each do |field_id, changes|
detail = JournalDetail.new(:property => 'cf', :prop_key => field_id)
if changes[:added].any?
detail.value = changes[:added]
- strings << show_detail(detail, no_html)
+ strings << show_detail(detail, no_html, options)
elsif changes[:deleted].any?
detail.old_value = changes[:deleted]
- strings << show_detail(detail, no_html)
+ strings << show_detail(detail, no_html, options)
end
end
strings
end
# Returns the textual representation of a single journal detail
- def show_detail(detail, no_html=false)
+ def show_detail(detail, no_html=false, options={})
multiple = false
case detail.property
when 'attr'
@@ -250,7 +251,7 @@ module IssuesHelper
old_value = content_tag("strike", old_value) if detail.old_value and detail.value.blank?
if detail.property == 'attachment' && !value.blank? && a = Attachment.find_by_id(detail.prop_key)
# Link to the attachment if it has not been removed
- value = link_to_attachment(a, :download => true)
+ value = link_to_attachment(a, :download => true, :only_path => options[:only_path])
else
value = content_tag("i", h(value)) if value
end
@@ -260,7 +261,7 @@ module IssuesHelper
s = l(:text_journal_changed_no_detail, :label => label)
unless no_html
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, :only_path => options[:only_path]},
:title => l(:label_view_diff)
s << " (#{ diff_link })"
end