Commit ff1cbbc53272c0d9c862966980cfe52cab931992
1 parent
7b4f5452
Exists in
master
and in
4 other branches
Issue restyle
Showing
2 changed files
with
52 additions
and
41 deletions
Show diff stats
app/views/issues/_form.html.haml
| 1 | %div.issue-form-holder | 1 | %div.issue-form-holder |
| 2 | - .issue-show-holder.ui-box | ||
| 3 | - %h3 | ||
| 4 | - = @issue.new_record? ? "New issue" : "Edit Issue ##{@issue.id}" | ||
| 5 | - - unless @issue.new_record? | ||
| 6 | - .right | ||
| 7 | - - if @issue.closed | ||
| 8 | - %span.tag.high Resolved | ||
| 9 | - - else | ||
| 10 | - %span.tag.today Open | ||
| 11 | - = form_for [@project, @issue], :remote => "true" do |f| | ||
| 12 | - .data | ||
| 13 | - %table.no-borders | ||
| 14 | - -if @issue.errors.any? | ||
| 15 | - %tr | ||
| 16 | - %td Errors | ||
| 17 | - %td | ||
| 18 | - #error_explanation | ||
| 19 | - - @issue.errors.full_messages.each do |msg| | ||
| 20 | - %span= msg | ||
| 21 | - %br | 2 | + = form_for [@project, @issue], :remote => request.xhr? do |f| |
| 3 | + %div | ||
| 4 | + %span.entity-info | ||
| 5 | + - if request.xhr? | ||
| 6 | + = link_to "#back", :onclick => "backToIssues();" do | ||
| 7 | + .entity-button | ||
| 8 | + Back | ||
| 9 | + %i | ||
| 10 | + - else | ||
| 11 | + - if @issue.new_record? | ||
| 12 | + = link_to project_issues_path(@project) do | ||
| 13 | + .entity-button | ||
| 14 | + Back | ||
| 15 | + %i | ||
| 16 | + - else | ||
| 17 | + = link_to project_issue_path(@project, @issue) do | ||
| 18 | + .entity-button | ||
| 19 | + Back | ||
| 20 | + %i | ||
| 21 | + | ||
| 22 | + %h2= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" | ||
| 22 | 23 | ||
| 23 | - %tr | ||
| 24 | - %td= f.label :title | ||
| 25 | - %td= f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255 | 24 | + %hr |
| 25 | + %table.no-borders | ||
| 26 | + -if @issue.errors.any? | ||
| 27 | + %tr | ||
| 28 | + %td{:colspan => 2} | ||
| 29 | + #error_explanation | ||
| 30 | + - @issue.errors.full_messages.each do |msg| | ||
| 31 | + %span= msg | ||
| 32 | + %br | ||
| 26 | 33 | ||
| 27 | - %tr | ||
| 28 | - %td= f.label :assignee_id | ||
| 29 | - %td= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) | ||
| 30 | 34 | ||
| 31 | - %tr | ||
| 32 | - %td= f.label :critical, "Critical" | ||
| 33 | - %td= f.check_box :critical | ||
| 34 | - | ||
| 35 | - - unless @issue.new_record? | ||
| 36 | - %tr | ||
| 37 | - %td= f.label :closed | ||
| 38 | - %td= f.check_box :closed | ||
| 39 | - .buttons | ||
| 40 | - = f.submit 'Save', :class => "grey-button" | 35 | + %tr |
| 36 | + %td= f.label :assignee_id | ||
| 37 | + %td= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) | ||
| 38 | + | ||
| 39 | + %tr | ||
| 40 | + %td= f.label :critical, "Critical" | ||
| 41 | + %td= f.check_box :critical | ||
| 42 | + | ||
| 43 | + - unless @issue.new_record? | ||
| 44 | + %tr | ||
| 45 | + %td= f.label :closed | ||
| 46 | + %td= f.check_box :closed | ||
| 47 | + | ||
| 48 | + = f.text_area :title, :style => "width:718px; height:100px", :maxlength => 255 | ||
| 49 | + %br | ||
| 50 | + %br | ||
| 51 | + .merge-tabs | ||
| 52 | + = f.submit 'Save', :class => "grey-button" | ||
| 53 | + | ||
| 54 | + - unless @issue.new_record? | ||
| 41 | .right | 55 | .right |
| 42 | - - if request.xhr? | ||
| 43 | - = link_to_function "Back", "backToIssues();", :class => "grey-button" | ||
| 44 | - - else | ||
| 45 | - = link_to "Back", [@project, @issue], :class => "grey-button" | 56 | + = link_to 'Remove', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "red-button" |
spec/requests/issues_spec.rb
| @@ -96,7 +96,7 @@ describe "Issues" do | @@ -96,7 +96,7 @@ describe "Issues" do | ||
| 96 | end | 96 | end |
| 97 | 97 | ||
| 98 | it "should open new issue form" do | 98 | it "should open new issue form" do |
| 99 | - page.should have_content("New issue") | 99 | + page.should have_content("New Issue") |
| 100 | end | 100 | end |
| 101 | 101 | ||
| 102 | describe "fill in" do | 102 | describe "fill in" do |