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
68ae2d0d
Commit
68ae2d0d
authored
Sep 15, 2010
by
Tim Felgentreff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change issue specific journal query and show_details for journal helper
parent
6863c003
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
28 deletions
+27
-28
issues_controller.rb
app/controllers/issues_controller.rb
+1
-1
issues_helper.rb
app/helpers/issues_helper.rb
+2
-3
query.rb
app/models/query.rb
+2
-2
changes.rxml
app/views/issues/changes.rxml
+1
-1
pdf.rb
lib/redmine/export/pdf.rb
+1
-1
issues_helper_test.rb
test/unit/helpers/issues_helper_test.rb
+20
-20
No files found.
app/controllers/issues_controller.rb
View file @
68ae2d0d
...
@@ -103,7 +103,7 @@ class IssuesController < ApplicationController
...
@@ -103,7 +103,7 @@ class IssuesController < ApplicationController
sort_update
(
@query
.
sortable_columns
)
sort_update
(
@query
.
sortable_columns
)
if
@query
.
valid?
if
@query
.
valid?
@journals
=
@query
.
journals
(
:order
=>
"
#{
Journal
.
table_name
}
.created_on
DESC"
,
@journals
=
@query
.
issue_journals
(
:order
=>
"
#{
Journal
.
table_name
}
.created_at
DESC"
,
:limit
=>
25
)
:limit
=>
25
)
end
end
@title
=
(
@project
?
@project
.
name
:
Setting
.
app_title
)
+
": "
+
(
@query
.
new_record?
?
l
(:
label_changes_details
)
:
@query
.
name
)
@title
=
(
@project
?
@project
.
name
:
Setting
.
app_title
)
+
": "
+
(
@query
.
new_record?
?
l
(:
label_changes_details
)
:
@query
.
name
)
...
...
app/helpers/issues_helper.rb
View file @
68ae2d0d
...
@@ -160,9 +160,8 @@ module IssuesHelper
...
@@ -160,9 +160,8 @@ module IssuesHelper
export
export
end
end
# FIXME: This is not working as before
def
show_detail
(
journal
,
detail
,
html
=
true
)
def
show_detail
(
journal
,
html
=
true
)
journal
.
render_detail
(
detail
,
html
)
journal
.
render_detail
(
journal
.
details
.
first
,
html
)
end
end
def
gantt_zoom_link
(
gantt
,
in_or_out
)
def
gantt_zoom_link
(
gantt
,
in_or_out
)
...
...
app/models/query.rb
View file @
68ae2d0d
...
@@ -489,8 +489,8 @@ class Query < ActiveRecord::Base
...
@@ -489,8 +489,8 @@ class Query < ActiveRecord::Base
# Returns the journals
# Returns the journals
# Valid options are :order, :offset, :limit
# Valid options are :order, :offset, :limit
def
journals
(
options
=
{})
def
issue_
journals
(
options
=
{})
Journal
.
find
:all
,
:include
=>
[
:user
,
:journaled
],
IssueJournal
.
find
:all
,
:joins
=>
[
:user
,
{
:issue
=>
[
:project
,
:author
,
:tracker
,
:status
]}
],
:conditions
=>
statement
,
:conditions
=>
statement
,
:order
=>
options
[
:order
],
:order
=>
options
[
:order
],
:limit
=>
options
[
:limit
],
:limit
=>
options
[
:limit
],
...
...
app/views/issues/changes.rxml
View file @
68ae2d0d
...
@@ -20,7 +20,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
...
@@ -20,7 +20,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.content "type" => "html" do
xml.content "type" => "html" do
xml.text! '<ul>'
xml.text! '<ul>'
change.details.each do |detail|
change.details.each do |detail|
xml.text! '<li>' + show_detail(detail, false) + '</li>'
xml.text! '<li>' + show_detail(
change,
detail, false) + '</li>'
end
end
xml.text! '</ul>'
xml.text! '</ul>'
xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
...
...
lib/redmine/export/pdf.rb
View file @
68ae2d0d
...
@@ -286,7 +286,7 @@ module Redmine
...
@@ -286,7 +286,7 @@ module Redmine
pdf
.
Ln
pdf
.
Ln
pdf
.
SetFontStyle
(
'I'
,
8
)
pdf
.
SetFontStyle
(
'I'
,
8
)
for
detail
in
journal
.
details
for
detail
in
journal
.
details
pdf
.
Cell
(
190
,
5
,
"- "
+
show_detail
(
detail
,
true
))
pdf
.
Cell
(
190
,
5
,
"- "
+
show_detail
(
journal
,
detail
,
true
))
pdf
.
Ln
pdf
.
Ln
end
end
if
journal
.
notes?
if
journal
.
notes?
...
...
test/unit/helpers/issues_helper_test.rb
View file @
68ae2d0d
...
@@ -47,25 +47,25 @@ class IssuesHelperTest < HelperTestCase
...
@@ -47,25 +47,25 @@ class IssuesHelperTest < HelperTestCase
context
"IssuesHelper#show_detail"
do
context
"IssuesHelper#show_detail"
do
context
"with no_html"
do
context
"with no_html"
do
should
'show a changing attribute'
do
should
'show a changing attribute'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
40
,
100
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
40
,
100
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done changed from 40 to 100"
,
show_detail
(
@
detail
,
true
)
assert_equal
"% Done changed from 40 to 100"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
should
'show a new attribute'
do
should
'show a new attribute'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
nil
,
100
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
nil
,
100
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done set to 100"
,
show_detail
(
@
detail
,
true
)
assert_equal
"% Done set to 100"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
should
'show a deleted attribute'
do
should
'show a deleted attribute'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
50
,
nil
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
50
,
nil
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done deleted (50)"
,
show_detail
(
@
detail
,
true
)
assert_equal
"% Done deleted (50)"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
end
end
context
"with html"
do
context
"with html"
do
should
'show a changing attribute with HTML highlights'
do
should
'show a changing attribute with HTML highlights'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
40
,
100
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
40
,
100
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
detail
,
false
)
@response
.
body
=
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
false
)
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'i'
,
:text
=>
'40'
assert_select
'i'
,
:text
=>
'40'
...
@@ -73,16 +73,16 @@ class IssuesHelperTest < HelperTestCase
...
@@ -73,16 +73,16 @@ class IssuesHelperTest < HelperTestCase
end
end
should
'show a new attribute with HTML highlights'
do
should
'show a new attribute with HTML highlights'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
nil
,
100
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
nil
,
100
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
detail
,
false
)
@response
.
body
=
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
false
)
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'i'
,
:text
=>
'100'
assert_select
'i'
,
:text
=>
'100'
end
end
should
'show a deleted attribute with HTML highlights'
do
should
'show a deleted attribute with HTML highlights'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
50
,
nil
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
50
,
nil
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
detail
,
false
)
@response
.
body
=
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
false
)
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'strike'
do
assert_select
'strike'
do
...
@@ -93,25 +93,25 @@ class IssuesHelperTest < HelperTestCase
...
@@ -93,25 +93,25 @@ class IssuesHelperTest < HelperTestCase
context
"with a start_date attribute"
do
context
"with a start_date attribute"
do
should
"format the current date"
do
should
"format the current date"
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"start_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"start_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/31/2010"
,
show_detail
(
@
detail
,
true
)
assert_match
"01/31/2010"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
should
"format the old date"
do
should
"format the old date"
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"start_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"start_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/01/2010"
,
show_detail
(
@
detail
,
true
)
assert_match
"01/01/2010"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
end
end
context
"with a due_date attribute"
do
context
"with a due_date attribute"
do
should
"format the current date"
do
should
"format the current date"
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"due_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"due_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/31/2010"
,
show_detail
(
@
detail
,
true
)
assert_match
"01/31/2010"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
should
"format the old date"
do
should
"format the old date"
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"due_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"due_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/01/2010"
,
show_detail
(
@
detail
,
true
)
assert_match
"01/01/2010"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
end
end
...
...
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