Commit 034ddb85fe86c1a3e13bda959a732b6bec11bbaa

Authored by randx
1 parent 2dd17623

Assignee filter for issues

app/assets/stylesheets/gitlab_bootstrap.scss
... ... @@ -400,6 +400,7 @@ form {
400 400 *
401 401 */
402 402 .ui-box {
  403 + background:#F9F9F9;
403 404 margin-bottom: 40px;
404 405 @include round-borders-all(4px);
405 406 border-color: #CCC;
... ...
app/controllers/issues_controller.rb
... ... @@ -137,6 +137,7 @@ class IssuesController < ApplicationController
137 137 else @project.issues.opened
138 138 end
139 139  
  140 + @issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_id].present?
140 141 @issues = @issues.where(:milestone_id => params[:milestone_id]) if params[:milestone_id].present?
141 142 @issues = @issues.includes(:author, :project).order("critical, updated_at")
142 143 @issues
... ...
app/views/issues/_issues.html.haml
... ... @@ -12,4 +12,4 @@
12 12 %span.cgray.right #{@issues.total_count} issues for this filter
13 13 - else
14 14 %li
15   - %p.padded Nothing to show here
  15 + %h4.nothing_here_message Nothing to show here
... ...
app/views/issues/index.html.haml
... ... @@ -17,7 +17,7 @@
17 17 %div#issues-table-holder.ui-box
18 18 .title
19 19 .row
20   - .span6
  20 + .span4
21 21 %ul.nav.nav-pills.left
22 22 %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
23 23 = link_to project_issues_path(@project, :f => 0, :milestone_id => params[:milestone_id]) do
... ... @@ -32,9 +32,10 @@
32 32 = link_to project_issues_path(@project, :f => 1, :milestone_id => params[:milestone_id]) do
33 33 All
34 34  
35   - .span4.right
  35 + .span6.right
36 36 = form_tag project_issues_path(@project), :method => :get, :class => :right do
37   - = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Select milestone")
  37 + = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee")
  38 + = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone")
38 39 = hidden_field_tag :f, params[:f]
39 40  
40 41 %ul#issues-table.unstyled
... ... @@ -44,8 +45,9 @@
44 45 $(function(){
45 46 initIssuesSearch();
46 47 setSortable();
  48 + $("#assignee_id").chosen();
47 49 $("#milestone_id").chosen();
48   - $("#milestone_id").live("change", function(){
  50 + $("#milestone_id, #assignee_id").live("change", function(){
49 51 $(this).closest("form").submit();
50 52 });
51 53 })
... ...