2016-06-22 15:30:34 +05:30
|
|
|
- todo = issuable_todo(issuable)
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: current_user.present? } }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' }
|
2017-08-17 22:00:37 +05:30
|
|
|
.issuable-sidebar{ data: { endpoint: "#{issuable_json_path(issuable)}" } }
|
2016-06-02 11:05:42 +05:30
|
|
|
- can_edit_issuable = can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
|
|
|
|
.block.issuable-sidebar-header
|
2016-06-16 23:09:34 +05:30
|
|
|
- if current_user
|
2018-11-08 19:23:39 +05:30
|
|
|
%span.issuable-header-text.hide-collapsed.float-left
|
2018-03-17 18:26:18 +05:30
|
|
|
= _('Todo')
|
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
|
2016-06-16 23:09:34 +05:30
|
|
|
- if current_user
|
2017-08-17 22:00:37 +05:30
|
|
|
= render "shared/issuable/sidebar_todo", todo: todo, issuable: issuable
|
2015-12-23 02:04:40 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
= form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, format: :json, html: { class: 'issuable-context-form inline-update js-issuable-update' } do |f|
|
|
|
|
- if current_user
|
|
|
|
.block.todo.hide-expanded
|
|
|
|
= render "shared/issuable/sidebar_todo", todo: todo, issuable: issuable, is_collapsed: true
|
2019-01-03 12:48:30 +05:30
|
|
|
.block.assignee
|
2017-09-10 17:25:29 +05:30
|
|
|
= render "shared/issuable/sidebar_assignees", issuable: issuable, can_edit_issuable: can_edit_issuable, signed_in: current_user.present?
|
2018-11-08 19:23:39 +05:30
|
|
|
|
|
|
|
= render_if_exists 'shared/issuable/sidebar_item_epic', issuable: issuable
|
|
|
|
|
2016-04-02 18:10:28 +05:30
|
|
|
.block.milestone
|
2018-11-08 19:23:39 +05:30
|
|
|
.sidebar-collapsed-icon.has-tooltip{ title: milestone_tooltip_title(issuable.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
|
2016-04-02 18:10:28 +05:30
|
|
|
- if issuable.milestone
|
2018-10-15 14:42:47 +05:30
|
|
|
= issuable.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
|
2018-11-08 19:23:39 +05:30
|
|
|
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right'
|
2016-06-22 15:30:34 +05:30
|
|
|
.value.hide-collapsed
|
2016-04-02 18:10:28 +05:30
|
|
|
- if issuable.milestone
|
2018-11-08 19:23:39 +05:30
|
|
|
= link_to issuable.milestone.title, milestone_path(issuable.milestone), class: "bold has-tooltip", title: milestone_tooltip_due_date(issuable.milestone), data: { container: "body", html: 'true', boundary: 'viewport' }
|
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
|
2016-06-02 11:05:42 +05:30
|
|
|
= f.hidden_field 'milestone_id', value: issuable.milestone_id, id: nil
|
2018-11-08 19:23:39 +05:30
|
|
|
= 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.to_ability_name}[milestone_id]", project_id: @project.id, issuable_id: issuable.id, milestones: project_milestones_path(@project, :json), ability_name: issuable.to_ability_name, issue_update: issuable_json_path(issuable), use_id: true, default_no: true, selected: (issuable.milestone.name if issuable.milestone), null_default: true, display: 'static' }})
|
2017-08-17 22:00:37 +05:30
|
|
|
- if issuable.has_attribute?(:time_estimate)
|
|
|
|
#issuable-time-tracker.block
|
|
|
|
// Fallback while content is loading
|
|
|
|
.title.hide-collapsed
|
2018-03-17 18:26:18 +05:30
|
|
|
= _('Time tracking')
|
2017-08-17 22:00:37 +05:30
|
|
|
= icon('spinner spin', 'aria-hidden': 'true')
|
2016-06-02 11:05:42 +05:30
|
|
|
- if issuable.has_attribute?(:due_date)
|
|
|
|
.block.due_date
|
2018-11-08 19:23:39 +05:30
|
|
|
.sidebar-collapsed-icon.has-tooltip{ data: { placement: 'left', container: 'body', html: 'true', boundary: 'viewport' }, title: sidebar_due_date_tooltip_label(issuable) }
|
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
|
|
|
|
= issuable.due_date.try(:to_s, :medium) || 'None'
|
|
|
|
.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')
|
2016-06-02 11:05:42 +05:30
|
|
|
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
|
2018-11-08 19:23:39 +05:30
|
|
|
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right'
|
2016-06-22 15:30:34 +05:30
|
|
|
.value.hide-collapsed
|
2016-06-02 11:05:42 +05:30
|
|
|
%span.value-content
|
|
|
|
- if issuable.due_date
|
2016-06-22 15:30:34 +05:30
|
|
|
%span.bold= issuable.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
|
|
|
|
= _('No due date')
|
2016-06-02 11:05:42 +05:30
|
|
|
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
|
2016-06-22 15:30:34 +05:30
|
|
|
%span.no-value.js-remove-due-date-holder{ class: ("hidden" if issuable.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')
|
2016-06-02 11:05:42 +05:30
|
|
|
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
|
|
|
|
.selectbox.hide-collapsed
|
2017-08-17 22:00:37 +05:30
|
|
|
= f.hidden_field :due_date, value: issuable.due_date.try(:strftime, 'yy-mm-dd')
|
2016-06-02 11:05:42 +05:30
|
|
|
.dropdown
|
2018-11-08 19:23:39 +05:30
|
|
|
%button.dropdown-menu-toggle.js-due-date-select{ type: 'button', data: { toggle: 'dropdown', field_name: "#{issuable.to_ability_name}[due_date]", ability_name: issuable.to_ability_name, issue_update: issuable_json_path(issuable), 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
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
- if @labels
|
2016-11-03 12:29:30 +05:30
|
|
|
- selected_labels = issuable.labels
|
2016-04-02 18:10:28 +05:30
|
|
|
.block.labels
|
2018-11-08 19:23:39 +05:30
|
|
|
.sidebar-collapsed-icon.js-sidebar-labels-tooltip{ title: issuable_labels_tooltip(issuable.labels_array), data: { placement: "left", container: "body", boundary: 'viewport' } }
|
2017-08-17 22:00:37 +05:30
|
|
|
= icon('tags', 'aria-hidden': 'true')
|
2016-04-02 18:10:28 +05:30
|
|
|
%span
|
2016-11-03 12:29:30 +05:30
|
|
|
= selected_labels.size
|
2016-04-02 18:10:28 +05:30
|
|
|
.title.hide-collapsed
|
2018-03-17 18:26:18 +05:30
|
|
|
= _('Labels')
|
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
|
2018-11-08 19:23:39 +05:30
|
|
|
= link_to _('Edit'), '#', class: 'js-sidebar-dropdown-toggle edit-link float-right'
|
2018-12-13 13:39:08 +05:30
|
|
|
.value.issuable-show-labels.dont-hide.hide-collapsed.qa-labels-block{ class: ("has-labels" if selected_labels.any?) }
|
2016-11-03 12:29:30 +05:30
|
|
|
- if selected_labels.any?
|
|
|
|
- selected_labels.each do |label|
|
2017-08-17 22:00:37 +05:30
|
|
|
= link_to_label(label, subject: issuable.project, type: issuable.to_ability_name)
|
2016-04-02 18:10:28 +05:30
|
|
|
- else
|
2018-03-17 18:26:18 +05:30
|
|
|
%span.no-value
|
|
|
|
= _('None')
|
2016-04-02 18:10:28 +05:30
|
|
|
.selectbox.hide-collapsed
|
2016-11-03 12:29:30 +05:30
|
|
|
- selected_labels.each do |label|
|
2016-06-02 11:05:42 +05:30
|
|
|
= hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil
|
|
|
|
.dropdown
|
2018-12-05 23:21:45 +05:30
|
|
|
%button.dropdown-menu-toggle.js-label-select.js-multiselect.js-label-sidebar-dropdown{ type: "button", data: {toggle: "dropdown", default_label: "Labels", field_name: "#{issuable.to_ability_name}[label_names][]", ability_name: issuable.to_ability_name, show_no: "true", show_any: "true", namespace_path: @project.try(:namespace).try(:full_path), project_path: @project.try(:path), issue_update: issuable_json_path(issuable), labels: (labels_filter_path_with_defaults if @project), display: 'static' } }
|
2017-08-17 22:00:37 +05:30
|
|
|
%span.dropdown-toggle-text{ class: ("is-default" if selected_labels.empty?) }
|
2016-11-03 12:29:30 +05:30
|
|
|
= multi_label_name(selected_labels, "Labels")
|
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-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
|
|
|
|
= render partial: "shared/issuable/label_page_default"
|
|
|
|
- if can? current_user, :admin_label, @project and @project
|
|
|
|
= render partial: "shared/issuable/label_page_create"
|
2015-12-23 02:04:40 +05:30
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
= render_if_exists 'shared/issuable/sidebar_weight', issuable: issuable
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
- if issuable.has_attribute?(:confidential)
|
2018-03-27 19:54:05 +05:30
|
|
|
-# haml-lint:disable InlineJavaScript
|
2017-09-10 17:25:29 +05:30
|
|
|
%script#js-confidential-issue-data{ type: "application/json" }= { is_confidential: @issue.confidential, is_editable: can_edit_issuable }.to_json.html_safe
|
|
|
|
#js-confidential-entry-point
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
- if issuable.has_attribute?(:discussion_locked)
|
2018-03-27 19:54:05 +05:30
|
|
|
-# haml-lint:disable InlineJavaScript
|
2018-03-17 18:26:18 +05:30
|
|
|
%script#js-lock-issue-data{ type: "application/json" }= { is_locked: issuable.discussion_locked?, is_editable: can_edit_issuable }.to_json.html_safe
|
|
|
|
#js-lock-entry-point
|
|
|
|
|
|
|
|
.js-sidebar-participants-entry-point
|
|
|
|
|
2016-04-02 18:10:28 +05:30
|
|
|
- if current_user
|
2018-03-17 18:26:18 +05:30
|
|
|
.js-sidebar-subscriptions-entry-point
|
2016-01-19 16:12:03 +05:30
|
|
|
|
2016-04-02 18:10:28 +05:30
|
|
|
- project_ref = cross_project_reference(@project, issuable)
|
|
|
|
.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')
|
2018-03-17 18:26:18 +05:30
|
|
|
- if current_user && issuable.can_move?(current_user)
|
|
|
|
.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',
|
2018-11-08 19:23:39 +05:30
|
|
|
data: { toggle: 'dropdown', display: 'static' } }
|
2018-03-17 18:26:18 +05:30
|
|
|
= _('Move issue')
|
|
|
|
.dropdown-menu.dropdown-menu-selectable
|
|
|
|
= 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
|
2018-12-05 23:21:45 +05:30
|
|
|
%button.btn.btn-success.sidebar-move-issue-confirmation-button.js-move-issue-confirmation-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
|
2017-09-10 17:25:29 +05:30
|
|
|
%script.js-sidebar-options{ type: "application/json" }= issuable_sidebar_options(issuable, can_edit_issuable).to_json.html_safe
|