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
sort_update
(
@query
.
sortable_columns
)
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
)
end
@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
export
end
# FIXME: This is not working as before
def
show_detail
(
journal
,
html
=
true
)
journal
.
render_detail
(
journal
.
details
.
first
,
html
)
def
show_detail
(
journal
,
detail
,
html
=
true
)
journal
.
render_detail
(
detail
,
html
)
end
def
gantt_zoom_link
(
gantt
,
in_or_out
)
...
...
app/models/query.rb
View file @
68ae2d0d
...
...
@@ -489,8 +489,8 @@ class Query < ActiveRecord::Base
# Returns the journals
# Valid options are :order, :offset, :limit
def
journals
(
options
=
{})
Journal
.
find
:all
,
:include
=>
[
:user
,
:journaled
],
def
issue_
journals
(
options
=
{})
IssueJournal
.
find
:all
,
:joins
=>
[
:user
,
{
:issue
=>
[
:project
,
:author
,
:tracker
,
:status
]}
],
:conditions
=>
statement
,
:order
=>
options
[
:order
],
: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
xml.content "type" => "html" do
xml.text! '<ul>'
change.details.each do |detail|
xml.text! '<li>' + show_detail(detail, false) + '</li>'
xml.text! '<li>' + show_detail(
change,
detail, false) + '</li>'
end
xml.text! '</ul>'
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
pdf
.
Ln
pdf
.
SetFontStyle
(
'I'
,
8
)
for
detail
in
journal
.
details
pdf
.
Cell
(
190
,
5
,
"- "
+
show_detail
(
detail
,
true
))
pdf
.
Cell
(
190
,
5
,
"- "
+
show_detail
(
journal
,
detail
,
true
))
pdf
.
Ln
end
if
journal
.
notes?
...
...
test/unit/helpers/issues_helper_test.rb
View file @
68ae2d0d
...
...
@@ -47,25 +47,25 @@ class IssuesHelperTest < HelperTestCase
context
"IssuesHelper#show_detail"
do
context
"with no_html"
do
should
'show a changing attribute'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
40
,
100
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done changed from 40 to 100"
,
show_detail
(
@
detail
,
true
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
40
,
100
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done changed from 40 to 100"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
should
'show a new attribute'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
nil
,
100
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done set to 100"
,
show_detail
(
@
detail
,
true
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
nil
,
100
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done set to 100"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
should
'show a deleted attribute'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
50
,
nil
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done deleted (50)"
,
show_detail
(
@
detail
,
true
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
50
,
nil
]},
:journaled
=>
Issue
.
last
)
assert_equal
"% Done deleted (50)"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
context
"with html"
do
should
'show a changing attribute with HTML highlights'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
40
,
100
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
detail
,
false
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
40
,
100
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
false
)
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'i'
,
:text
=>
'40'
...
...
@@ -73,16 +73,16 @@ class IssuesHelperTest < HelperTestCase
end
should
'show a new attribute with HTML highlights'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
nil
,
100
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
detail
,
false
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
nil
,
100
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
false
)
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'i'
,
:text
=>
'100'
end
should
'show a deleted attribute with HTML highlights'
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
50
,
nil
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
detail
,
false
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"done_ratio"
=>
[
50
,
nil
]},
:journaled
=>
Issue
.
last
)
@response
.
body
=
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
false
)
assert_select
'strong'
,
:text
=>
'% Done'
assert_select
'strike'
do
...
...
@@ -93,25 +93,25 @@ class IssuesHelperTest < HelperTestCase
context
"with a start_date attribute"
do
should
"format the current date"
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"start_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/31/2010"
,
show_detail
(
@
detail
,
true
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"start_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/31/2010"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
should
"format the old date"
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"start_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/01/2010"
,
show_detail
(
@
detail
,
true
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"start_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/01/2010"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
end
context
"with a due_date attribute"
do
should
"format the current date"
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"due_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/31/2010"
,
show_detail
(
@
detail
,
true
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"due_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/31/2010"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
end
should
"format the old date"
do
@
detai
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"due_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/01/2010"
,
show_detail
(
@
detail
,
true
)
@
journa
l
=
IssueJournal
.
generate!
(
:changes
=>
{
"due_date"
=>
[
'2010-01-01'
,
'2010-01-31'
]},
:journaled
=>
Issue
.
last
)
assert_match
"01/01/2010"
,
show_detail
(
@
journal
,
@journal
.
details
.
to_a
.
first
,
true
)
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