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

105 lines
7.5 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]
2021-03-08 18:12:59 +05:30
- show_forwarding_email = !issuable_sidebar[:create_note_email].nil?
2019-02-15 15:39:39 +05:30
- signed_in = !!issuable_sidebar.dig(:current_user, :id)
- can_edit_issuable = issuable_sidebar.dig(:current_user, :can_edit)
2020-11-24 15:15:51 +05:30
- add_page_startup_api_call "#{issuable_sidebar[:issuable_json_path]}?serializer=sidebar_extras"
2021-01-03 14:25:43 +05:30
- reviewers = local_assigns.fetch(:reviewers, nil)
2021-11-18 22:05:49 +05:30
- in_group_context_with_iterations = @project.group.present? && issuable_sidebar[:supports_iterations]
2022-07-16 23:28:13 +05:30
- is_merge_request = issuable_type === 'merge_request'
- moved_sidebar_enabled = moved_mr_sidebar_enabled? && is_merge_request
2021-01-03 14:25:43 +05:30
2022-07-16 23:28:13 +05:30
%aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { signed: { in: signed_in }, issuable_type: issuable_type }, class: "#{sidebar_gutter_collapsed_class} #{'right-sidebar-merge-requests' if moved_sidebar_enabled}", 'aria-live' => 'polite', 'aria-label': issuable_type }
.issuable-sidebar{ class: "#{'is-merge-request' if moved_sidebar_enabled}" }
2022-07-23 23:45:48 +05:30
.issuable-sidebar-header{ class: "#{'gl-pb-2! gl-md-display-flex gl-justify-content-end gl-lg-display-none!' if moved_sidebar_enabled}" }
2023-04-23 21:23:45 +05:30
%button.btn.gl-button.gutter-toggle.float-right.js-sidebar-toggle.has-tooltip{ type: "reset", class: "gl-shadow-none! #{'gl-display-block' if moved_sidebar_enabled}", "aria-label" => _('Toggle sidebar'), title: sidebar_gutter_tooltip_text, data: { container: 'body', placement: 'left', boundary: 'viewport' } }
2021-01-03 14:25:43 +05:30
= sidebar_gutter_toggle_icon
2022-07-16 23:28:13 +05:30
- if signed_in && !moved_sidebar_enabled
2023-01-13 00:05:48 +05:30
.js-sidebar-todo-widget-root{ data: { project_path: issuable_sidebar[:project_full_path], iid: issuable_sidebar[:iid], id: issuable_sidebar[:id] } }
2021-01-03 14:25:43 +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|
2023-03-04 22:38:38 +05:30
.block.assignee{ class: "#{'gl-mt-3' if !signed_in && moved_sidebar_enabled}", data: { qa_selector: 'assignee_block_container', testid: 'assignee-block-container' } }
2021-01-03 14:25:43 +05:30
= render "shared/issuable/sidebar_assignees", issuable_sidebar: issuable_sidebar, assignees: assignees, signed_in: signed_in
2022-08-27 11:52:29 +05:30
- if issuable_sidebar[:supports_severity]
2023-04-23 21:23:45 +05:30
.js-sidebar-severity-widget-root
2022-08-27 11:52:29 +05:30
2021-03-11 19:13:27 +05:30
- if reviewers
2022-11-25 23:54:43 +05:30
.block.reviewer{ data: { qa_selector: 'reviewers_block_container' } }
2021-01-03 14:25:43 +05:30
= render "shared/issuable/sidebar_reviewers", issuable_sidebar: issuable_sidebar, reviewers: reviewers, signed_in: signed_in
2022-04-04 11:22:00 +05:30
- if issuable_sidebar[:supports_escalation]
.block.escalation-status{ data: { testid: 'escalation_status_container' } }
2023-01-13 00:05:48 +05:30
.js-sidebar-escalation-status-root{ data: { can_update: issuable_sidebar.dig(:current_user, :can_update_escalation_status).to_s, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid] } }
2022-04-04 11:22:00 +05:30
= render_if_exists 'shared/issuable/sidebar_escalation_policy', issuable_sidebar: issuable_sidebar
2021-09-04 01:27:46 +05:30
- if @project.group.present?
= render_if_exists 'shared/issuable/sidebar_item_epic', issuable_sidebar: issuable_sidebar, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type
2021-01-03 14:25:43 +05:30
2023-01-13 00:05:48 +05:30
.js-sidebar-labels-widget-root{ data: sidebar_labels_data(issuable_sidebar, @project) }
2022-07-16 23:28:13 +05:30
2021-01-03 14:25:43 +05:30
- if issuable_sidebar[:supports_milestone]
2022-01-26 12:08:38 +05:30
.block.milestone{ :class => ("gl-border-b-0!" if in_group_context_with_iterations), data: { qa_selector: 'milestone_block', testid: 'sidebar-milestones' } }
2023-01-13 00:05:48 +05:30
.js-sidebar-milestone-widget-root{ data: { can_edit: can_edit_issuable.to_s, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid] } }
2021-04-17 20:07:23 +05:30
2021-11-18 22:05:49 +05:30
- if in_group_context_with_iterations
2022-07-23 23:45:48 +05:30
.block.gl-collapse-empty{ data: { qa_selector: 'iteration_container', testid: 'iteration_container' } }<
2021-04-17 20:07:23 +05:30
= render_if_exists 'shared/issuable/iteration_select', can_edit: can_edit_issuable.to_s, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type
2021-01-03 14:25:43 +05:30
2022-05-07 20:08:51 +05:30
- if issuable_sidebar[:show_crm_contacts]
2022-01-26 12:08:38 +05:30
.block.contact
2023-01-13 00:05:48 +05:30
.js-sidebar-crm-contacts-root{ data: { issue_id: issuable_sidebar[:id], group_issues_path: issues_group_path(@project.group) } }
2022-07-16 23:28:13 +05:30
= render_if_exists 'shared/issuable/sidebar_weight', issuable_sidebar: issuable_sidebar, can_edit: can_edit_issuable.to_s, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid]
- if issuable_sidebar.has_key?(:due_date)
2023-01-13 00:05:48 +05:30
.js-sidebar-due-date-widget-root
2022-01-26 12:08:38 +05:30
2021-01-03 14:25:43 +05:30
- if issuable_sidebar[:supports_time_tracking]
2023-01-13 00:05:48 +05:30
.js-sidebar-time-tracking-root.block
2021-01-03 14:25:43 +05:30
// Fallback while content is loading
.title.hide-collapsed
= _('Time tracking')
2022-05-07 20:08:51 +05:30
= gl_loading_icon(inline: true)
2021-01-03 14:25:43 +05:30
- if issuable_sidebar.dig(:features_available, :health_status)
2023-01-13 00:05:48 +05:30
.js-sidebar-health-status-widget-root{ data: sidebar_status_data(issuable_sidebar, @project) }
2021-01-03 14:25:43 +05:30
- if issuable_sidebar.has_key?(:confidential)
2021-11-18 22:05:49 +05:30
-# haml-lint:disable InlineJavaScript
2021-01-03 14:25:43 +05:30
%script#js-confidential-issue-data{ type: "application/json" }= { is_confidential: issuable_sidebar[:confidential], is_editable: can_edit_issuable }.to_json.html_safe
2023-01-13 00:05:48 +05:30
.js-sidebar-confidential-widget-root
2021-01-03 14:25:43 +05:30
2021-04-17 20:07:23 +05:30
= render_if_exists 'shared/issuable/sidebar_cve_id_request', issuable_sidebar: issuable_sidebar
2022-07-16 23:28:13 +05:30
- if !moved_sidebar_enabled
2023-01-13 00:05:48 +05:30
.js-sidebar-lock-root
2022-07-16 23:28:13 +05:30
- if signed_in
2023-01-13 00:05:48 +05:30
.js-sidebar-subscriptions-widget-root
2021-01-03 14:25:43 +05:30
2023-01-13 00:05:48 +05:30
.js-sidebar-participants-widget-root
2021-01-03 14:25:43 +05:30
.block.with-sub-blocks
2022-10-11 01:57:18 +05:30
- if !moved_sidebar_enabled
2023-01-13 00:05:48 +05:30
.js-sidebar-reference-widget-root
2022-07-16 23:28:13 +05:30
- if issuable_type == 'merge_request' && !moved_sidebar_enabled
2021-04-29 21:17:54 +05:30
.sub-block.js-sidebar-source-branch
2021-11-18 22:05:49 +05:30
.sidebar-collapsed-icon.js-dont-change-state
2022-07-16 23:28:13 +05:30
= clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport', class: 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm js-source-branch-copy')
2021-04-29 21:17:54 +05:30
.gl-display-flex.gl-align-items-center.gl-justify-content-space-between.gl-mb-2.hide-collapsed
%span.gl-overflow-hidden.gl-text-overflow-ellipsis.gl-white-space-nowrap
= _('Source branch: %{source_branch_open}%{source_branch}%{source_branch_close}').html_safe % { source_branch_open: "<span class='gl-font-monospace' data-testid='ref-name' title='#{html_escape(source_branch)}'>".html_safe, source_branch_close: "</span>".html_safe, source_branch: html_escape(source_branch) }
2022-07-16 23:28:13 +05:30
= clipboard_button(text: source_branch, title: _('Copy branch name'), placement: "left", boundary: 'viewport', class: 'btn-clipboard gl-button btn-default-tertiary btn-icon btn-sm js-source-branch-copy')
2021-01-03 14:25:43 +05:30
2021-03-08 18:12:59 +05:30
- if show_forwarding_email
.block
2023-01-13 00:05:48 +05:30
.js-sidebar-copy-email-root
2021-01-03 14:25:43 +05:30
- if issuable_sidebar.dig(:current_user, :can_move)
2023-04-23 21:23:45 +05:30
.block
.js-sidebar-move-issue-block{ data: { project_full_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid] } }
2021-01-03 14:25:43 +05:30
-# haml-lint:disable InlineJavaScript
%script.js-sidebar-options{ type: "application/json" }= issuable_sidebar_options(issuable_sidebar).to_json.html_safe