@review = Review.new
@review.rule_failure_id = params[:violation_id]
@review.user = current_user
+ @review.severity = Review.default_severity
@review_comment = ReviewComment.new
@review_comment.review_text = ""
render :partial => "form"
validates_presence_of :review_type, :message => "can't be empty"
validates_presence_of :status, :message => "can't be empty"
+ INFO = "info"
+ MINOR = "minor"
+ MAJOR = "major"
+ CRITICAL = "critical"
+ BLOCKER = "blocker"
+
+
+ def self.default_severity
+ return MAJOR
+ end
+
+ def self.severity_options
+ severity_ops = []
+ severity_ops << ["Info", INFO]
+ severity_ops << ["Minor", MINOR]
+ severity_ops << ["Major", MAJOR]
+ severity_ops << ["Critical", CRITICAL]
+ severity_ops << ["Blocker", BLOCKER]
+ return severity_ops
+ end
+
end
<%= f.hidden_field :rule_failure_id %>
Review made by: <%= @review.user.name -%>
<br/>
- Severity: <%= f.text_field :severity %>
+ Severity:
+ <%= select_tag "review[severity]", options_for_select(Review.severity_options, @review.severity) %>
<br/>
Comment:
<br/>