mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 15:31:12 +00:00
Code cleanup (#22575).
git-svn-id: http://svn.redmine.org/redmine/trunk@15622 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
1f9bbd6b42
commit
fc9a99fe36
@ -27,9 +27,9 @@ module JournalsHelper
|
|||||||
|
|
||||||
def render_notes(issue, journal, options={})
|
def render_notes(issue, journal, options={})
|
||||||
content = ''
|
content = ''
|
||||||
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)))
|
css_classes = "wiki"
|
||||||
links = []
|
links = []
|
||||||
if !journal.notes.blank?
|
if journal.notes.present?
|
||||||
links << link_to(l(:button_quote),
|
links << link_to(l(:button_quote),
|
||||||
quoted_issue_path(issue, :journal_id => journal),
|
quoted_issue_path(issue, :journal_id => journal),
|
||||||
:remote => true,
|
:remote => true,
|
||||||
@ -37,25 +37,27 @@ module JournalsHelper
|
|||||||
:title => l(:button_quote),
|
:title => l(:button_quote),
|
||||||
:class => 'icon-only icon-comment'
|
:class => 'icon-only icon-comment'
|
||||||
) if options[:reply_links]
|
) if options[:reply_links]
|
||||||
links << link_to(l(:button_edit),
|
|
||||||
edit_journal_path(journal),
|
if journal.editable_by?(User.current)
|
||||||
:remote => true,
|
links << link_to(l(:button_edit),
|
||||||
:method => 'get',
|
edit_journal_path(journal),
|
||||||
:title => l(:button_edit),
|
:remote => true,
|
||||||
:class => 'icon-only icon-edit'
|
:method => 'get',
|
||||||
) if editable
|
:title => l(:button_edit),
|
||||||
links << link_to(l(:button_delete),
|
:class => 'icon-only icon-edit'
|
||||||
journal_path(journal, :journal => {:notes => ""}),
|
)
|
||||||
:remote => true,
|
links << link_to(l(:button_delete),
|
||||||
:method => 'put', :data => {:confirm => l(:text_are_you_sure)},
|
journal_path(journal, :journal => {:notes => ""}),
|
||||||
:title => l(:button_delete),
|
:remote => true,
|
||||||
:class => 'icon-only icon-del'
|
:method => 'put', :data => {:confirm => l(:text_are_you_sure)},
|
||||||
) if editable
|
:title => l(:button_delete),
|
||||||
|
:class => 'icon-only icon-del'
|
||||||
|
)
|
||||||
|
css_classes << " editable"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
content << content_tag('div', links.join(' ').html_safe, :class => 'contextual') unless links.empty?
|
content << content_tag('div', links.join(' ').html_safe, :class => 'contextual') unless links.empty?
|
||||||
content << textilizable(journal, :notes)
|
content << textilizable(journal, :notes)
|
||||||
css_classes = "wiki"
|
|
||||||
css_classes << " editable" if editable
|
|
||||||
content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes)
|
content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user