debian-mirror-gitlab/app/views/shared/issuable/_sidebar_assignees.html.haml

57 lines
3 KiB
Text
Raw Normal View History

2017-08-17 22:00:37 +05:30
- if issuable.is_a?(Issue)
2017-09-10 17:25:29 +05:30
#js-vue-sidebar-assignees{ data: { field: "#{issuable.to_ability_name}[assignee_ids]", signed_in: signed_in } }
2017-08-17 22:00:37 +05:30
.title.hide-collapsed
2018-03-17 18:26:18 +05:30
= _('Assignee')
2017-08-17 22:00:37 +05:30
= icon('spinner spin')
- else
2018-10-15 14:42:47 +05:30
.sidebar-collapsed-icon.sidebar-collapsed-user{ data: { toggle: "tooltip", placement: "left", container: "body" }, title: sidebar_assignee_tooltip_label(issuable) }
2017-08-17 22:00:37 +05:30
- if issuable.assignee
= link_to_member(@project, issuable.assignee, size: 24)
- else
= icon('user', 'aria-hidden': 'true')
.title.hide-collapsed
2018-03-17 18:26:18 +05:30
= _('Assignee')
2017-08-17 22:00:37 +05:30
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
- if can_edit_issuable
2018-03-17 18:26:18 +05:30
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link pull-right'
2017-09-10 17:25:29 +05:30
- if !signed_in
2018-03-17 18:26:18 +05:30
%a.gutter-toggle.pull-right.js-sidebar-toggle{ role: "button", href: "#", "aria-label" => _('Toggle sidebar') }
2017-09-10 17:25:29 +05:30
= sidebar_gutter_toggle_icon
2017-08-17 22:00:37 +05:30
.value.hide-collapsed
- if issuable.assignee
= link_to_member(@project, issuable.assignee, size: 32, extra_class: 'bold') do
- if !issuable.can_be_merged_by?(issuable.assignee)
2018-03-17 18:26:18 +05:30
%span.pull-right.cannot-be-merged{ data: { toggle: 'tooltip', placement: 'left' }, title: _('Not allowed to merge') }
2017-08-17 22:00:37 +05:30
= icon('exclamation-triangle', 'aria-hidden': 'true')
%span.username
= issuable.assignee.to_reference
- else
%span.assign-yourself.no-value
2018-03-17 18:26:18 +05:30
= _('No assignee')
2017-08-17 22:00:37 +05:30
- if can_edit_issuable
\-
%a.js-assign-yourself{ href: '#' }
2018-03-17 18:26:18 +05:30
= _('assign yourself')
2017-08-17 22:00:37 +05:30
.selectbox.hide-collapsed
- issuable.assignees.each do |assignee|
= hidden_field_tag "#{issuable.to_ability_name}[assignee_ids][]", assignee.id, id: nil, data: { avatar_url: assignee.avatar_url, name: assignee.name, username: assignee.username }
2018-03-17 18:26:18 +05:30
- 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: current_user&.username, current_user: true, project_id: @project&.id, author_id: issuable.author_id, field_name: "#{issuable.to_ability_name}[assignee_ids][]", issue_update: issuable_json_path(issuable), ability_name: issuable.to_ability_name, null_user: true } }
- title = _('Select assignee')
2017-08-17 22:00:37 +05:30
- if issuable.is_a?(Issue)
- unless issuable.assignees.any?
= hidden_field_tag "#{issuable.to_ability_name}[assignee_ids][]", 0, id: nil
2017-09-10 17:25:29 +05:30
- dropdown_options = issue_assignees_dropdown_options
- title = dropdown_options[:title]
2017-08-17 22:00:37 +05:30
- options[:toggle_class] += ' js-multiselect js-save-user-data'
- data = { field_name: "#{issuable.to_ability_name}[assignee_ids][]" }
- data[:multi_select] = true
- data['dropdown-title'] = title
2017-09-10 17:25:29 +05:30
- data['dropdown-header'] = dropdown_options[:data][:'dropdown-header']
- data['max-select'] = dropdown_options[:data][:'max-select']
2017-08-17 22:00:37 +05:30
- options[:data].merge!(data)
= dropdown_tag(title, options: options)