Commit 646fbe92 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

bring more usability to issues filtering. Block issues area on loading filtered results

parent 188a74c3
......@@ -14,6 +14,7 @@
//= require jquery.waitforimages
//= require jquery.atwho
//= require jquery.scrollto
//= require jquery.blockUI
//= require turbolinks
//= require jquery.turbolinks
//= require bootstrap
......
......@@ -15,7 +15,13 @@
$(this).html totalIssues + 1
else
$(this).html totalIssues - 1
$("body").on "click", ".issues-filters .dropdown-menu a", ->
$('.issues-list').block(
message: null,
overlayCSS:
backgroundColor: '#DDD'
opacity: .4
)
reload: ->
Issues.initSelects()
......@@ -48,10 +54,6 @@
unless terms is last_terms
last_terms = terms
if terms.length >= 2 or terms.length is 0
$('#search_status').val($('#status').val())
$('#search_assignee_id').val($('#assignee_id').val())
$('#search_milestone_id').val($('#milestone_id').val())
$('#search_label_name').val($('#label_name').val())
form.submit()
checkChanged: ->
......@@ -62,9 +64,9 @@
ids.push $(value).attr("data-id")
$("#update_issues_ids").val ids
$(".issues_filters").hide()
$(".issues-filters").hide()
$(".issues_bulk_update").show()
else
$("#update_issues_ids").val []
$(".issues_bulk_update").hide()
$(".issues_filters").show()
$(".issues-filters").show()
......@@ -20,6 +20,12 @@ class IssuesController < ProjectResourceController
@issues = @issues.where("title LIKE ?", "%#{terms}%") if terms.present?
@issues = @issues.page(params[:page]).per(20)
assignee_id, milestone_id = params[:assignee_id], params[:milestone_id]
@assignee = @project.users.find(assignee_id) if assignee_id.present? && !assignee_id.to_i.zero?
@milestone = @project.milestones.find(milestone_id) if milestone_id.present? && !milestone_id.to_i.zero?
respond_to do |format|
format.html # index.html.erb
format.js
......
= form_tag project_issues_path(@project), method: 'get' do
%fieldset
%ul.nav.nav-pills.nav-stacked
%li{class: ("active" if !params[:status])}
%li{class: ("active" if !params[:status] || params[:status].blank?)}
= link_to project_issues_path(@project, status: nil) do
Open
%li{class: ("active" if params[:status] == 'assigned-to-me')}
......
......@@ -12,8 +12,7 @@
= hidden_field_tag 'update[issues_ids]', []
= hidden_field_tag :status, params[:status]
= button_tag "Save", class: "btn update_selected_issues btn-small btn-save"
.issues_filters
= form_tag project_issues_path(@project), method: :get, remote: true do
.issues-filters
%span Filter by
.dropdown.inline.prepend-left-10
%a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"}
......@@ -25,6 +24,9 @@
Any
%b.caret
%ul.dropdown-menu
%li
= link_to project_issues_with_filter_path(@project, label_name: nil) do
Any
- issue_label_names.each do |label_name|
%li
= link_to project_issues_with_filter_path(@project, label_name: label_name) do
......@@ -35,12 +37,19 @@
%a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"}
%i.icon-user
%span.light assignee:
- if params[:assignee_id].present?
%strong= User.find(params[:assignee_id]).name
- if @assignee.present?
%strong= @assignee.name
- elsif params[:assignee_id] == "0"
Unassigned
- else
Any
%b.caret
%ul.dropdown-menu
%li
= link_to project_issues_with_filter_path(@project, assignee_id: nil) do
Any
= link_to project_issues_with_filter_path(@project, assignee_id: 0) do
Unassigned
- @project.users.sort_by(&:name).each do |user|
%li
= link_to project_issues_with_filter_path(@project, assignee_id: user.id) do
......@@ -51,23 +60,25 @@
%a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"}
%i.icon-time
%span.light milestone:
- if params[:milestone_id].present?
%strong= Milestone.find(params[:milestone_id]).title
- if @milestone.present?
%strong= @milestone.title
- elsif params[:milestone_id] == "0"
Unspecified
- else
Any
%b.caret
%ul.dropdown-menu
%li
= link_to project_issues_with_filter_path(@project, milestone_id: nil) do
Any
= link_to project_issues_with_filter_path(@project, milestone_id: 0) do
Unspecified
- issues_active_milestones.each do |milestone|
%li
= link_to project_issues_with_filter_path(@project, milestone_id: milestone.id) do
%strong= milestone.title
%small.light= milestone.expires_at
-#= select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
-#= select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
-#= select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone")
= hidden_field_tag :status, params[:status]
= hidden_field_tag :issue_search, params[:status], id: 'filter_issue_search'
%ul.well-list.issues-list
= render @issues
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment