Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
96bbd942
Commit
96bbd942
authored
Jul 15, 2010
by
Tim Felgentreff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adjust for acts_as_journalized
parent
7d4d87a9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
3 additions
and
67 deletions
+3
-67
issues_controller.rb
app/controllers/issues_controller.rb
+3
-5
journals_controller.rb
app/controllers/journals_controller.rb
+0
-41
_notes_form.rhtml
app/views/journals/_notes_form.rhtml
+0
-8
edit.rjs
app/views/journals/edit.rjs
+0
-3
update.rjs
app/views/journals/update.rjs
+0
-10
No files found.
app/controllers/issues_controller.rb
View file @
96bbd942
...
...
@@ -179,8 +179,7 @@ class IssuesController < ApplicationController
if
@issue
.
save_issue_with_child_records
(
params
,
@time_entry
)
render_attachment_warning_if_needed
(
@issue
)
# FIXME: current_journal.new_record? won't work no more
flash
[
:notice
]
=
l
(
:notice_successful_update
)
unless
@issue
.
current_journal
.
new_record?
flash
[
:notice
]
=
l
(
:notice_successful_update
)
unless
@issue
.
current_journal
==
@journal
respond_to
do
|
format
|
format
.
html
{
redirect_back_or_default
({
:action
=>
'show'
,
:id
=>
@issue
})
}
...
...
@@ -189,8 +188,7 @@ class IssuesController < ApplicationController
end
else
render_attachment_warning_if_needed
(
@issue
)
# FIXME: current_journal.new_record? won't work no more
flash
[
:notice
]
=
l
(
:notice_successful_update
)
unless
@issue
.
current_journal
.
new_record?
flash
[
:notice
]
=
l
(
:notice_successful_update
)
unless
@issue
.
current_journal
==
@journal
@journal
=
@issue
.
current_journal
respond_to
do
|
format
|
...
...
@@ -445,7 +443,7 @@ private
attrs
.
delete
(
:status_id
)
unless
@allowed_statuses
.
detect
{
|
s
|
s
.
id
.
to_s
==
attrs
[
:status_id
].
to_s
}
@issue
.
safe_attributes
=
attrs
end
@journal
=
@issue
.
current_journal
end
# TODO: Refactor, lots of extra code in here
...
...
app/controllers/journals_controller.rb
deleted
100644 → 0
View file @
7d4d87a9
# redMine - project management software
# Copyright (C) 2006-2008 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class
JournalsController
<
ApplicationController
before_filter
:find_journal
def
edit
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'
}
end
end
end
private
def
find_journal
@journal
=
Journal
.
find
(
params
[
:id
])
(
render_403
;
return
false
)
unless
@journal
.
editable_by?
(
User
.
current
)
@project
=
@journal
.
journalized
.
project
rescue
ActiveRecord
::
RecordNotFound
render_404
end
end
app/views/journals/_notes_form.rhtml
deleted
100644 → 0
View file @
7d4d87a9
<%
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>
<%
end
%>
app/views/journals/edit.rjs
deleted
100644 → 0
View file @
7d4d87a9
page.hide "journal-#{@journal.id}-notes"
page.insert_html :after, "journal-#{@journal.id}-notes",
:partial => 'notes_form'
app/views/journals/update.rjs
deleted
100644 → 0
View file @
7d4d87a9
if @journal.frozen?
# journal was destroyed
page.remove "change-#{@journal.id}"
else
page.replace "journal-#{@journal.id}-notes", render_notes(@journal.issue, @journal, :reply_links => authorize_for('issues', 'edit'))
page.show "journal-#{@journal.id}-notes"
page.remove "journal-#{@journal.id}-form"
end
call_hook(:view_journals_update_rjs_bottom, { :page => page, :journal => @journal })
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment