OSDN Git Service

Assignee filter for issues
authorrandx <dmitriy.zaporozhets@gmail.com>
Mon, 18 Jun 2012 17:50:06 +0000 (20:50 +0300)
committerrandx <dmitriy.zaporozhets@gmail.com>
Mon, 18 Jun 2012 17:50:06 +0000 (20:50 +0300)
app/assets/stylesheets/gitlab_bootstrap.scss
app/controllers/issues_controller.rb
app/views/issues/_issues.html.haml
app/views/issues/index.html.haml

index 8bab177..4df2b7e 100644 (file)
@@ -400,6 +400,7 @@ form {
  *
  */
 .ui-box { 
+  background:#F9F9F9;
   margin-bottom: 40px;
   @include round-borders-all(4px);
   border-color: #CCC;
index 0e31f04..48e8d72 100644 (file)
@@ -137,6 +137,7 @@ class IssuesController < ApplicationController
               else @project.issues.opened
               end
 
+    @issues = @issues.where(:assignee_id => params[:assignee_id]) if params[:assignee_id].present?
     @issues = @issues.where(:milestone_id => params[:milestone_id]) if params[:milestone_id].present?
     @issues = @issues.includes(:author, :project).order("critical, updated_at")
     @issues
index fd26906..e1d0be0 100644 (file)
@@ -12,4 +12,4 @@
         %span.cgray.right #{@issues.total_count} issues for this filter
 - else
   %li
-    %p.padded Nothing to show here
+    %h4.nothing_here_message Nothing to show here
index 98cbb7d..1a321e6 100644 (file)
@@ -17,7 +17,7 @@
   %div#issues-table-holder.ui-box
     .title
       .row
-        .span6
+        .span4
           %ul.nav.nav-pills.left
             %li{:class => ("active" if (params[:f] == "0" || !params[:f]))}
               = link_to project_issues_path(@project, :f => 0, :milestone_id => params[:milestone_id]) do
               = link_to project_issues_path(@project, :f => 1, :milestone_id => params[:milestone_id]) do
                 All
 
-        .span4.right
+        .span6.right
           = form_tag project_issues_path(@project), :method => :get, :class => :right  do
-            = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Select milestone")
+            = select_tag(:assignee_id, options_from_collection_for_select(@project.users.all, "id", "name", params[:assignee_id]), :prompt => "Assignee")
+            = select_tag(:milestone_id, options_from_collection_for_select(@project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), :prompt => "Milestone")
             = hidden_field_tag :f, params[:f]
 
     %ul#issues-table.unstyled
@@ -44,8 +45,9 @@
   $(function(){
     initIssuesSearch();
     setSortable();
+    $("#assignee_id").chosen();
     $("#milestone_id").chosen();
-    $("#milestone_id").live("change", function(){
+    $("#milestone_id, #assignee_id").live("change", function(){
       $(this).closest("form").submit();
     });
   })