diff --git a/app/views/code_review/_show.html.erb b/app/views/code_review/_show.html.erb
index e381cf5..b9a5bda 100644
--- a/app/views/code_review/_show.html.erb
+++ b/app/views/code_review/_show.html.erb
@@ -146,7 +146,7 @@
<%= toggle_link l(:button_reply), "reply_#{@review.id}", :focus => 'reply_comment_' + @review.id.to_s %>
- <%
+ <%
message_form_id = "message-form-#{@review.id}"
-%>
diff --git a/config/routes.rb b/config/routes.rb
index f4bb5be..ffdffce 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,22 +1,13 @@
-# Code Review plugin for Redmine
-# Copyright (C) 2009-2012 Haruyuki Iida
-#
-# 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.
-
RedmineApp::Application.routes.draw do
#map.connect 'projects/:id/code_review/:action', :controller => 'code_review'
match 'projects/:id/code_review/:action', :controller => 'code_review', :via => [:get, :post]
match 'projects/:id/code_review_settings/:action', :controller => 'code_review_settings', :via => [:get, :post, :put, :patch]
+
+ get 'projects/:id/repository/revisions/:rev/:action(/*path)',
+ :controller => 'repositories',
+ :format => false,
+ :constraints => {
+ :action => /(browse|show|entry|raw|annotate|diff)/,
+ :rev => /[a-z0-9\.\-_]+/
+ }
end
diff --git a/lib/code_review_issue_hooks.rb b/lib/code_review_issue_hooks.rb
index aefd423..74cc2ea 100644
--- a/lib/code_review_issue_hooks.rb
+++ b/lib/code_review_issue_hooks.rb
@@ -17,7 +17,7 @@
class CodeReviewIssueHooks < Redmine::Hook::ViewListener
include RepositoriesHelper
- render_on :view_issues_show_details_bottom, :partial => 'code_review/issues_show_details_bottom'
+ render_on :view_issues_show_details_bottom, partial: 'code_review/issues_show_details_bottom'
def view_issues_show_details_bottom_org(context = {})
project = context[:project]
diff --git a/lib/code_review_projects_helper_patch.rb b/lib/code_review_projects_helper_patch.rb
index 06fa67c..2df957a 100644
--- a/lib/code_review_projects_helper_patch.rb
+++ b/lib/code_review_projects_helper_patch.rb
@@ -1,31 +1,29 @@
-# Code Review plugin for Redmine
-# Copyright (C) 2009-2011 Haruyuki Iida
-#
-# 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.
-
require_dependency 'projects_helper'
module ProjectsHelperMethodsCodeReview
- def project_settings_tabs
- tabs = super
- action = {:name => 'code_review', :controller => 'code_review_settings', :action => :show, :partial => 'code_review_settings/show', :label => :code_review}
+ def self.included(base)
+ base.send :include, InstanceMethods
- tabs << action if User.current.allowed_to?(action, @project)
+ base.class_eval do
+ alias_method :project_settings_tabs_without_code_review, :project_settings_tabs
+ alias_method :project_settings_tabs, :project_settings_tabs_with_code_review
+ end
+ end
- tabs
+ module InstanceMethods
+ def project_settings_tabs_with_code_review
+ tabs = project_settings_tabs_without_code_review
+ tabs.push({ name: 'code_review',
+ controller: 'code_review_settings',
+ action: :show,
+ partial: 'code_review_settings/show',
+ label: :code_review}) if User.current.allowed_to?(:show, @project)
+ tabs
+ end
end
end
-ProjectsHelper.prepend(ProjectsHelperMethodsCodeReview)
+unless ProjectsHelper.included_modules.include?(ProjectsHelperMethodsCodeReview)
+ ProjectsHelper.send(:include, ProjectsHelperMethodsCodeReview)
+end
+