summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-01-20 11:31:41 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-01-20 11:31:41 +0000
commite2a999743e972f56dbd0e9b20bb7facb9a4a672d (patch)
tree1670e0e4bd5294d245a6537240106e1a05d4105b /app/helpers
parent936aceb8f56152b56edffa7837891145f978d068 (diff)
downloadredmine-e2a999743e972f56dbd0e9b20bb7facb9a4a672d.tar.gz
redmine-e2a999743e972f56dbd0e9b20bb7facb9a4a672d.zip
Code cleanup.
git-svn-id: http://svn.redmine.org/redmine/trunk@15073 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/journals_helper.rb20
1 files changed, 9 insertions, 11 deletions
diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb
index 00194dbd0..0b57e1acb 100644
--- a/app/helpers/journals_helper.rb
+++ b/app/helpers/journals_helper.rb
@@ -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