|
|
|
@ -46,6 +46,26 @@ module JournalsHelper
|
|
|
|
|
content.html_safe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def render_links_easy(issue, journal, options={})
|
|
|
|
|
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)))
|
|
|
|
|
destroyable = User.current.logged? && ((journal.user == User.current) || (issue.author_id == User.current.id) || (User.current.admin == 1))
|
|
|
|
|
links = []
|
|
|
|
|
if !journal.notes.blank?
|
|
|
|
|
links << link_to(l(:button_quote),
|
|
|
|
|
{:controller => 'journals', :action => 'new', :id => issue.id, :journal_id => journal},
|
|
|
|
|
:remote => true,
|
|
|
|
|
:method => 'post',
|
|
|
|
|
:title => l(:button_quote)) if options[:reply_links]
|
|
|
|
|
if destroyable
|
|
|
|
|
links << link_to(l(:button_delete), { :controller => 'journals', :action => 'destroy', :id => journal, :format => 'js' },
|
|
|
|
|
:title => l(:button_delete))
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
content << content_tag('div', links.join(' ').html_safe, :class => 'contextual') unless links.empty?
|
|
|
|
|
content.html_safe
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def render_notes (issue, journal, options={})
|
|
|
|
|
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)))
|
|
|
|
|