summaryrefslogtreecommitdiffstats
path: root/app/helpers/journals_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-16 21:37:05 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2010-03-16 21:37:05 +0000
commitf4be4d101ba1bcd9979ca57b82db7540d79680fb (patch)
tree7bc7b0a82fca20e4a19d390a007e6fd4c39f7bda /app/helpers/journals_helper.rb
parent2f0fbef858c9725f46c46effcd1ab70c06f3fef1 (diff)
downloadredmine-f4be4d101ba1bcd9979ca57b82db7540d79680fb.tar.gz
redmine-f4be4d101ba1bcd9979ca57b82db7540d79680fb.zip
Inlines some code to speed up large ticket history rendering.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3594 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/journals_helper.rb')
-rw-r--r--app/helpers/journals_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb
index 4f21b30db..cf8772430 100644
--- a/app/helpers/journals_helper.rb
+++ b/app/helpers/journals_helper.rb
@@ -16,13 +16,13 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module JournalsHelper
- def render_notes(journal, options={})
+ def render_notes(issue, journal, options={})
content = ''
- editable = journal.editable_by?(User.current)
+ editable = User.current.logged? && (User.current.allowed_to?(:edit_issue_notes, issue.project) || (journal.user == User.current && User.current.allowed_to?(:edit_own_issue_notes, issue.project)))
links = []
if !journal.notes.blank?
links << link_to_remote(image_tag('comment.png'),
- { :url => {:controller => 'issues', :action => 'reply', :id => journal.journalized, :journal_id => journal} },
+ { :url => {:controller => 'issues', :action => 'reply', :id => issue, :journal_id => journal} },
:title => l(:button_quote)) if options[:reply_links]
links << link_to_in_place_notes_editor(image_tag('edit.png'), "journal-#{journal.id}-notes",
{ :controller => 'journals', :action => 'edit', :id => journal },