Added plugin hooks around Journal editing
* :controller_journals_edit_post * :view_journals_notes_form_after_notes * :view_journals_update_rjs_bottom git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2121 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f02717ab94
commit
da98386bf7
|
@ -22,6 +22,7 @@ class JournalsController < ApplicationController
|
|||
if request.post?
|
||||
@journal.update_attributes(:notes => params[:notes]) if params[:notes]
|
||||
@journal.destroy if @journal.details.empty? && @journal.notes.blank?
|
||||
call_hook(:controller_journals_edit_post, { :journal => @journal, :params => params})
|
||||
respond_to do |format|
|
||||
format.html { redirect_to :controller => 'issues', :action => 'show', :id => @journal.journalized_id }
|
||||
format.js { render :action => 'update' }
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %>
|
||||
<%= text_area_tag :notes, @journal.notes, :class => 'wiki-edit',
|
||||
:rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %>
|
||||
<%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %>
|
||||
<p><%= submit_tag l(:button_save) %>
|
||||
<%= link_to l(:button_cancel), '#', :onclick => "Element.remove('journal-#{@journal.id}-form'); " +
|
||||
"Element.show('journal-#{@journal.id}-notes'); return false;" %></p>
|
||||
|
|
|
@ -6,3 +6,5 @@ else
|
|||
page.show "journal-#{@journal.id}-notes"
|
||||
page.remove "journal-#{@journal.id}-form"
|
||||
end
|
||||
|
||||
call_hook(:view_journals_update_rjs_bottom, { :page => page, :journal => @journal })
|
||||
|
|
Loading…
Reference in New Issue