From 7ac38b7a1ed401cfac6156f3efaa1bb6d7b67e43 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 6 Nov 2011 23:32:37 +0200 Subject: [PATCH 1/7] fixed duplicate on wall --- app/assets/javascripts/note.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/note.js b/app/assets/javascripts/note.js index 7acc81e5..ef5330b7 100644 --- a/app/assets/javascripts/note.js +++ b/app/assets/javascripts/note.js @@ -42,8 +42,10 @@ replace: prepend: function(id, html) { - this.last_id = id; - $("#notes-list").prepend(html); + if(id != this.last_id) { + this.last_id = id; + $("#notes-list").prepend(html); + } }, getNew: From 06e916743ef3359e1eb098c3c50422ac594fe1c4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 7 Nov 2011 00:24:09 +0200 Subject: [PATCH 2/7] lil css style --- app/assets/stylesheets/projects.css.scss | 3 +++ app/views/issues/_form.html.haml | 5 +---- app/views/notes/_form.html.haml | 9 ++++++--- public/.directory | 4 ++++ vendor/assets/stylesheets/jquery-ui/jquery-ui.css | 6 +++--- 5 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 public/.directory diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index 7dfd8b29..e5d39474 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -276,6 +276,9 @@ input.ssh_project_url { /** FORM INPUTS **/ .user_new, +.new_key, +.new_issue, +.new_note, .edit_user, .new_project, .new_snippet, diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index 80f19d62..025dc9bc 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -8,10 +8,7 @@ .span-8 = f.label :title = f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255 - -#.span-8 - -#= f.label :content - -#= f.text_area :content, :style => "width:450px; height:130px" - .span-8.append-bottom + .span-8 = f.label :assignee_id = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) .span-1 diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index 86f0b779..a0def20b 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -10,13 +10,16 @@ %div = f.label :note - %cite + %cite.cgray markdown supported + %br %br = f.text_area :note, :size => 255 - + %div.attach_holder + %br = f.label :attachment - %cite (less than 10 MB) + %cite.cgray (less than 10 MB) + %br %br = f.file_field :attachment diff --git a/public/.directory b/public/.directory new file mode 100644 index 00000000..8bb0b816 --- /dev/null +++ b/public/.directory @@ -0,0 +1,4 @@ +[Dolphin] +ShowPreview=true +Timestamp=2011,11,6,21,7,47 +Version=2 diff --git a/vendor/assets/stylesheets/jquery-ui/jquery-ui.css b/vendor/assets/stylesheets/jquery-ui/jquery-ui.css index a6b4c363..a94efee4 100644 --- a/vendor/assets/stylesheets/jquery-ui/jquery-ui.css +++ b/vendor/assets/stylesheets/jquery-ui/jquery-ui.css @@ -59,7 +59,7 @@ .ui-widget { font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #ffffff url(ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content { border: 1px solid #474D57; background: #ffffff url(ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { color: #222222; font-weight: bold; } .ui-widget-header a { color: #222222; } @@ -445,8 +445,8 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad * http://docs.jquery.com/UI/Dialog#theming */ .ui-dialog { position: absolute; padding: 0; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; background: #F7F7F7; color:#555; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0;} +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; background: #474D57; color:#eee; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; text-shadow: none;} .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; background:#eaeaea} .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } From c07d3dfc042fb795322d28523abd9628eccdf8f9 Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Mon, 7 Nov 2011 10:55:16 -0500 Subject: [PATCH 3/7] issue restyle example --- app/assets/stylesheets/projects.css.scss | 24 +++++++++++++ app/views/issues/_issues.html.haml | 7 +--- app/views/issues/_show.html.haml | 44 +++++++++++++++--------- 3 files changed, 53 insertions(+), 22 deletions(-) diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index e5d39474..3fe6b233 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -679,6 +679,30 @@ body.project-page table .commit { } } +#notes-list .note .delete-note { display:none; } +#notes-list .note:hover .delete-note { display:block; } + +#issues-table-holder .issue .action-links { + display:none; + a { + margin-left:10px; + } +} + +.issue-number { + float: left; + border-radius: 5px; + text-shadow: none; + background: rgba(0, 0, 0, 0.12); + text-align: center; + padding: 14px 8px; + width: 40px; + margin-right: 10px; + color: #444; +} + +#issues-table-holder .issue:hover .action-links { display:block; } + body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} body.project-page #notes-list .note {padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;} body.project-page #notes-list .note img{float: left; margin-right: 10px;} diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index d758fed5..5651883a 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -1,11 +1,6 @@ %table.round-borders#issues-table %thead - - if can?(current_user, :admin_issue, @project) && !params[:f] || params[:f] == "0" - %th - %th Assignee - %th ID - %th Title - %th Closed? + %th Issues - @issues.critical.each do |issue| = render(:partial => 'show', :locals => {:issue => issue}) diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index 72b99b04..9f2e90e2 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -1,26 +1,38 @@ %tr{ :id => dom_id(issue), :class => "issue #{issue.critical ? "critical" : ""}", :url => project_issue_path(@project, issue) } - - if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0") + -#- if can?(current_user, :admin_issue, @project) && (!params[:f] || params[:f] == "0") %td = image_tag "move.png" , :class => [:handle, :left] %td - = image_tag gravatar_icon(issue.assignee.email), :class => "left", :width => 40, :style => "padding:0 5px;" - = issue.assignee.name - %td ##{issue.id} - %td + %strong.issue-number= "##{issue.id}" + %span + = truncate(html_escape(issue.title), :length => fixed_mode? ? 100 : 200) + %br + %br + %div.note-author + %strong= issue.assignee.name + %cite.cgray + = time_ago_in_words(issue.updated_at) + ago + - if issue.critical + %span.tag.high critical + - if issue.today? + %span.tag.today today + .right.action-links + - if can? current_user, :write_issue, issue + - if issue.closed + = link_to 'Reopen', project_issue_path(@project, issue, :issue => {:closed => false }, :status_only => true), :method => :put, :class => "cgray", :remote => true + - else + = link_to 'Resolve', project_issue_path(@project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "cgray", :remote => true + - if can? current_user, :write_issue, issue + = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true + - if can?(current_user, :admin_issue, @project) || issue.author == current_user + = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}" + -#%td ##{issue.id} + -#%td = truncate(html_escape(issue.title), :length => 200) %br %br - - if issue.critical - %span.tag.high critical - - if issue.today? - %span.tag.today today - .right - - if can?(current_user, :admin_issue, @project) || issue.author == current_user - = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true - - if can?(current_user, :admin_issue, @project) || issue.author == current_user -   - = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}" -#- if issue.author == current_user -#%span.tag.yours yours @@ -28,7 +40,7 @@ -#%span.tag.notes -#= issue.notes.count -#notes - %td + -#%td - if can? current_user, :write_issue, @project = form_for([@project, issue], :remote => true) do |f| = f.check_box :closed, :onclick => "$(this).parent().submit();" From 60f083ad619731e1c959aa5ec15a0469a557b0da Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Mon, 7 Nov 2011 11:31:05 -0500 Subject: [PATCH 4/7] issues table header --- app/views/issues/_issues.html.haml | 12 +++---- app/views/issues/_show.html.haml | 20 ------------ app/views/issues/index.html.haml | 51 ++++++++++++++++-------------- app/views/issues/index.js.haml | 2 +- 4 files changed, 32 insertions(+), 53 deletions(-) diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index 5651883a..eb0cae66 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -1,9 +1,5 @@ -%table.round-borders#issues-table - %thead - %th Issues +- @issues.critical.each do |issue| + = render(:partial => 'show', :locals => {:issue => issue}) - - @issues.critical.each do |issue| - = render(:partial => 'show', :locals => {:issue => issue}) - - - @issues.non_critical.each do |issue| - = render(:partial => 'show', :locals => {:issue => issue}) +- @issues.non_critical.each do |issue| + = render(:partial => 'show', :locals => {:issue => issue}) diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index 9f2e90e2..94df0f53 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -27,23 +27,3 @@ = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true - if can?(current_user, :admin_issue, @project) || issue.author == current_user = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}" - -#%td ##{issue.id} - -#%td - = truncate(html_escape(issue.title), :length => 200) - %br - %br - - - -#- if issue.author == current_user - -#%span.tag.yours yours - -#- if issue.notes.count > 0 - -#%span.tag.notes - -#= issue.notes.count - -#notes - -#%td - - if can? current_user, :write_issue, @project - = form_for([@project, issue], :remote => true) do |f| - = f.check_box :closed, :onclick => "$(this).parent().submit();" - = hidden_field_tag :status_only, true - - else - = check_box_tag "closed", 1, issue.closed, :disabled => true diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index 21e455b9..355429c3 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -1,28 +1,31 @@ -%div - .top_panel_issues - - if can? current_user, :write_issue, @project - %div{:class => "left", :style => "margin-right: 10px;" } - = link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" - = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :left, :id => "issue_search_form" do - = hidden_field_tag :project_id, @project.id, { :id => 'project_id' } - = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } +%div#issues-table-holder + %table.round-borders#issues-table + %thead + %th + .top_panel_issues + - if can? current_user, :write_issue, @project + %div{:class => "left", :style => "margin-right: 10px;" } + = link_to 'New Issue', new_project_issue_path(@project), :remote => true, :class => "lbutton vm" + = form_tag search_project_issues_path(@project), :method => :get, :remote => true, :class => :left, :id => "issue_search_form" do + = hidden_field_tag :project_id, @project.id, { :id => 'project_id' } + = search_field_tag :issue_search, nil, { :placeholder => 'Search', :class => 'issue_search' } - .right.issues_filter - = form_tag project_issues_path(@project), :method => :get do - .left - = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status" - = label_tag "open_issues","Open" - .left - = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status" - = label_tag "closed_issues","Closed" - .left - = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status" - = label_tag "my_issues","To Me" - .left - = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status" - = label_tag "all_issues","All" + .right.issues_filter + = form_tag project_issues_path(@project), :method => :get do + .left + = radio_button_tag :f, 0, (params[:f] || "0") == "0", :onclick => "this.form.submit()", :id => "open_issues", :class => "status" + = label_tag "open_issues","Open" + .left + = radio_button_tag :f, 2, params[:f] == "2", :onclick => "this.form.submit()", :id => "closed_issues", :class => "status" + = label_tag "closed_issues","Closed" + .left + = radio_button_tag :f, 3, params[:f] == "3", :onclick => "this.form.submit()", :id => "my_issues", :class => "status" + = label_tag "my_issues","To Me" + .left + = radio_button_tag :f, 1, params[:f] == "1", :onclick => "this.form.submit()", :id => "all_issues", :class => "status" + = label_tag "all_issues","All" - #issues-table-holder= render "issues" + = render "issues" %br :javascript var href = $('.issue_search').parent().attr('action'); @@ -37,7 +40,7 @@ if (terms.length >= 2 || terms.length == 0) { $.get(href, { 'status': status, 'terms': terms, project: project_id }, function(response) { - $('#issues-table').html(response); + $('#issues-table tbody').html(response); setSortable(); }); } diff --git a/app/views/issues/index.js.haml b/app/views/issues/index.js.haml index bc18ac15..a08ffe5a 100644 --- a/app/views/issues/index.js.haml +++ b/app/views/issues/index.js.haml @@ -1,3 +1,3 @@ :plain - $('#issues-table-holder').html("#{escape_javascript(render('issues'))}"); + $('#issues-table tbody').html("#{escape_javascript(render('issues'))}"); setSortable(); From eb5fa8344e573851fa1c84a262de84ab379b0e59 Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Mon, 7 Nov 2011 20:21:42 +0200 Subject: [PATCH 5/7] correct padding in issue form and in profile form --- app/assets/stylesheets/style.scss | 11 +++++++++++ app/views/issues/_form.html.haml | 10 +++++----- app/views/profile/show.html.haml | 6 +++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/style.scss b/app/assets/stylesheets/style.scss index ec403eba..13f26d97 100755 --- a/app/assets/stylesheets/style.scss +++ b/app/assets/stylesheets/style.scss @@ -87,6 +87,17 @@ h2{margin: 1.5em 0} /* Forms */ input[type="text"]:focus, input[type="password"]:focus { outline: none; } input.text{border: 1px solid #ccc; border-radius: 4px; display: block; padding: 10px} + +.form-row{ + padding: 0px 0px 10px 0px; +} + +.form-row label{ + font-weight:bold; + display: inline-block; + padding: 0px 0px 5px 0px; +} + /* eo Forms */ /* Tables */ diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index 025dc9bc..ffcdc028 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -5,21 +5,21 @@ - @issue.errors.full_messages.each do |msg| %li= msg - .span-8 + .form-row = f.label :title = f.text_area :title, :style => "width:450px; height:100px", :maxlength => 255 - .span-8 + .form-row = f.label :assignee_id = f.select(:assignee_id, @project.users.all.collect {|p| [ p.name, p.id ] }, { :include_blank => "Select user" }) - .span-1 + .form-row = f.label :critical, "Critical" %br = f.check_box :critical - unless @issue.new_record? - .span-2.right + .form-row = f.label :closed %br = f.check_box :closed %hr - .span-6 + .form-row = f.submit 'Save', :class => "lbutton vm" diff --git a/app/views/profile/show.html.haml b/app/views/profile/show.html.haml index ef23a169..bf45f440 100644 --- a/app/views/profile/show.html.haml +++ b/app/views/profile/show.html.haml @@ -16,15 +16,15 @@ - @user.errors.full_messages.each do |msg| %li= msg - .div + .form-row = f.label :skype %br = f.text_field :skype - .div + .form-row = f.label :linkedin %br = f.text_field :linkedin - .div + .form-row = f.label :twitter %br = f.text_field :twitter From 9054f64c530625e5f6f555daf3f9d6a741c177bb Mon Sep 17 00:00:00 2001 From: Aleksei Kvitinskii Date: Mon, 7 Nov 2011 20:37:32 +0200 Subject: [PATCH 6/7] correct padding in user, keys, password forms --- app/views/admin/users/_form.html.haml | 72 +++++++++++++-------------- app/views/admin/users/index.html.haml | 1 + app/views/keys/_form.html.haml | 6 +-- app/views/profile/password.html.haml | 4 +- 4 files changed, 41 insertions(+), 42 deletions(-) diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 51b5d5c7..06e5be19 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -7,44 +7,42 @@ - @admin_user.errors.full_messages.each do |msg| %li= msg - .span-24 - .span-11.colborder - .field - = f.label :name - %br - = f.text_field :name - .field - = f.label :email - %br - = f.text_field :email - .field - = f.label :password - %br - = f.password_field :password - .field - = f.label :password_confirmation - %br - = f.password_field :password_confirmation - .field.prepend-top - = f.check_box :admin - = f.label :admin - .span-11 - .field.prepend-top - = f.text_field :projects_limit, :class => "small_input" - = f.label :projects_limit + .form-row + = f.label :name + %br + = f.text_field :name + .form-row + = f.label :email + %br + = f.text_field :email + .form-row + = f.label :password + %br + = f.password_field :password + .form-row + = f.label :password_confirmation + %br + = f.password_field :password_confirmation + .form-row + = f.check_box :admin + = f.label :admin - .field - = f.label :skype - %br - = f.text_field :skype - .field - = f.label :linkedin - %br - = f.text_field :linkedin - .field - = f.label :twitter - %br - = f.text_field :twitter + .form-row + = f.text_field :projects_limit, :class => "small_input" + = f.label :projects_limit + + .form-row + = f.label :skype + %br + = f.text_field :skype + .form-row + = f.label :linkedin + %br + = f.text_field :linkedin + .form-row + = f.label :twitter + %br + = f.text_field :twitter .clear %br .actions diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index cbec1060..e12cfc77 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -21,4 +21,5 @@ %br = paginate @admin_users + = link_to 'New User', new_admin_user_path diff --git a/app/views/keys/_form.html.haml b/app/views/keys/_form.html.haml index 7d3e14ef..a49164cf 100644 --- a/app/views/keys/_form.html.haml +++ b/app/views/keys/_form.html.haml @@ -5,12 +5,12 @@ - @key.errors.full_messages.each do |msg| %li= msg - .span-6 + .form-row = f.label :title = f.text_field :title, :style => "width:300px" - .span-6 + .form-row = f.label :key = f.text_area :key, :style => "width:300px; height:130px" - .span-6 + .form-row = f.submit 'Save', :class => "lbutton vm" diff --git a/app/views/profile/password.html.haml b/app/views/profile/password.html.haml index f77d3855..3e82143d 100644 --- a/app/views/profile/password.html.haml +++ b/app/views/profile/password.html.haml @@ -7,11 +7,11 @@ - @user.errors.full_messages.each do |msg| %li= msg - .div + .form-row = f.label :password %br = f.password_field :password - .div + .form-row = f.label :password_confirmation %br = f.password_field :password_confirmation From 67b9fa51dcdf3d5954b83f6f162763349d1e662a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 7 Nov 2011 22:31:51 +0200 Subject: [PATCH 7/7] fixed tests --- app/controllers/issues_controller.rb | 1 + app/views/issues/_show.html.haml | 2 +- app/views/issues/create.js.haml | 1 + spec/requests/issues_spec.rb | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 7ff1ccb3..508cfc39 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -47,6 +47,7 @@ class IssuesController < ApplicationController def create @issue = @project.issues.new(params[:issue]) @issue.author = current_user + if @issue.save && @issue.assignee != current_user Notify.new_issue_email(@issue).deliver end diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index 94df0f53..ebee0bf0 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -24,6 +24,6 @@ - else = link_to 'Resolve', project_issue_path(@project, issue, :issue => {:closed => true }, :status_only => true), :method => :put, :class => "cgray", :remote => true - if can? current_user, :write_issue, issue - = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray", :remote => true + = link_to 'Edit', edit_project_issue_path(@project, issue), :class => "cgray edit-issue-link", :remote => true - if can?(current_user, :admin_issue, @project) || issue.author == current_user = link_to 'Destroy', [@project, issue], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-issue negative", :id => "destroy_issue_#{issue.id}" diff --git a/app/views/issues/create.js.haml b/app/views/issues/create.js.haml index 3713a8af..b8043290 100644 --- a/app/views/issues/create.js.haml +++ b/app/views/issues/create.js.haml @@ -1,6 +1,7 @@ - if @issue.valid? :plain $("#new_issue_dialog").dialog("close"); + $("#issues-table").prepend("#{escape_javascript(render(:partial => 'show', :locals => {:issue => @issue} ))}"); $.ajax({type: "GET", url: location.href, dataType: "script"}); - else :plain diff --git a/spec/requests/issues_spec.rb b/spec/requests/issues_spec.rb index b5d6f1bc..0dda659b 100644 --- a/spec/requests/issues_spec.rb +++ b/spec/requests/issues_spec.rb @@ -169,6 +169,7 @@ describe "Issues" do :assignee => @user, :project => project visit project_issues_path(project) + page.execute_script("$('.action-links').css('display', 'block');") click_link "Edit" end