diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-15 17:01:26 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-03-17 09:39:16 +0300 |
commit | 1dd279d83335de71c69d0acfdcdd7eb0ebe7f3dd (patch) | |
tree | 3965a00f0ad5562da835d19ef0555ac9703c7fbf /app/helpers/issues_helper.rb | |
parent | 414558939339bd636a3549866ce532fa25500bc5 (diff) |
Use helper to create list of projects issue can be moved to
This also adds confirmation message if issue move has been requested.
Diffstat (limited to 'app/helpers/issues_helper.rb')
-rw-r--r-- | app/helpers/issues_helper.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index ae4ebc0854a..62479b8d1ce 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -57,6 +57,17 @@ module IssuesHelper options_from_collection_for_select(milestones, 'id', 'title', object.milestone_id) end + def project_options(issuable, current_user, ability: :read_project) + projects = current_user.authorized_projects + projects = projects.select do |project| + current_user.can?(ability, project) && project != issuable.project + end + + projects.unshift(OpenStruct.new(id: 0, name_with_namespace: 'No project')) + + options_from_collection_for_select(projects, :id, :name_with_namespace, 0) + end + def status_box_class(item) if item.respond_to?(:expired?) && item.expired? 'status-box-expired' |