Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/code_review/_show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<p>
<%= toggle_link l(:button_reply), "reply_#{@review.id}", :focus => 'reply_comment_' + @review.id.to_s %>
</p>
<%
<%
message_form_id = "message-form-#{@review.id}"
-%>
<div id="reply_<%= @review.id %>" style="display:none;" class="box">
Expand Down
25 changes: 8 additions & 17 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lib/code_review_issue_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
44 changes: 21 additions & 23 deletions lib/code_review_projects_helper_patch.rb
Original file line number Diff line number Diff line change
@@ -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