Commit f1795a491145740235fd36560bf630d1773cf07a

Authored by Dmitriy Zaporozhets
1 parent c9def945

Issues form improved, Show milestone for Issue show

app/assets/stylesheets/main.scss
@@ -99,6 +99,11 @@ $hover: #FDF5D9; @@ -99,6 +99,11 @@ $hover: #FDF5D9;
99 @import "sections/commits.scss"; 99 @import "sections/commits.scss";
100 100
101 /** 101 /**
  102 + * Styles related to displaying issues
  103 + */
  104 +@import "sections/issues.scss";
  105 +
  106 +/**
102 * This scss file redefine chozen selectbox styles for 107 * This scss file redefine chozen selectbox styles for
103 * project Branch/Tag select element 108 * project Branch/Tag select element
104 */ 109 */
app/assets/stylesheets/sections/issues.scss 0 → 100644
@@ -0,0 +1,27 @@ @@ -0,0 +1,27 @@
  1 +.issue_form_box {
  2 + @extend .main_box;
  3 + .issue_title {
  4 + @extend .top_box_content;
  5 + .clearfix {
  6 + margin-bottom:0px;
  7 + input {
  8 + @extend .span8;
  9 + }
  10 + }
  11 + }
  12 + .issue_middle_block {
  13 + @extend .middle_box_content;
  14 + height:30px;
  15 + .issue_assignee {
  16 + @extend .span6;
  17 + float:left;
  18 + }
  19 + .issue_milestone {
  20 + @extend .span4;
  21 + float:left;
  22 + }
  23 + }
  24 + .issue_description {
  25 + @extend .bottom_box_content;
  26 + }
  27 +}
app/views/issues/_form.html.haml
1 %div.issue-form-holder 1 %div.issue-form-holder
  2 + %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"
  3 + - unless request.xhr?
  4 + .back_link
  5 + = link_to project_issue_path(@project, @issue) do
  6 + ← back to show page
2 = form_for [@project, @issue], :remote => request.xhr? do |f| 7 = form_for [@project, @issue], :remote => request.xhr? do |f|
3 - %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}"  
4 - %hr  
5 -if @issue.errors.any? 8 -if @issue.errors.any?
6 .alert-message.block-message.error 9 .alert-message.block-message.error
7 %ul 10 %ul
8 - @issue.errors.full_messages.each do |msg| 11 - @issue.errors.full_messages.each do |msg|
9 %li= msg 12 %li= msg
  13 + .issue_form_box
  14 + .issue_title
  15 + .clearfix
  16 + = f.label :title, "Issue Subject *"
  17 + .input
  18 + = f.text_field :title, :maxlength => 255, :class => "xxlarge"
  19 + .issue_middle_block
  20 + .issue_assignee
  21 + = f.label :assignee_id, "Assign to *"
  22 + .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Assign to user" })
  23 + .issue_milestone
  24 + = f.label :milestone_id
  25 + .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { :include_blank => "Select milestone" })
  26 +
  27 + .issue_description
  28 + .clearfix
  29 + = f.label :critical, "Critical"
  30 + .input= f.check_box :critical
  31 +
  32 + - unless @issue.new_record?
  33 + .clearfix
  34 + = f.label :closed
  35 + .input= f.check_box :closed
  36 + .clearfix
  37 + = f.label :description, "Issue Details"
  38 + .input
  39 + = f.text_area :description, :maxlength => 2000, :class => "xxlarge", :rows => 14
  40 + %p.hint Markdown is enabled.
10 41
11 - .clearfix  
12 - = f.label :title, "Issue Subject *"  
13 - .input  
14 - = f.text_field :title, :maxlength => 255, :class => "xxlarge"  
15 42
16 - .clearfix  
17 - = f.label :assignee_id, "Assign to *"  
18 - .input= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Assign to user" })  
19 -  
20 - .clearfix  
21 - = f.label :description, "Issue Details"  
22 - .input  
23 - = f.text_area :description, :maxlength => 2000, :class => "xxlarge", :rows => 10  
24 - %p.hint Markdown is enabled.  
25 -  
26 -  
27 - .clearfix  
28 - = f.label :milestone_id  
29 - .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { :include_blank => "Select milestone" })  
30 -  
31 -  
32 - .clearfix  
33 - = f.label :critical, "Critical"  
34 - .input= f.check_box :critical  
35 -  
36 - - unless @issue.new_record?  
37 - .clearfix  
38 - = f.label :closed  
39 - .input= f.check_box :closed  
40 43
41 .actions 44 .actions
42 - if @issue.new_record? 45 - if @issue.new_record?
app/views/issues/show.html.haml
@@ -7,11 +7,11 @@ @@ -7,11 +7,11 @@
7 %span.right 7 %span.right
8 - if can?(current_user, :admin_project, @project) || @issue.author == current_user 8 - if can?(current_user, :admin_project, @project) || @issue.author == current_user
9 - if @issue.closed 9 - if @issue.closed
10 - = link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn" 10 + = link_to 'Reopen', project_issue_path(@project, @issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "btn small"
11 - else 11 - else
12 - = link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "btn", :title => "Close Issue" 12 + = link_to 'Close', project_issue_path(@project, @issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "btn small", :title => "Close Issue"
13 - if can?(current_user, :admin_project, @project) || @issue.author == current_user 13 - if can?(current_user, :admin_project, @project) || @issue.author == current_user
14 - = link_to edit_project_issue_path(@project, @issue), :class => "btn" do 14 + = link_to edit_project_issue_path(@project, @issue), :class => "btn small" do
15 Edit 15 Edit
16 16
17 %br 17 %br
@@ -39,7 +39,14 @@ @@ -39,7 +39,14 @@
39 %cite.cgray and currently assigned to 39 %cite.cgray and currently assigned to
40 = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av" 40 = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av"
41 %strong.author= link_to_issue_assignee(@issue) 41 %strong.author= link_to_issue_assignee(@issue)
42 - 42 +
  43 + - if @issue.milestone
  44 + - milestone = @issue.milestone
  45 + %cite.cgray and attached to milestone
  46 + = link_to project_milestone_path(milestone.project, milestone) do
  47 + %strong
  48 + = truncate(milestone.title, :length => 20)
  49 +
43 - if @issue.description.present? 50 - if @issue.description.present?
44 .bottom_box_content 51 .bottom_box_content
45 = preserve do 52 = preserve do