summaryrefslogtreecommitdiff
path: root/app/helpers/todos_helper.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-02-20 11:53:25 -0800
committerDouwe Maan <douwe@selenight.nl>2016-02-20 11:59:19 -0800
commitd53ae7f14d7c24ee590ba57632d267ec01706aa4 (patch)
tree930d407446a93197bfd41e4accd8800c95810a80 /app/helpers/todos_helper.rb
parent57d16552ff769cc5b41737de803bc2ddc4813f4e (diff)
downloadgitlab-ce-d53ae7f14d7c24ee590ba57632d267ec01706aa4.tar.gz
Add "Mark all as done" button
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r--app/helpers/todos_helper.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index cbbfc1e04f5..9bcfbd2da35 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -19,6 +19,32 @@ module TodosHelper
todo.project, todo.target], anchor: anchor)
end
+ def todos_filter_params
+ {
+ state: params[:state],
+ project_id: params[:project_id],
+ author_id: params[:author_id],
+ type: params[:type],
+ action_id: params[:action_id],
+ }
+ end
+
+ def todos_filter_path(options = {})
+ without = options.delete(:without)
+
+ options = todos_filter_params.merge(options)
+
+ if without.present?
+ without.each do |key|
+ options.delete(key)
+ end
+ end
+
+ path = request.path
+ path << "?#{options.to_param}"
+ path
+ end
+
def todo_actions_options
actions = [
OpenStruct.new(id: '', title: 'Any Action'),