diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-23 19:49:39 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-12-23 19:49:39 +0300 |
commit | 47634e392fab457dd0634225961944804bc04efe (patch) | |
tree | 8d70528e0a9a1d18264e9937c10054d5507462a0 /app/helpers | |
parent | 32eb5de510a7e32d9bb886595aa47d95dc00490f (diff) |
Refactor issues and merge requests lists
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 18 | ||||
-rw-r--r-- | app/helpers/dashboard_helper.rb | 14 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 17 |
3 files changed, 18 insertions, 31 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 01aa4a60d4c..90cc58f44b7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -275,4 +275,22 @@ module ApplicationHelper def promo_url 'https://' + promo_host end + + def page_filter_path(options={}) + exist_opts = { + state: params[:state], + scope: params[:scope], + label_name: params[:label_name], + milestone_id: params[:milestone_id], + assignee_id: params[:assignee_id], + author_id: params[:author_id], + sort: params[:sort], + } + + options = exist_opts.merge(options) + + path = request.path + path << "?#{options.to_param}" + path + end end diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index acc0eeb76b3..976a396e7b6 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -1,18 +1,4 @@ module DashboardHelper - def filter_path(entity, options={}) - exist_opts = { - state: params[:state], - scope: params[:scope], - project_id: params[:project_id], - } - - options = exist_opts.merge(options) - - path = request.path - path << "?#{options.to_param}" - path - end - def entities_per_project(project, entity) case entity.to_sym when :issue then @issues.where(project_id: project.id) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 6568f438e25..e489d431e84 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -68,23 +68,6 @@ module ProjectsHelper project_nav_tabs.include? name end - def project_filter_path(options={}) - exist_opts = { - state: params[:state], - scope: params[:scope], - label_name: params[:label_name], - milestone_id: params[:milestone_id], - assignee_id: params[:assignee_id], - sort: params[:sort], - } - - options = exist_opts.merge(options) - - path = request.path - path << "?#{options.to_param}" - path - end - def project_active_milestones @project.milestones.active.order("due_date, title ASC") end |