Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_sidebar_assignees.html.haml « issuable « shared « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c6f3e4d97a84b7989c30b768e36f8494e7afa0fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
- issuable_type = issuable_sidebar[:type]
- dropdown_options = assignees_dropdown_options(issuable_type)

.js-sidebar-assignees-root{ data: { field: issuable_type,
  signed_in: signed_in,
  max_assignees: dropdown_options[:data][:"max-select"],
  directly_invite_members: can_admin_project_member?(@project) } }
  .title.hide-collapsed
    = s_('Label|Assignee')
    = gl_loading_icon(inline: true)

.js-sidebar-assignee-data.selectbox.hide-collapsed
  - if assignees.none?
    = hidden_field_tag "#{issuable_type}[assignee_ids][]", 0, id: nil
  - else
    - assignees.each do |assignee|
      = hidden_field_tag "#{issuable_type}[assignee_ids][]", assignee.id, id: nil, data: assignee_sidebar_data(assignee, merge_request: @merge_request)

  - 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,
      iid: issuable_sidebar[:iid],
      issuable_type: issuable_type,
      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' } }

  - 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_max_select(dropdown_options[:data])
  - options[:data].merge!(data)

  = render 'shared/issuable/sidebar_user_dropdown',
    options: options,
    wrapper_class: 'js-sidebar-assignee-dropdown',
    track_label: 'edit_assignee',
    trigger_source: "#{issuable_type}-assignee-dropdown"