2018-11-27 16:53:16 +00:00
|
|
|
- issuable_type = issuable_sidebar[:type]
|
2018-11-30 04:03:35 +00:00
|
|
|
- signed_in = !!issuable_sidebar.dig(:current_user, :id)
|
2018-11-27 16:53:16 +00:00
|
|
|
|
2020-05-04 12:09:46 +00:00
|
|
|
#js-vue-sidebar-assignees{ data: { field: issuable_type, signed_in: signed_in } }
|
2017-05-08 17:49:41 +00:00
|
|
|
.title.hide-collapsed
|
2018-01-23 07:03:01 +00:00
|
|
|
= _('Assignee')
|
2020-02-28 00:09:08 +00:00
|
|
|
.spinner.spinner-sm.align-bottom
|
2017-05-08 17:49:41 +00:00
|
|
|
|
|
|
|
.selectbox.hide-collapsed
|
2018-11-30 02:33:02 +00:00
|
|
|
- if assignees.none?
|
2018-11-27 16:53:16 +00:00
|
|
|
= hidden_field_tag "#{issuable_type}[assignee_ids][]", 0, id: nil
|
|
|
|
- else
|
2018-11-30 02:33:02 +00:00
|
|
|
- assignees.each do |assignee|
|
2019-09-24 18:06:05 +00:00
|
|
|
= hidden_field_tag "#{issuable_type}[assignee_ids][]", assignee.id, id: nil, data: assignee_sidebar_data(assignee, merge_request: @merge_request)
|
2017-05-08 17:49:41 +00:00
|
|
|
|
2018-11-27 16:53:16 +00:00
|
|
|
- options = { toggle_class: 'js-user-search js-author-search',
|
|
|
|
title: _('Assign to'),
|
|
|
|
filter: true,
|
|
|
|
dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author',
|
|
|
|
placeholder: _('Search users'),
|
|
|
|
data: { first_user: issuable_sidebar.dig(:current_user, :username),
|
|
|
|
current_user: true,
|
2019-07-26 02:30:50 +00:00
|
|
|
iid: issuable_sidebar[:iid],
|
|
|
|
issuable_type: issuable_type,
|
2018-11-27 16:53:16 +00:00
|
|
|
project_id: issuable_sidebar[:project_id],
|
|
|
|
author_id: issuable_sidebar[:author_id],
|
|
|
|
field_name: "#{issuable_type}[assignee_ids][]",
|
|
|
|
issue_update: issuable_sidebar[:issuable_json_path],
|
|
|
|
ability_name: issuable_type,
|
|
|
|
null_user: true,
|
|
|
|
display: 'static' } }
|
2017-05-08 14:58:42 +00:00
|
|
|
|
2019-04-07 18:35:16 +00:00
|
|
|
- dropdown_options = assignees_dropdown_options(issuable_type)
|
|
|
|
- title = dropdown_options[:title]
|
|
|
|
- options[:toggle_class] += ' js-multiselect js-save-user-data'
|
|
|
|
- data = { field_name: "#{issuable_type}[assignee_ids][]" }
|
|
|
|
- data[:multi_select] = true
|
|
|
|
- data['dropdown-title'] = title
|
|
|
|
- data['dropdown-header'] = dropdown_options[:data][:'dropdown-header']
|
|
|
|
- data['max-select'] = dropdown_options[:data][:'max-select'] if dropdown_options[:data][:'max-select']
|
|
|
|
- options[:data].merge!(data)
|
2017-05-08 17:49:41 +00:00
|
|
|
|
2017-05-08 18:20:46 +00:00
|
|
|
= dropdown_tag(title, options: options)
|