@@ -22,6 +22,7 class JournalsController < ApplicationController | |||||
22 | if request.post? |
|
22 | if request.post? | |
23 | @journal.update_attributes(:notes => params[:notes]) if params[:notes] |
|
23 | @journal.update_attributes(:notes => params[:notes]) if params[:notes] | |
24 | @journal.destroy if @journal.details.empty? && @journal.notes.blank? |
|
24 | @journal.destroy if @journal.details.empty? && @journal.notes.blank? | |
|
25 | call_hook(:controller_journals_edit_post, { :journal => @journal, :params => params}) | |||
25 | respond_to do |format| |
|
26 | respond_to do |format| | |
26 | format.html { redirect_to :controller => 'issues', :action => 'show', :id => @journal.journalized_id } |
|
27 | format.html { redirect_to :controller => 'issues', :action => 'show', :id => @journal.journalized_id } | |
27 | format.js { render :action => 'update' } |
|
28 | format.js { render :action => 'update' } |
@@ -1,6 +1,7 | |||||
1 | <% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %> |
|
1 | <% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %> | |
2 | <%= text_area_tag :notes, @journal.notes, :class => 'wiki-edit', |
|
2 | <%= text_area_tag :notes, @journal.notes, :class => 'wiki-edit', | |
3 | :rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %> |
|
3 | :rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %> | |
|
4 | <%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %> | |||
4 | <p><%= submit_tag l(:button_save) %> |
|
5 | <p><%= submit_tag l(:button_save) %> | |
5 | <%= link_to l(:button_cancel), '#', :onclick => "Element.remove('journal-#{@journal.id}-form'); " + |
|
6 | <%= link_to l(:button_cancel), '#', :onclick => "Element.remove('journal-#{@journal.id}-form'); " + | |
6 | "Element.show('journal-#{@journal.id}-notes'); return false;" %></p> |
|
7 | "Element.show('journal-#{@journal.id}-notes'); return false;" %></p> |
General Comments 0
You need to be logged in to leave comments.
Login now