diff --git a/README.ja.md b/README.ja.md
index 2e465bd..92806b2 100644
--- a/README.ja.md
+++ b/README.ja.md
@@ -126,7 +126,9 @@ ViewCustomize = {
]
},
"issue": {
- "id": 1
+ "id": 1,
+ "author": {"id": 2, "name": "John Smith"},
+ "lastUpdatedBy": {"id": 1, "name": "Redmine Admin"}
}
}
}
diff --git a/README.md b/README.md
index 1264093..f609142 100644
--- a/README.md
+++ b/README.md
@@ -131,7 +131,9 @@ ViewCustomize = {
]
},
"issue": {
- "id": 1
+ "id": 1,
+ "author": {"id": 2, "name": "John Smith"},
+ "lastUpdatedBy": {"id": 1, "name": "Redmine Admin"}
}
}
}
diff --git a/Vagrantfile b/Vagrantfile
index f3d6c93..5fe2f3e 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -1,5 +1,5 @@
Vagrant.configure("2") do |config|
- config.vm.box = "onozaty/redmine-4.1"
+ config.vm.box = "onozaty/redmine-5.0"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/var/lib/redmine/plugins/view_customize", create: true, mount_options: ['dmode=755','fmode=655']
diff --git a/init.rb b/init.rb
index 42bec97..e2d6039 100644
--- a/init.rb
+++ b/init.rb
@@ -3,7 +3,7 @@
name 'View Customize plugin'
author 'onozaty'
description 'View Customize plugin for Redmine'
- version '3.1.0'
+ version '3.2.0'
url 'https://github.com/onozaty/redmine-view-customize'
author_url 'https://github.com/onozaty'
diff --git a/lib/redmine_view_customize/view_hook.rb b/lib/redmine_view_customize/view_hook.rb
index 88c132f..c28ba8f 100644
--- a/lib/redmine_view_customize/view_hook.rb
+++ b/lib/redmine_view_customize/view_hook.rb
@@ -27,8 +27,23 @@ def view_issues_form_details_bottom(context={})
def view_issues_show_details_bottom(context={})
+ issue = {
+ "id" => context[:issue].id,
+ "author" => {
+ "id" => context[:issue].author.id,
+ "name" => context[:issue].author.name
+ }
+ }
+
+ if context[:issue].last_updated_by.present?
+ issue["lastUpdatedBy"] = {
+ "id" => context[:issue].last_updated_by.id,
+ "name" => context[:issue].last_updated_by.name
+ }
+ end
+
html = "\n\n"
html << create_view_customize_html(context, ViewCustomize::INSERTION_POSITION_ISSUE_SHOW)
diff --git a/test/unit/view_customize_view_hook_test.rb b/test/unit/view_customize_view_hook_test.rb
index f9b6596..531c547 100644
--- a/test/unit/view_customize_view_hook_test.rb
+++ b/test/unit/view_customize_view_hook_test.rb
@@ -3,7 +3,7 @@
class ViewCustomizeViewHookTest < ActiveSupport::TestCase
fixtures :projects, :users, :email_addresses, :user_preferences, :members, :member_roles, :roles,
- :issues, :custom_fields, :custom_fields_projects, :custom_values,
+ :issues, :journals, :custom_fields, :custom_fields_projects, :custom_values,
:view_customizes
class Request
@@ -133,13 +133,13 @@ def test_view_issues_form_details_bottom
def test_view_issues_show_details_bottom
User.current = User.find(1)
- issue = Issue.find(1)
+ issue = Issue.find(4)
expected = <
//
@@ -148,7 +148,30 @@ def test_view_issues_show_details_bottom
HTML
- html = @hook.view_issues_show_details_bottom({:request => Request.new("/issues/1"), :issue => issue, :project => @project_onlinestore})
+ html = @hook.view_issues_show_details_bottom({:request => Request.new("/issues/4"), :issue => issue, :project => @project_onlinestore})
+ assert_equal expected, html
+
+ end
+
+ def test_view_issues_show_details_bottom_with_journals
+
+ User.current = User.find(1)
+ issue = Issue.find(6)
+
+ expected = <
+//
+
+
+
+HTML
+
+ html = @hook.view_issues_show_details_bottom({:request => Request.new("/issues/6"), :issue => issue, :project => @project_onlinestore})
assert_equal expected, html
end