mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 07:21:12 +00:00
Code cleanup.
git-svn-id: http://svn.redmine.org/redmine/trunk@15073 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
936aceb8f5
commit
e2a999743e
@ -37,17 +37,20 @@ module JournalsHelper
|
||||
:title => l(:button_quote),
|
||||
:class => 'icon-only icon-comment'
|
||||
) if options[:reply_links]
|
||||
links << link_to_in_place_notes_editor('', "journal-#{journal.id}-notes",
|
||||
{ :controller => 'journals', :action => 'edit', :id => journal, :format => 'js' },
|
||||
:title => l(:button_edit),
|
||||
:class => 'icon-only icon-edit'
|
||||
) if editable
|
||||
links << link_to('',
|
||||
{:controller => 'journals', :action => 'edit', :id => journal},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_edit),
|
||||
:class => 'icon-only icon-edit'
|
||||
) if editable
|
||||
links << link_to('',
|
||||
{:controller => 'journals', :action => 'edit', :id => journal, :notes => ""},
|
||||
:remote => true,
|
||||
:method => :post, :data => {:confirm => l(:text_are_you_sure)},
|
||||
:title => l(:button_delete),
|
||||
:class => 'icon-only icon-del') if editable
|
||||
:class => 'icon-only icon-del'
|
||||
) if editable
|
||||
end
|
||||
content << content_tag('div', links.join(' ').html_safe, :class => 'contextual') unless links.empty?
|
||||
content << textilizable(journal, :notes)
|
||||
@ -55,9 +58,4 @@ module JournalsHelper
|
||||
css_classes << " editable" if editable
|
||||
content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes)
|
||||
end
|
||||
|
||||
def link_to_in_place_notes_editor(text, field_id, url, options={})
|
||||
onclick = "$.ajax({url: '#{url_for(url)}', type: 'get'}); return false;"
|
||||
link_to text, '#', options.merge(:onclick => onclick)
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user