Browse Source

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
tags/0.9.0
Eric Davis 15 years ago
parent
commit
da98386bf7

+ 1
- 0
app/controllers/journals_controller.rb View File

@@ -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
- 0
app/views/journals/_notes_form.rhtml View File

@@ -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>

+ 2
- 0
app/views/journals/update.rjs View File

@@ -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…
Cancel
Save