Commit 89d0d75c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Better filter var for MR. show reset filter only if makes sense

parent a43a3803
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# based on filtering passed via params for @project # based on filtering passed via params for @project
class MergeRequestsLoadContext < BaseContext class MergeRequestsLoadContext < BaseContext
def execute def execute
type = params[:f] type = params[:status]
merge_requests = project.merge_requests merge_requests = project.merge_requests
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
All All
%fieldset %fieldset
%hr - if %w(status milestone_id assignee_id label_name).select { |k| params[k].present? }.any?
= link_to "Reset", project_issues_path(@project), class: 'btn pull-right' = link_to project_issues_path(@project), class: 'cgray pull-right' do
%i.icon-remove
Clear filter
= form_tag project_issues_path(@project), method: 'get' do = form_tag project_issues_path(@project), method: 'get' do
%fieldset %fieldset
%ul.nav.nav-pills.nav-stacked %ul.nav.nav-pills.nav-stacked
%li{class: ("active" if (params[:f] == 'open' || !params[:f]))} %li{class: ("active" if (params[:status] == 'open' || !params[:status]))}
= link_to project_merge_requests_path(@project, f: 'open', milestone_id: params[:milestone_id]) do = link_to project_merge_requests_path(@project, status: 'open', milestone_id: params[:milestone_id]) do
Open Open
%li{class: ("active" if params[:f] == "closed")} %li{class: ("active" if params[:status] == "closed")}
= link_to project_merge_requests_path(@project, f: "closed", milestone_id: params[:milestone_id]) do = link_to project_merge_requests_path(@project, status: "closed", milestone_id: params[:milestone_id]) do
Closed Closed
%li{class: ("active" if params[:f] == 'assigned-to-me')} %li{class: ("active" if params[:status] == 'assigned-to-me')}
= link_to project_merge_requests_path(@project, f: 'assigned-to-me', milestone_id: params[:milestone_id]) do = link_to project_merge_requests_path(@project, status: 'assigned-to-me', milestone_id: params[:milestone_id]) do
Assigned To Me Assigned To Me
%li{class: ("active" if params[:f] == 'all')} %li{class: ("active" if params[:status] == 'all')}
= link_to project_merge_requests_path(@project, f: 'all', milestone_id: params[:milestone_id]) do = link_to project_merge_requests_path(@project, status: 'all', milestone_id: params[:milestone_id]) do
All All
%fieldset %fieldset
%hr - if %w(status milestone_id assignee_id label_name).select { |k| params[k].present? }.any?
= link_to "Reset", project_merge_requests_path(@project), class: 'btn pull-right' = link_to project_merge_requests_path(@project), class: 'cgray pull-right' do
%i.icon-remove
Clear filter
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