From ff1cbbc53272c0d9c862966980cfe52cab931992 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 14 Dec 2011 08:58:35 +0200 Subject: [PATCH] Issue restyle --- app/views/issues/_form.html.haml | 91 ++++++++++++++++++-------------- spec/requests/issues_spec.rb | 2 +- 2 files changed, 52 insertions(+), 41 deletions(-) diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index c5999334dab..64cff087f9f 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -1,45 +1,56 @@ %div.issue-form-holder - .issue-show-holder.ui-box - %h3 - = @issue.new_record? ? "New issue" : "Edit Issue ##{@issue.id}" - - unless @issue.new_record? - .right - - if @issue.closed - %span.tag.high Resolved - - else - %span.tag.today Open - = form_for [@project, @issue], :remote => "true" do |f| - .data - %table.no-borders - -if @issue.errors.any? - %tr - %td Errors - %td - #error_explanation - - @issue.errors.full_messages.each do |msg| - %span= msg - %br + = form_for [@project, @issue], :remote => request.xhr? do |f| + %div + %span.entity-info + - if request.xhr? + = link_to "#back", :onclick => "backToIssues();" do + .entity-button + Back + %i + - else + - if @issue.new_record? + = link_to project_issues_path(@project) do + .entity-button + Back + %i + - else + = link_to project_issue_path(@project, @issue) do + .entity-button + Back + %i + + %h2= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" - %tr - %td= f.label :title - %td= f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255 + %hr + %table.no-borders + -if @issue.errors.any? + %tr + %td{:colspan => 2} + #error_explanation + - @issue.errors.full_messages.each do |msg| + %span= msg + %br - %tr - %td= f.label :assignee_id - %td= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) - %tr - %td= f.label :critical, "Critical" - %td= f.check_box :critical - - - unless @issue.new_record? - %tr - %td= f.label :closed - %td= f.check_box :closed - .buttons - = f.submit 'Save', :class => "grey-button" + %tr + %td= f.label :assignee_id + %td= f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) + + %tr + %td= f.label :critical, "Critical" + %td= f.check_box :critical + + - unless @issue.new_record? + %tr + %td= f.label :closed + %td= f.check_box :closed + + = f.text_area :title, :style => "width:718px; height:100px", :maxlength => 255 + %br + %br + .merge-tabs + = f.submit 'Save', :class => "grey-button" +   + - unless @issue.new_record? .right - - if request.xhr? - = link_to_function "Back", "backToIssues();", :class => "grey-button" - - else - = link_to "Back", [@project, @issue], :class => "grey-button" + = link_to 'Remove', [@project, @issue], :confirm => 'Are you sure?', :method => :delete, :class => "red-button" diff --git a/spec/requests/issues_spec.rb b/spec/requests/issues_spec.rb index a2ad68d0cb9..732723c14dc 100644 --- a/spec/requests/issues_spec.rb +++ b/spec/requests/issues_spec.rb @@ -96,7 +96,7 @@ describe "Issues" do end it "should open new issue form" do - page.should have_content("New issue") + page.should have_content("New Issue") end describe "fill in" do -- GitLab