##// END OF EJS Templates
remove trailing white-spaces from app/controllers/journals_controller.rb....
Toshi MARUYAMA -
r6763:db1ddd5509a0
parent child
Show More
@@ -5,12 +5,12
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 #
8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 #
13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -22,7 +22,7 class JournalsController < ApplicationController
22 22 before_filter :authorize, :only => [:new, :edit, :diff]
23 23 accept_rss_auth :index
24 24 menu_item :issues
25
25
26 26 helper :issues
27 27 helper :custom_fields
28 28 helper :queries
@@ -34,9 +34,9 class JournalsController < ApplicationController
34 34 retrieve_query
35 35 sort_init 'id', 'desc'
36 36 sort_update(@query.sortable_columns)
37
37
38 38 if @query.valid?
39 @journals = @query.journals(:order => "#{Journal.table_name}.created_on DESC",
39 @journals = @query.journals(:order => "#{Journal.table_name}.created_on DESC",
40 40 :limit => 25)
41 41 end
42 42 @title = (@project ? @project.name : Setting.app_title) + ": " + (@query.new_record? ? l(:label_changes_details) : @query.name)
@@ -44,7 +44,7 class JournalsController < ApplicationController
44 44 rescue ActiveRecord::RecordNotFound
45 45 render_404
46 46 end
47
47
48 48 def diff
49 49 @issue = @journal.issue
50 50 if params[:detail_id].present?
@@ -55,7 +55,7 class JournalsController < ApplicationController
55 55 (render_404; return false) unless @issue && @detail
56 56 @diff = Redmine::Helpers::Diff.new(@detail.value, @detail.old_value)
57 57 end
58
58
59 59 def new
60 60 journal = Journal.find(params[:journal_id]) if params[:journal_id]
61 61 if journal
@@ -69,7 +69,7 class JournalsController < ApplicationController
69 69 text = text.to_s.strip.gsub(%r{<pre>((.|\s)*?)</pre>}m, '[...]')
70 70 content = "#{ll(Setting.default_language, :text_user_wrote, user)}\n> "
71 71 content << text.gsub(/(\r?\n|\r\n?)/, "\n> ") + "\n\n"
72
72
73 73 render(:update) { |page|
74 74 page.<< "$('notes').value = \"#{escape_javascript content}\";"
75 75 page.show 'update'
@@ -78,7 +78,7 class JournalsController < ApplicationController
78 78 page << "$('notes').scrollTop = $('notes').scrollHeight - $('notes').clientHeight;"
79 79 }
80 80 end
81
81
82 82 def edit
83 83 (render_403; return false) unless @journal.editable_by?(User.current)
84 84 if request.post?
@@ -93,15 +93,15 class JournalsController < ApplicationController
93 93 respond_to do |format|
94 94 format.html {
95 95 # TODO: implement non-JS journal update
96 render :nothing => true
96 render :nothing => true
97 97 }
98 98 format.js
99 99 end
100 100 end
101 101 end
102
102
103 103 private
104
104
105 105 def find_journal
106 106 @journal = Journal.find(params[:id])
107 107 @project = @journal.journalized.project
General Comments 0
You need to be logged in to leave comments. Login now