<% # Code Review plugin for Redmine # Copyright (C) 2009-2013 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. -%>

<%= l(:label_line_number, :line => @review.line) %>

<%= form_for @review,:as => :review, :url => {:controller => 'code_review', :action => 'new', :id=>@project}, :html => {:id => 'review_form'} do |f| %> <%= error_messages_for 'review' %> <%= error_messages_for 'issue' %> <%= error_messages_for 'relation' %> <%= f.hidden_field(:change_id) %> <%= f.hidden_field(:line) %> <%= hidden_field_tag(:action_type, @review.action_type) %> <%= hidden_field_tag(:rev, @review.revision) %> <%= hidden_field_tag(:rev_to, @review.rev_to) %> <%= hidden_field_tag(:path, @review.path) %> <%= hidden_field_tag(:file_count, @review.file_count) %> <%= hidden_field_tag(:attachment_id, @review.attachment_id) %> <%= hidden_field_tag(:repository_id, @repository_id) %> <%= hidden_field_tag(:diff_all, @review.diff_all) %>

<%= f.text_field :subject, :size => 70, :required => true %>

<% if @setting.tracker_in_review_dialog %>

<%= select :issue, :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %>

<% end %>

<%= f.text_field :parent_id, :size => 10 %> <% if @parent_candidate %> <%= raw l(:label_parent_suggestion, {:issue_id => link_to_issue(@parent_candidate)}) %> <% end %>

<% @issue.custom_field_values.each do |value| %> <% next unless value.required? -%>

<%= custom_field_tag_with_label :issue, value %>

<% end %>

<%= f.text_area :comment, :cols => 30, :rows => 12, :accesskey => accesskey(:edit), :class => 'wiki-edit' %>

<%= select :issue, :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %>

<% unless @project.issue_categories.empty? %>

<%= select :issue, :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>

<% end %> <% unless @issue.assignable_versions.empty? %>

<%= select :issue, :fixed_version_id, (@issue.assignable_versions.collect {|v| [v.name, v.id]}), :include_blank => true, :selected => @default_version_id %>

<% end %> <% @allowed_statuses = @issue.new_statuses_allowed_to(User.current) -%> <% if @issue.new_record? || @allowed_statuses.any? %>

<%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %>

<% else %>

<%= h(@issue.status.name) %>

<% end %>

<% submit_url = url_for(:controller => 'code_review', :action => 'new', :id=>@project) %> <%= button_to_function l(:button_apply), "$('#review-form').load('#{submit_url}', $('#review_form').serialize2json())" %> <%= preview_link({ :controller => 'code_review', :action => 'preview', :id => @project}, 'review_form') %>

<%= wikitoolbar_for 'review_comment' %> <% end %>