gitlab-org--gitlab-foss/app/views/shared/issuable/_sidebar.html.haml

149 lines
8.8 KiB
Plaintext
Raw Normal View History

- todo = issuable_todo(issuable)
2016-12-20 14:44:24 +00:00
- content_for :page_specific_javascripts do
= page_specific_javascript_bundle_tag('common_vue')
= page_specific_javascript_bundle_tag('sidebar')
2017-06-27 08:06:35 +00:00
%aside.right-sidebar.js-right-sidebar{ data: { "offset-top" => "50", "spy" => "affix", signed: { in: current_user.present? } }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' }
2017-05-05 19:38:49 +00:00
.issuable-sidebar{ data: { endpoint: "#{issuable_json_path(issuable)}" } }
- can_edit_issuable = can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.block.issuable-sidebar-header
- if current_user
%span.issuable-header-text.hide-collapsed.pull-left
Todo
2017-03-01 10:36:15 +00:00
%a.gutter-toggle.pull-right.js-sidebar-toggle{ role: "button", href: "#", "aria-label" => "Toggle sidebar" }
= sidebar_gutter_toggle_icon
- if current_user
= render "shared/issuable/sidebar_todo", todo: todo, issuable: issuable
2016-01-28 03:50:18 +00:00
= 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
2016-01-27 22:38:19 +00:00
.block.assignee
2017-06-27 08:06:35 +00:00
= render "shared/issuable/sidebar_assignees", issuable: issuable, can_edit_issuable: can_edit_issuable, signed_in: current_user.present?
2016-01-27 22:38:19 +00:00
.block.milestone
.sidebar-collapsed-icon
2017-02-28 19:28:58 +00:00
= icon('clock-o', 'aria-hidden': 'true')
2016-01-29 01:36:48 +00:00
%span
- if issuable.milestone
%span.has-tooltip{ title: milestone_remaining_days(issuable.milestone), data: { container: 'body', html: 1, placement: 'left' } }
= issuable.milestone.title
2016-01-29 01:36:48 +00:00
- else
None
.title.hide-collapsed
Milestone
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
- if can_edit_issuable
= link_to 'Edit', '#', class: 'edit-link pull-right'
.value.hide-collapsed
2016-01-27 22:38:19 +00:00
- if issuable.milestone
= link_to issuable.milestone.title, project_milestone_path(@project, issuable.milestone), class: "bold has-tooltip", title: milestone_remaining_days(issuable.milestone), data: { container: "body", html: 1 }
- else
%span.no-value None
.selectbox.hide-collapsed
= f.hidden_field 'milestone_id', value: issuable.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.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 }})
2016-12-20 14:44:24 +00:00
- if issuable.has_attribute?(:time_estimate)
#issuable-time-tracker.block
// Fallback while content is loading
.title.hide-collapsed
Time tracking
= icon('spinner spin', 'aria-hidden': 'true')
- if issuable.has_attribute?(:due_date)
.block.due_date
.sidebar-collapsed-icon
2017-02-28 19:28:58 +00:00
= icon('calendar', 'aria-hidden': 'true')
2016-04-11 10:07:02 +00:00
%span.js-due-date-sidebar-value
= issuable.due_date.try(:to_s, :medium) || 'None'
.title.hide-collapsed
Due date
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
2016-04-08 12:04:20 +00:00
= link_to 'Edit', '#', class: 'edit-link pull-right'
.value.hide-collapsed
%span.value-content
- if issuable.due_date
%span.bold= issuable.due_date.to_s(:medium)
- else
%span.no-value No due date
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
%span.no-value.js-remove-due-date-holder{ class: ("hidden" if issuable.due_date.nil?) }
\-
%a.js-remove-due-date{ href: "#", role: "button" }
remove due date
2016-04-08 12:04:20 +00:00
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.selectbox.hide-collapsed
= f.hidden_field :due_date, value: issuable.due_date.try(:strftime, 'yy-mm-dd')
2016-04-08 12:04:20 +00:00
.dropdown
%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) } }
%span.dropdown-toggle-text Due date
2017-02-28 19:28:58 +00:00
= icon('chevron-down', 'aria-hidden': 'true')
2016-04-08 12:04:20 +00:00
.dropdown-menu.dropdown-menu-due-date
= dropdown_title('Due date')
2016-04-08 12:04:20 +00:00
= dropdown_content do
.js-due-date-calendar
- if @labels && @labels.any?
- selected_labels = issuable.labels
.block.labels
2016-08-18 12:59:09 +00:00
.sidebar-collapsed-icon.js-sidebar-labels-tooltip{ title: issuable_labels_tooltip(issuable.labels_array), data: { placement: "left", container: "body" } }
= icon('tags', 'aria-hidden': 'true')
2016-01-29 01:36:48 +00:00
%span
= selected_labels.size
.title.hide-collapsed
Labels
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
- if can_edit_issuable
= link_to 'Edit', '#', class: 'edit-link pull-right'
.value.issuable-show-labels.hide-collapsed{ class: ("has-labels" if selected_labels.any?) }
- if selected_labels.any?
- selected_labels.each do |label|
= link_to_label(label, subject: issuable.project, type: issuable.to_ability_name)
2016-01-27 22:38:19 +00:00
- else
%span.no-value None
.selectbox.hide-collapsed
- selected_labels.each do |label|
= hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil
2016-03-12 20:37:02 +00:00
.dropdown
%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: (project_labels_path(@project, :json) if @project) } }
%span.dropdown-toggle-text{ class: ("is-default" if selected_labels.empty?) }
= multi_label_name(selected_labels, "Labels")
2017-02-28 19:28:58 +00:00
= icon('chevron-down', 'aria-hidden': 'true')
2016-03-12 20:37:02 +00:00
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
2016-04-18 19:56:02 +00:00
= render partial: "shared/issuable/label_page_default"
2016-04-12 04:19:47 +00:00
- if can? current_user, :admin_label, @project and @project
2016-04-14 17:57:54 +00:00
= render partial: "shared/issuable/label_page_create"
2016-01-27 22:38:19 +00:00
= render "shared/issuable/participants", participants: issuable.participants(current_user)
- if current_user
- subscribed = issuable.subscribed?(current_user, @project)
.block.light.subscription{ data: { url: toggle_subscription_path(issuable) } }
.sidebar-collapsed-icon
2017-02-28 19:28:58 +00:00
= icon('rss', 'aria-hidden': 'true')
%span.issuable-header-text.hide-collapsed.pull-left
Notifications
2016-01-27 22:38:19 +00:00
- subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed'
%button.btn.btn-default.pull-right.js-subscribe-button.issuable-subscribe-button.hide-collapsed{ type: "button" }
2016-01-27 22:38:19 +00:00
%span= subscribed ? 'Unsubscribe' : 'Subscribe'
- project_ref = cross_project_reference(@project, issuable)
.block.project-reference
.sidebar-collapsed-icon.dont-change-state
2017-04-06 21:10:14 +00:00
= clipboard_button(text: project_ref, title: "Copy reference to clipboard", placement: "left")
.cross-project-reference.hide-collapsed
2016-01-27 22:38:19 +00:00
%span
Reference:
%cite{ title: project_ref }
2016-01-27 22:38:19 +00:00
= project_ref
2017-04-06 21:10:14 +00:00
= clipboard_button(text: project_ref, title: "Copy reference to clipboard", placement: "left")
2016-01-27 22:38:19 +00:00
:javascript
gl.sidebarOptions = {
endpoint: "#{issuable_json_path(issuable)}?basic=true",
editable: #{can_edit_issuable ? true : false},
currentUser: #{current_user.to_json(only: [:username, :id, :name], methods: :avatar_url)},
2017-07-25 10:56:41 +00:00
rootPath: "#{root_path}",
fullPath: "#{@project.full_path}",
};