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

179 lines
11 KiB
Text
Raw Normal View History

2019-02-15 15:39:39 +05:30
-# `assignees` is being passed in for populating selected assignee values in the select box and rendering the assignee link
This should be removed when this sidebar is converted to Vue since assignee data is also available in the `issuable_sidebar` hash
2017-08-17 22:00:37 +05:30
2019-02-15 15:39:39 +05:30
- issuable_type = issuable_sidebar[:type]
- signed_in = !!issuable_sidebar.dig(:current_user, :id)
- can_edit_issuable = issuable_sidebar.dig(:current_user, :can_edit)
%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: signed_in } }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' }
.issuable-sidebar
2016-06-02 11:05:42 +05:30
.block.issuable-sidebar-header
2019-02-15 15:39:39 +05:30
- if signed_in
2018-11-08 19:23:39 +05:30
%span.issuable-header-text.hide-collapsed.float-left
2019-09-30 21:07:59 +05:30
= _('To Do')
2018-11-08 19:23:39 +05:30
%a.gutter-toggle.float-right.js-sidebar-toggle.has-tooltip{ role: "button", href: "#", "aria-label" => "Toggle sidebar", title: sidebar_gutter_tooltip_text, data: { container: 'body', placement: 'left', boundary: 'viewport' } }
2016-06-02 11:05:42 +05:30
= sidebar_gutter_toggle_icon
2019-02-15 15:39:39 +05:30
- if signed_in
= render "shared/issuable/sidebar_todo", issuable_sidebar: issuable_sidebar
2015-12-23 02:04:40 +05:30
2019-02-15 15:39:39 +05:30
= form_for issuable_type, url: issuable_sidebar[:issuable_json_path], remote: true, html: { class: 'issuable-context-form inline-update js-issuable-update' } do |f|
- if signed_in
2017-08-17 22:00:37 +05:30
.block.todo.hide-expanded
2019-02-15 15:39:39 +05:30
= render "shared/issuable/sidebar_todo", issuable_sidebar: issuable_sidebar, is_collapsed: true
.block.assignee.qa-assignee-block
= render "shared/issuable/sidebar_assignees", issuable_sidebar: issuable_sidebar, assignees: assignees
2018-11-08 19:23:39 +05:30
2019-02-15 15:39:39 +05:30
= render_if_exists 'shared/issuable/sidebar_item_epic', issuable_sidebar: issuable_sidebar
2018-11-08 19:23:39 +05:30
2019-02-15 15:39:39 +05:30
- milestone = issuable_sidebar[:milestone] || {}
2016-04-02 18:10:28 +05:30
.block.milestone
2019-02-15 15:39:39 +05:30
.sidebar-collapsed-icon.has-tooltip{ title: sidebar_milestone_tooltip_label(milestone), data: { container: 'body', html: 'true', placement: 'left', boundary: 'viewport' } }
2017-08-17 22:00:37 +05:30
= icon('clock-o', 'aria-hidden': 'true')
2018-12-13 13:39:08 +05:30
%span.milestone-title.collapse-truncated-title
2019-02-15 15:39:39 +05:30
- if milestone.present?
= milestone[:title]
2016-04-02 18:10:28 +05:30
- else
2018-03-17 18:26:18 +05:30
= _('None')
2016-04-02 18:10:28 +05:30
.title.hide-collapsed
2018-03-17 18:26:18 +05:30
= _('Milestone')
2017-08-17 22:00:37 +05:30
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
2016-06-02 11:05:42 +05:30
- if can_edit_issuable
2019-12-04 20:38:33 +05:30
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { track_label: "right_sidebar", track_property: "milestone", track_event: "click_edit_button", track_value: "" }
2016-06-22 15:30:34 +05:30
.value.hide-collapsed
2019-02-15 15:39:39 +05:30
- if milestone.present?
2019-12-04 20:38:33 +05:30
= link_to milestone[:title], milestone[:web_url], class: "bold has-tooltip", title: sidebar_milestone_remaining_days(milestone), data: { container: "body", html: 'true', boundary: 'viewport', qa_selector: 'milestone_link' }
2015-12-23 02:04:40 +05:30
- else
2018-03-17 18:26:18 +05:30
%span.no-value
= _('None')
2016-06-02 11:05:42 +05:30
2016-04-02 18:10:28 +05:30
.selectbox.hide-collapsed
2019-02-15 15:39:39 +05:30
= f.hidden_field 'milestone_id', value: milestone[:id], id: nil
= dropdown_tag('Milestone', options: { title: _('Assign milestone'), toggle_class: 'js-milestone-select js-extra-options', filter: true, dropdown_class: 'dropdown-menu-selectable', placeholder: _('Search milestones'), data: { show_no: true, field_name: "#{issuable_type}[milestone_id]", project_id: issuable_sidebar[:project_id], issuable_id: issuable_sidebar[:id], milestones: issuable_sidebar[:project_milestones_path], ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], use_id: true, default_no: true, selected: milestone[:title], null_default: true, display: 'static' }})
#issuable-time-tracker.block
// Fallback while content is loading
.title.hide-collapsed
= _('Time tracking')
= icon('spinner spin', 'aria-hidden': 'true')
- if issuable_sidebar.has_key?(:due_date)
2016-06-02 11:05:42 +05:30
.block.due_date
2019-02-15 15:39:39 +05:30
.sidebar-collapsed-icon.has-tooltip{ data: { placement: 'left', container: 'body', html: 'true', boundary: 'viewport' }, title: sidebar_due_date_tooltip_label(issuable_sidebar[:due_date]) }
2017-08-17 22:00:37 +05:30
= icon('calendar', 'aria-hidden': 'true')
2016-06-02 11:05:42 +05:30
%span.js-due-date-sidebar-value
2019-02-15 15:39:39 +05:30
= issuable_sidebar[:due_date].try(:to_s, :medium) || 'None'
2016-06-02 11:05:42 +05:30
.title.hide-collapsed
2018-03-17 18:26:18 +05:30
= _('Due date')
2017-08-17 22:00:37 +05:30
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
2019-02-15 15:39:39 +05:30
- if can_edit_issuable
2019-12-04 20:38:33 +05:30
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right', data: { track_label: "right_sidebar", track_property: "due_date", track_event: "click_edit_button", track_value: "" }
2016-06-22 15:30:34 +05:30
.value.hide-collapsed
2016-06-02 11:05:42 +05:30
%span.value-content
2019-02-15 15:39:39 +05:30
- if issuable_sidebar[:due_date]
%span.bold= issuable_sidebar[:due_date].to_s(:medium)
2016-06-02 11:05:42 +05:30
- else
2018-03-17 18:26:18 +05:30
%span.no-value
2019-07-31 22:56:46 +05:30
= _('None')
2019-02-15 15:39:39 +05:30
- if can_edit_issuable
%span.no-value.js-remove-due-date-holder{ class: ("hidden" if issuable_sidebar[:due_date].nil?) }
2016-06-02 11:05:42 +05:30
\-
%a.js-remove-due-date{ href: "#", role: "button" }
2018-03-17 18:26:18 +05:30
= _('remove due date')
2019-02-15 15:39:39 +05:30
- if can_edit_issuable
2016-06-02 11:05:42 +05:30
.selectbox.hide-collapsed
2019-02-15 15:39:39 +05:30
= f.hidden_field :due_date, value: issuable_sidebar[:due_date].try(:strftime, 'yy-mm-dd')
2016-06-02 11:05:42 +05:30
.dropdown
2019-02-15 15:39:39 +05:30
%button.dropdown-menu-toggle.js-due-date-select{ type: 'button', data: { toggle: 'dropdown', field_name: "#{issuable_type}[due_date]", ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], display: 'static' } }
2018-03-17 18:26:18 +05:30
%span.dropdown-toggle-text
= _('Due date')
2017-08-17 22:00:37 +05:30
= icon('chevron-down', 'aria-hidden': 'true')
2016-06-02 11:05:42 +05:30
.dropdown-menu.dropdown-menu-due-date
2018-03-17 18:26:18 +05:30
= dropdown_title(_('Due date'))
2016-06-02 11:05:42 +05:30
= dropdown_content do
.js-due-date-calendar
2015-12-23 02:04:40 +05:30
2019-02-15 15:39:39 +05:30
- selected_labels = issuable_sidebar[:labels]
.block.labels
.sidebar-collapsed-icon.js-sidebar-labels-tooltip{ title: issuable_labels_tooltip(selected_labels), data: { placement: "left", container: "body", boundary: 'viewport' } }
= icon('tags', 'aria-hidden': 'true')
%span
= selected_labels.size
.title.hide-collapsed
= _('Labels')
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
- if can_edit_issuable
2019-12-04 20:38:33 +05:30
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link qa-edit-link-labels float-right', data: { track_label: "right_sidebar", track_property: "labels", track_event: "click_edit_button", track_value: "" }
2019-02-15 15:39:39 +05:30
.value.issuable-show-labels.dont-hide.hide-collapsed.qa-labels-block{ class: ("has-labels" if selected_labels.any?) }
- if selected_labels.any?
2019-07-07 11:18:12 +05:30
- selected_labels.each do |label_hash|
2019-07-31 22:56:46 +05:30
= render_label(label_from_hash(label_hash).present(issuable_subject: nil), link: sidebar_label_filter_path(issuable_sidebar[:project_issuables_path], label_hash[:title]))
2019-02-15 15:39:39 +05:30
- else
%span.no-value
= _('None')
.selectbox.hide-collapsed
- selected_labels.each do |label|
= hidden_field_tag "#{issuable_type}[label_names][]", label[:id], id: nil
.dropdown
2019-07-07 11:18:12 +05:30
%button.dropdown-menu-toggle.js-label-select.js-multiselect.js-label-sidebar-dropdown{ type: "button", data: sidebar_label_dropdown_data(issuable_type, issuable_sidebar) }
2019-02-15 15:39:39 +05:30
%span.dropdown-toggle-text{ class: ("is-default" if selected_labels.empty?) }
= multi_label_name(selected_labels, "Labels")
= icon('chevron-down', 'aria-hidden': 'true')
2019-09-04 21:01:54 +05:30
.dropdown-menu.dropdown-select.dropdown-menu-paging.qa-dropdown-menu-labels.dropdown-menu-labels.dropdown-menu-selectable.dropdown-extended-height
2019-02-15 15:39:39 +05:30
= render partial: "shared/issuable/label_page_default"
- if issuable_sidebar.dig(:current_user, :can_admin_label)
= render partial: "shared/issuable/label_page_create"
= render_if_exists 'shared/issuable/sidebar_weight', issuable_sidebar: issuable_sidebar
- if issuable_sidebar.has_key?(:confidential)
2018-03-27 19:54:05 +05:30
-# haml-lint:disable InlineJavaScript
2019-02-15 15:39:39 +05:30
%script#js-confidential-issue-data{ type: "application/json" }= { is_confidential: issuable_sidebar[:confidential], is_editable: can_edit_issuable }.to_json.html_safe
2017-09-10 17:25:29 +05:30
#js-confidential-entry-point
2019-02-15 15:39:39 +05:30
-# haml-lint:disable InlineJavaScript
2019-07-07 11:18:12 +05:30
%script#js-lock-issue-data{ type: "application/json" }= { is_locked: !!issuable_sidebar[:discussion_locked], is_editable: can_edit_issuable }.to_json.html_safe
2019-02-15 15:39:39 +05:30
#js-lock-entry-point
2018-03-17 18:26:18 +05:30
.js-sidebar-participants-entry-point
2019-02-15 15:39:39 +05:30
- if signed_in
2019-10-12 21:52:04 +05:30
- if issuable_sidebar[:project_emails_disabled]
.block.js-emails-disabled
.sidebar-collapsed-icon.has-tooltip{ title: notification_description(:owner_disabled), data: { placement: "left", container: "body", boundary: 'viewport' } }
= notification_setting_icon
.hide-collapsed= notification_description(:owner_disabled)
- else
.js-sidebar-subscriptions-entry-point
2019-02-15 15:39:39 +05:30
- project_ref = issuable_sidebar[:reference]
2016-04-02 18:10:28 +05:30
.block.project-reference
2016-08-24 12:49:21 +05:30
.sidebar-collapsed-icon.dont-change-state
2018-11-08 19:23:39 +05:30
= clipboard_button(text: project_ref, title: _('Copy reference to clipboard'), placement: "left", boundary: 'viewport')
2016-04-02 18:10:28 +05:30
.cross-project-reference.hide-collapsed
%span
2018-03-17 18:26:18 +05:30
= _('Reference:')
2017-08-17 22:00:37 +05:30
%cite{ title: project_ref }
2016-04-02 18:10:28 +05:30
= project_ref
2018-11-08 19:23:39 +05:30
= clipboard_button(text: project_ref, title: _('Copy reference to clipboard'), placement: "left", boundary: 'viewport')
2019-02-15 15:39:39 +05:30
- if issuable_sidebar.dig(:current_user, :can_move)
2018-03-17 18:26:18 +05:30
.block.js-sidebar-move-issue-block
2018-11-08 19:23:39 +05:30
.sidebar-collapsed-icon{ data: { toggle: 'tooltip', placement: 'left', container: 'body', boundary: 'viewport' }, title: _('Move issue') }
2018-03-17 18:26:18 +05:30
= custom_icon('icon_arrow_right')
.dropdown.sidebar-move-issue-dropdown.hide-collapsed
%button.btn.btn-default.btn-block.js-sidebar-dropdown-toggle.js-move-issue{ type: 'button',
2019-12-04 20:38:33 +05:30
data: { toggle: 'dropdown', display: 'static', track_label: "right_sidebar", track_property: "move_issue", track_event: "click_button", track_value: "" } }
2018-03-17 18:26:18 +05:30
= _('Move issue')
2019-09-04 21:01:54 +05:30
.dropdown-menu.dropdown-menu-selectable.dropdown-extended-height
2018-03-17 18:26:18 +05:30
= dropdown_title(_('Move issue'))
= dropdown_filter(_('Search project'), search_id: 'sidebar-move-issue-dropdown-search')
= dropdown_content
= dropdown_loading
= dropdown_footer add_content_class: true do
2019-09-04 21:01:54 +05:30
%button.btn.btn-success.sidebar-move-issue-confirmation-button.js-move-issue-confirmation-button{ type: 'button', disabled: true }
2018-03-17 18:26:18 +05:30
= _('Move')
= icon('spinner spin', class: 'sidebar-move-issue-confirmation-loading-icon')
2015-12-23 02:04:40 +05:30
2018-03-27 19:54:05 +05:30
-# haml-lint:disable InlineJavaScript
2019-02-15 15:39:39 +05:30
%script.js-sidebar-options{ type: "application/json" }= issuable_sidebar_options(issuable_sidebar).to_json.html_safe