Commit f1795a491145740235fd36560bf630d1773cf07a
1 parent
c9def945
Exists in
master
and in
4 other branches
Issues form improved, Show milestone for Issue show
Showing
4 changed files
with
76 additions
and
34 deletions
Show diff stats
app/assets/stylesheets/main.scss
... | ... | @@ -99,6 +99,11 @@ $hover: #FDF5D9; |
99 | 99 | @import "sections/commits.scss"; |
100 | 100 | |
101 | 101 | /** |
102 | + * Styles related to displaying issues | |
103 | + */ | |
104 | +@import "sections/issues.scss"; | |
105 | + | |
106 | +/** | |
102 | 107 | * This scss file redefine chozen selectbox styles for |
103 | 108 | * project Branch/Tag select element |
104 | 109 | */ | ... | ... |
... | ... | @@ -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 | 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 | 7 | = form_for [@project, @issue], :remote => request.xhr? do |f| |
3 | - %h3= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" | |
4 | - %hr | |
5 | 8 | -if @issue.errors.any? |
6 | 9 | .alert-message.block-message.error |
7 | 10 | %ul |
8 | 11 | - @issue.errors.full_messages.each do |msg| |
9 | 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 | 44 | .actions |
42 | 45 | - if @issue.new_record? | ... | ... |
app/views/issues/show.html.haml
... | ... | @@ -7,11 +7,11 @@ |
7 | 7 | %span.right |
8 | 8 | - if can?(current_user, :admin_project, @project) || @issue.author == current_user |
9 | 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 | 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 | 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 | 15 | Edit |
16 | 16 | |
17 | 17 | %br |
... | ... | @@ -39,7 +39,14 @@ |
39 | 39 | %cite.cgray and currently assigned to |
40 | 40 | = image_tag gravatar_icon(@issue.assignee_email), :width => 16, :class => "lil_av" |
41 | 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 | 50 | - if @issue.description.present? |
44 | 51 | .bottom_box_content |
45 | 52 | = preserve do | ... | ... |