Commit 26552051b7af709ad21497747405714006a14b68
1 parent
09263719
Exists in
master
and in
4 other branches
Pre-selected milestone implemented
Showing
4 changed files
with
24 additions
and
1 deletions
Show diff stats
app/assets/javascripts/issues.js
| ... | ... | @@ -80,6 +80,10 @@ function issuesPage(){ |
| 80 | 80 | $(this).closest("form").submit(); |
| 81 | 81 | }); |
| 82 | 82 | |
| 83 | + $("#new_issue_link").click(function(){ | |
| 84 | + updateNewIssueURL(); | |
| 85 | + }); | |
| 86 | + | |
| 83 | 87 | $('body').on('ajax:success', '.close_issue, .reopen_issue, #new_issue', function(){ |
| 84 | 88 | var t = $(this), |
| 85 | 89 | totalIssues, |
| ... | ... | @@ -126,3 +130,20 @@ function issuesCheckChanged() { |
| 126 | 130 | $('.issues_filters').show(); |
| 127 | 131 | } |
| 128 | 132 | } |
| 133 | + | |
| 134 | +function updateNewIssueURL(){ | |
| 135 | + var new_issue_link = $("#new_issue_link"); | |
| 136 | + var milestone_id = $("#milestone_id").val(); | |
| 137 | + var assignee_id = $("#assignee_id").val(); | |
| 138 | + var new_href = ""; | |
| 139 | + if(milestone_id){ | |
| 140 | + new_href = "milestone_id=" + milestone_id + "&"; | |
| 141 | + } | |
| 142 | + if(assignee_id){ | |
| 143 | + new_href = new_href + "assignee_id=" + assignee_id; | |
| 144 | + } | |
| 145 | + if(new_href.length){ | |
| 146 | + new_href = new_issue_link.attr("href") + "?" + new_href; | |
| 147 | + new_issue_link.attr("href", new_href); | |
| 148 | + } | |
| 149 | +}; | ... | ... |
app/controllers/issues_controller.rb
app/views/issues/index.html.haml
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | .right |
| 7 | 7 | .span5 |
| 8 | 8 | - if can? current_user, :write_issue, @project |
| 9 | - = link_to new_project_issue_path(@project), class: "right btn", title: "New Issue", remote: true do | |
| 9 | + = link_to new_project_issue_path(@project), class: "right btn", title: "New Issue", remote: true, id: "new_issue_link" do | |
| 10 | 10 | %i.icon-plus |
| 11 | 11 | New Issue |
| 12 | 12 | = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do | ... | ... |
features/step_definitions/project/project_issues_steps.rb