@@ -27,9 +27,9 module JournalsHelper | |||
|
27 | 27 | |
|
28 | 28 | def render_notes(issue, journal, options={}) |
|
29 | 29 | content = '' |
|
30 | 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))) | |
|
30 | css_classes = "wiki" | |
|
31 | 31 | links = [] |
|
32 |
if |
|
|
32 | if journal.notes.present? | |
|
33 | 33 | links << link_to(l(:button_quote), |
|
34 | 34 | quoted_issue_path(issue, :journal_id => journal), |
|
35 | 35 | :remote => true, |
@@ -37,25 +37,27 module JournalsHelper | |||
|
37 | 37 | :title => l(:button_quote), |
|
38 | 38 | :class => 'icon-only icon-comment' |
|
39 | 39 | ) if options[:reply_links] |
|
40 | links << link_to(l(:button_edit), | |
|
41 | edit_journal_path(journal), | |
|
42 | :remote => true, | |
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
) |
|
|
47 | links << link_to(l(:button_delete), | |
|
48 | journal_path(journal, :journal => {:notes => ""}), | |
|
49 | :remote => true, | |
|
50 | :method => 'put', :data => {:confirm => l(:text_are_you_sure)}, | |
|
51 |
|
|
|
52 | :class => 'icon-only icon-del' | |
|
53 |
) |
|
|
40 | ||
|
41 | if journal.editable_by?(User.current) | |
|
42 | links << link_to(l(:button_edit), | |
|
43 | edit_journal_path(journal), | |
|
44 | :remote => true, | |
|
45 | :method => 'get', | |
|
46 | :title => l(:button_edit), | |
|
47 | :class => 'icon-only icon-edit' | |
|
48 | ) | |
|
49 | links << link_to(l(:button_delete), | |
|
50 | journal_path(journal, :journal => {:notes => ""}), | |
|
51 | :remote => true, | |
|
52 | :method => 'put', :data => {:confirm => l(:text_are_you_sure)}, | |
|
53 | :title => l(:button_delete), | |
|
54 | :class => 'icon-only icon-del' | |
|
55 | ) | |
|
56 | css_classes << " editable" | |
|
57 | end | |
|
54 | 58 | end |
|
55 | 59 | content << content_tag('div', links.join(' ').html_safe, :class => 'contextual') unless links.empty? |
|
56 | 60 | content << textilizable(journal, :notes) |
|
57 | css_classes = "wiki" | |
|
58 | css_classes << " editable" if editable | |
|
59 | 61 | content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes) |
|
60 | 62 | end |
|
61 | 63 |
General Comments 0
You need to be logged in to leave comments.
Login now