%div#issues-table-holder.ui-box
.title
- .row
- .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
- Open
- %li{:class => ("active" if params[:f] == "2")}
- = link_to project_issues_path(@project, :f => 2, :milestone_id => params[:milestone_id]) do
- Closed
- %li{:class => ("active" if params[:f] == "3")}
- = link_to project_issues_path(@project, :f => 3, :milestone_id => params[:milestone_id]) do
- To Me
- %li{:class => ("active" if params[:f] == "1")}
- = link_to project_issues_path(@project, :f => 1, :milestone_id => params[:milestone_id]) do
- All
-
- .span6.right
- = form_tag project_issues_path(@project), :method => :get, :class => :right do
- = 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]
+ .left
+ %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
+ Open
+ %li{:class => ("active" if params[:f] == "2")}
+ = link_to project_issues_path(@project, :f => 2, :milestone_id => params[:milestone_id]) do
+ Closed
+ %li{:class => ("active" if params[:f] == "3")}
+ = link_to project_issues_path(@project, :f => 3, :milestone_id => params[:milestone_id]) do
+ To Me
+ %li{:class => ("active" if params[:f] == "1")}
+ = link_to project_issues_path(@project, :f => 1, :milestone_id => params[:milestone_id]) do
+ All
+ .right
+ = form_tag project_issues_path(@project), :method => :get, :class => :right do
+ = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), :prompt => "Labels")
+ = 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]
+ .clearfix
+
%ul#issues-table.unstyled.issues_table
= render "issues"
$(function(){
initIssuesSearch();
setSortable();
+ $("#label_name").chosen();
$("#assignee_id").chosen();
$("#milestone_id").chosen();
- $("#milestone_id, #assignee_id").live("change", function(){
+ $("#milestone_id, #assignee_id, #label_name").live("change", function(){
$(this).closest("form").submit();
});
})
--- /dev/null
+Given /^project "(.*?)" have "(.*?)" open issue$/ do |arg1, arg2|
+ project = Project.find_by_name(arg1)
+ Factory.create(:issue, :title => arg2, :project => project, :author => project.users.first)
+end
+
+Given /^project "(.*?)" have "(.*?)" closed issue$/ do |arg1, arg2|
+ project = Project.find_by_name(arg1)
+ Factory.create(:issue, :title => arg2, :project => project, :author => project.users.first, :closed => true)
+end
+
+Given /^I visit project "(.*?)" issues page$/ do |arg1|
+ visit project_issues_path(Project.find_by_name(arg1))
+end
+
+Given /^I should see "(.*?)" open issue$/ do |arg1|
+ page.should have_content arg1
+end
+
+Given /^I should not see "(.*?)" closed issue$/ do |arg1|
+ page.should_not have_content arg1
+end
+