2016-06-17 04:01:03 -04:00
|
|
|
- todo = issuable_todo(issuable)
|
2016-12-20 09:44:24 -05:00
|
|
|
- content_for :page_specific_javascripts do
|
2017-03-01 21:28:34 -05:00
|
|
|
= page_specific_javascript_bundle_tag('common_vue')
|
2017-01-18 23:23:53 -05:00
|
|
|
= page_specific_javascript_bundle_tag('issuable')
|
|
|
|
|
2017-02-09 14:22:38 -05:00
|
|
|
%aside.right-sidebar.js-right-sidebar{ data: { "offset-top" => "101", "spy" => "affix" }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' }
|
2016-01-27 17:38:19 -05:00
|
|
|
.issuable-sidebar
|
2016-04-07 08:32:37 -04:00
|
|
|
- can_edit_issuable = can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
|
2016-03-04 12:37:07 -05:00
|
|
|
.block.issuable-sidebar-header
|
2016-06-07 05:54:02 -04:00
|
|
|
- if current_user
|
|
|
|
%span.issuable-header-text.hide-collapsed.pull-left
|
|
|
|
Todo
|
2017-03-01 05:36:15 -05:00
|
|
|
%a.gutter-toggle.pull-right.js-sidebar-toggle{ role: "button", href: "#", "aria-label" => "Toggle sidebar" }
|
2016-03-04 12:37:07 -05:00
|
|
|
= sidebar_gutter_toggle_icon
|
2016-06-07 05:54:02 -04:00
|
|
|
- if current_user
|
2017-02-28 14:28:58 -05:00
|
|
|
%button.btn.btn-default.issuable-header-btn.pull-right.js-issuable-todo{ type: "button", "aria-label" => (todo.nil? ? "Add todo" : "Mark done"), data: { todo_text: "Add todo", mark_text: "Mark done", issuable_id: issuable.id, issuable_type: issuable.class.name.underscore, url: namespace_project_todos_path(@project.namespace, @project), delete_path: (dashboard_todo_path(todo) if todo) } }
|
2016-06-07 07:49:56 -04:00
|
|
|
%span.js-issuable-todo-text
|
2016-06-17 04:01:03 -04:00
|
|
|
- if todo
|
2016-11-23 18:34:58 -05:00
|
|
|
Mark done
|
2016-06-17 04:01:03 -04:00
|
|
|
- else
|
2016-11-23 18:34:58 -05:00
|
|
|
Add todo
|
2017-02-28 14:28:58 -05:00
|
|
|
= icon('spin spinner', class: 'hidden js-issuable-todo-loading', 'aria-hidden': 'true')
|
2016-01-27 22:50:18 -05:00
|
|
|
|
2016-12-26 05:47:16 -05: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|
|
2016-01-27 17:38:19 -05:00
|
|
|
.block.assignee
|
2016-12-26 05:47:16 -05:00
|
|
|
.sidebar-collapsed-icon.sidebar-collapsed-user{ data: { toggle: "tooltip", placement: "left", container: "body" }, title: (issuable.assignee.name if issuable.assignee) }
|
2016-01-28 20:36:48 -05:00
|
|
|
- if issuable.assignee
|
2016-03-07 03:40:19 -05:00
|
|
|
= link_to_member(@project, issuable.assignee, size: 24)
|
2016-01-28 20:36:48 -05:00
|
|
|
- else
|
2017-02-28 14:28:58 -05:00
|
|
|
= icon('user', 'aria-hidden': 'true')
|
2016-02-25 05:35:52 -05:00
|
|
|
.title.hide-collapsed
|
2016-03-04 12:37:07 -05:00
|
|
|
Assignee
|
2017-03-15 08:08:01 -04:00
|
|
|
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
|
2016-04-07 08:32:37 -04:00
|
|
|
- if can_edit_issuable
|
2016-03-04 12:37:07 -05:00
|
|
|
= link_to 'Edit', '#', class: 'edit-link pull-right'
|
2016-06-02 06:03:33 -04:00
|
|
|
.value.hide-collapsed
|
2016-01-27 17:38:19 -05:00
|
|
|
- if issuable.assignee
|
2016-06-02 06:03:33 -04:00
|
|
|
= link_to_member(@project, issuable.assignee, size: 32, extra_class: 'bold') do
|
2016-03-21 07:31:50 -04:00
|
|
|
- if issuable.instance_of?(MergeRequest) && !issuable.can_be_merged_by?(issuable.assignee)
|
|
|
|
%span.pull-right.cannot-be-merged{ data: { toggle: 'tooltip', placement: 'left' }, title: 'Not allowed to merge' }
|
2017-02-28 14:28:58 -05:00
|
|
|
= icon('exclamation-triangle', 'aria-hidden': 'true')
|
2016-03-04 12:37:07 -05:00
|
|
|
%span.username
|
|
|
|
= issuable.assignee.to_reference
|
2016-01-27 17:38:19 -05:00
|
|
|
- else
|
2016-06-02 06:03:33 -04:00
|
|
|
%span.assign-yourself.no-value
|
2016-04-07 07:09:31 -04:00
|
|
|
No assignee
|
2016-04-07 08:32:37 -04:00
|
|
|
- if can_edit_issuable
|
2016-06-02 06:03:33 -04:00
|
|
|
\-
|
2016-04-07 07:09:31 -04:00
|
|
|
%a.js-assign-yourself{ href: '#' }
|
2016-06-02 06:03:33 -04:00
|
|
|
assign yourself
|
2015-12-10 13:01:49 -05:00
|
|
|
|
2016-02-25 05:35:52 -05:00
|
|
|
.selectbox.hide-collapsed
|
2016-03-19 20:19:51 -04:00
|
|
|
= f.hidden_field 'assignee_id', value: issuable.assignee_id, id: 'issue_assignee_id'
|
2016-03-29 11:26:59 -04:00
|
|
|
= dropdown_tag('Select assignee', 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 if current_user), current_user: true, project_id: (@project.id if @project), author_id: issuable.author_id, field_name: "#{issuable.to_ability_name}[assignee_id]", issue_update: issuable_json_path(issuable), ability_name: issuable.to_ability_name, null_user: true } })
|
2015-12-10 13:01:49 -05:00
|
|
|
|
2016-01-27 17:38:19 -05:00
|
|
|
.block.milestone
|
2016-01-28 00:06:36 -05:00
|
|
|
.sidebar-collapsed-icon
|
2017-02-28 14:28:58 -05:00
|
|
|
= icon('clock-o', 'aria-hidden': 'true')
|
2016-01-28 20:36:48 -05:00
|
|
|
%span
|
|
|
|
- if issuable.milestone
|
2016-12-26 05:47:16 -05:00
|
|
|
%span.has-tooltip{ title: milestone_remaining_days(issuable.milestone), data: { container: 'body', html: 1, placement: 'left' } }
|
2016-06-02 17:01:11 -04:00
|
|
|
= issuable.milestone.title
|
2016-01-28 20:36:48 -05:00
|
|
|
- else
|
2016-04-19 07:03:28 -04:00
|
|
|
None
|
2016-02-25 05:35:52 -05:00
|
|
|
.title.hide-collapsed
|
2016-03-04 12:37:07 -05:00
|
|
|
Milestone
|
2017-03-15 08:08:01 -04:00
|
|
|
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
|
2016-04-07 08:32:37 -04:00
|
|
|
- if can_edit_issuable
|
2016-03-04 12:37:07 -05:00
|
|
|
= link_to 'Edit', '#', class: 'edit-link pull-right'
|
2016-06-02 06:03:33 -04:00
|
|
|
.value.hide-collapsed
|
2016-01-27 17:38:19 -05:00
|
|
|
- if issuable.milestone
|
2016-06-02 06:03:33 -04:00
|
|
|
= link_to issuable.milestone.title, namespace_project_milestone_path(@project.namespace, @project, issuable.milestone), class: "bold has-tooltip", title: milestone_remaining_days(issuable.milestone), data: { container: "body", html: 1 }
|
2015-12-10 15:06:26 -05:00
|
|
|
- else
|
2016-06-02 06:03:33 -04:00
|
|
|
%span.no-value None
|
2016-03-11 00:28:10 -05:00
|
|
|
|
2016-02-25 05:35:52 -05:00
|
|
|
.selectbox.hide-collapsed
|
2016-03-17 09:14:46 -04:00
|
|
|
= f.hidden_field 'milestone_id', value: issuable.milestone_id, id: nil
|
2016-03-25 08:00:16 -04:00
|
|
|
= 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: namespace_project_milestones_path(@project.namespace, @project, :json), ability_name: issuable.to_ability_name, issue_update: issuable_json_path(issuable), use_id: true }})
|
2016-12-20 09:44:24 -05:00
|
|
|
- if issuable.has_attribute?(:time_estimate)
|
|
|
|
#issuable-time-tracker.block
|
2017-02-24 19:55:47 -05:00
|
|
|
%issuable-time-tracker{ ':time_estimate' => 'issuable.time_estimate', ':time_spent' => 'issuable.total_time_spent', ':human_time_estimate' => 'issuable.human_time_estimate', ':human_time_spent' => 'issuable.human_total_time_spent', 'docs-url' => help_page_path('workflow/time_tracking.md') }
|
2016-12-20 09:44:24 -05:00
|
|
|
// Fallback while content is loading
|
|
|
|
.title.hide-collapsed
|
|
|
|
Time tracking
|
2017-02-28 14:28:58 -05:00
|
|
|
= icon('spinner spin', 'aria-hidden': 'true')
|
2016-04-19 07:03:28 -04:00
|
|
|
- if issuable.has_attribute?(:due_date)
|
2016-03-10 09:26:56 -05:00
|
|
|
.block.due_date
|
|
|
|
.sidebar-collapsed-icon
|
2017-02-28 14:28:58 -05:00
|
|
|
= icon('calendar', 'aria-hidden': 'true')
|
2016-04-11 06:07:02 -04:00
|
|
|
%span.js-due-date-sidebar-value
|
2016-04-19 07:03:28 -04:00
|
|
|
= issuable.due_date.try(:to_s, :medium) || 'None'
|
2016-03-10 09:26:56 -05:00
|
|
|
.title.hide-collapsed
|
2016-04-19 07:03:28 -04:00
|
|
|
Due date
|
2017-03-15 08:08:01 -04:00
|
|
|
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
|
2016-03-10 09:26:56 -05:00
|
|
|
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
|
2016-04-08 08:04:20 -04:00
|
|
|
= link_to 'Edit', '#', class: 'edit-link pull-right'
|
2016-06-02 06:03:33 -04:00
|
|
|
.value.hide-collapsed
|
2016-05-19 06:34:40 -04:00
|
|
|
%span.value-content
|
|
|
|
- if issuable.due_date
|
2016-06-02 06:03:33 -04:00
|
|
|
%span.bold= issuable.due_date.to_s(:medium)
|
2016-05-19 06:34:40 -04:00
|
|
|
- else
|
2016-06-02 06:03:33 -04:00
|
|
|
%span.no-value No due date
|
2016-05-19 06:34:40 -04:00
|
|
|
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
|
2016-06-02 06:03:33 -04:00
|
|
|
%span.no-value.js-remove-due-date-holder{ class: ("hidden" if issuable.due_date.nil?) }
|
2016-05-19 06:34:40 -04:00
|
|
|
\-
|
|
|
|
%a.js-remove-due-date{ href: "#", role: "button" }
|
|
|
|
remove due date
|
2016-04-08 08:04:20 -04:00
|
|
|
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
|
|
|
|
.selectbox.hide-collapsed
|
2017-01-02 15:49:31 -05:00
|
|
|
= f.hidden_field :due_date, value: issuable.due_date.try(:strftime, 'yy-mm-dd')
|
2016-04-08 08:04:20 -04:00
|
|
|
.dropdown
|
2016-04-19 07:03:28 -04:00
|
|
|
%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 14:28:58 -05:00
|
|
|
= icon('chevron-down', 'aria-hidden': 'true')
|
2016-04-08 08:04:20 -04:00
|
|
|
.dropdown-menu.dropdown-menu-due-date
|
2016-04-19 07:03:28 -04:00
|
|
|
= dropdown_title('Due date')
|
2016-04-08 08:04:20 -04:00
|
|
|
= dropdown_content do
|
|
|
|
.js-due-date-calendar
|
2015-12-10 13:01:49 -05:00
|
|
|
|
2016-09-26 17:06:46 -04:00
|
|
|
- if @labels && @labels.any?
|
2016-07-19 05:26:49 -04:00
|
|
|
- selected_labels = issuable.labels
|
2016-01-28 00:06:36 -05:00
|
|
|
.block.labels
|
2016-08-18 08:59:09 -04:00
|
|
|
.sidebar-collapsed-icon.js-sidebar-labels-tooltip{ title: issuable_labels_tooltip(issuable.labels_array), data: { placement: "left", container: "body" } }
|
2017-03-15 08:08:01 -04:00
|
|
|
= icon('tags', class: 'hidden', 'aria-hidden': 'true')
|
2016-01-28 20:36:48 -05:00
|
|
|
%span
|
2016-07-19 05:26:49 -04:00
|
|
|
= selected_labels.size
|
2016-02-25 05:35:52 -05:00
|
|
|
.title.hide-collapsed
|
2016-03-04 12:37:07 -05:00
|
|
|
Labels
|
2017-03-15 08:08:01 -04:00
|
|
|
= icon('spinner spin', class: 'hidden block-loading', 'aria-hidden': 'true')
|
2016-04-07 08:32:37 -04:00
|
|
|
- if can_edit_issuable
|
2016-03-04 12:37:07 -05:00
|
|
|
= link_to 'Edit', '#', class: 'edit-link pull-right'
|
2016-09-02 05:08:22 -04:00
|
|
|
.value.issuable-show-labels.hide-collapsed{ class: ("has-labels" if selected_labels.any?) }
|
2016-07-19 05:26:49 -04:00
|
|
|
- if selected_labels.any?
|
|
|
|
- selected_labels.each do |label|
|
2017-02-02 04:31:09 -05:00
|
|
|
= link_to_label(label, subject: issuable.project, type: issuable.to_ability_name)
|
2016-01-27 17:38:19 -05:00
|
|
|
- else
|
2016-06-02 06:03:33 -04:00
|
|
|
%span.no-value None
|
2016-02-25 05:35:52 -05:00
|
|
|
.selectbox.hide-collapsed
|
2016-07-19 05:26:49 -04:00
|
|
|
- selected_labels.each do |label|
|
2016-07-18 12:56:05 -04:00
|
|
|
= hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil
|
2016-03-12 15:37:02 -05:00
|
|
|
.dropdown
|
2016-12-26 05:47:16 -05:00
|
|
|
%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(:path), project_path: @project.try(:path), issue_update: issuable_json_path(issuable), labels: (namespace_project_labels_path(@project.namespace, @project, :json) if @project) } }
|
|
|
|
%span.dropdown-toggle-text{ class: ("is-default" if selected_labels.empty?) }
|
2016-07-20 04:45:53 -04:00
|
|
|
= multi_label_name(selected_labels, "Labels")
|
2017-02-28 14:28:58 -05:00
|
|
|
= icon('chevron-down', 'aria-hidden': 'true')
|
2016-03-12 15:37:02 -05:00
|
|
|
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
|
2016-04-18 15:56:02 -04:00
|
|
|
= render partial: "shared/issuable/label_page_default"
|
2016-04-12 00:19:47 -04:00
|
|
|
- if can? current_user, :admin_label, @project and @project
|
2016-04-14 13:57:54 -04:00
|
|
|
= render partial: "shared/issuable/label_page_create"
|
2015-12-10 13:01:49 -05:00
|
|
|
|
2016-01-27 17:38:19 -05:00
|
|
|
= render "shared/issuable/participants", participants: issuable.participants(current_user)
|
|
|
|
- if current_user
|
2016-11-04 14:19:08 -04:00
|
|
|
- subscribed = issuable.subscribed?(current_user, @project)
|
2016-12-26 05:47:16 -05:00
|
|
|
.block.light.subscription{ data: { url: toggle_subscription_path(issuable) } }
|
2016-01-28 18:26:47 -05:00
|
|
|
.sidebar-collapsed-icon
|
2017-02-28 14:28:58 -05:00
|
|
|
= icon('rss', 'aria-hidden': 'true')
|
2016-11-09 17:27:16 -05:00
|
|
|
%span.issuable-header-text.hide-collapsed.pull-left
|
2016-03-04 12:37:07 -05:00
|
|
|
Notifications
|
2016-01-27 17:38:19 -05:00
|
|
|
- subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed'
|
2016-11-09 17:27:16 -05:00
|
|
|
%button.btn.btn-default.pull-right.js-subscribe-button.issuable-subscribe-button.hide-collapsed{ type: "button" }
|
2016-01-27 17:38:19 -05:00
|
|
|
%span= subscribed ? 'Unsubscribe' : 'Subscribe'
|
|
|
|
|
|
|
|
- project_ref = cross_project_reference(@project, issuable)
|
2016-01-28 00:06:36 -05:00
|
|
|
.block.project-reference
|
2016-07-18 13:04:16 -04:00
|
|
|
.sidebar-collapsed-icon.dont-change-state
|
2017-01-11 15:40:51 -05:00
|
|
|
= clipboard_button(clipboard_text: project_ref, title: "Copy reference to clipboard", placement: "left")
|
2016-02-25 05:35:52 -05:00
|
|
|
.cross-project-reference.hide-collapsed
|
2016-01-27 17:38:19 -05:00
|
|
|
%span
|
|
|
|
Reference:
|
2016-12-26 05:47:16 -05:00
|
|
|
%cite{ title: project_ref }
|
2016-01-27 17:38:19 -05:00
|
|
|
= project_ref
|
2017-01-11 15:40:51 -05:00
|
|
|
= clipboard_button(clipboard_text: project_ref, title: "Copy reference to clipboard", placement: "left")
|
2015-12-10 13:01:49 -05:00
|
|
|
|
2016-01-27 17:38:19 -05:00
|
|
|
:javascript
|
2016-12-20 09:44:24 -05:00
|
|
|
gl.IssuableResource = new gl.SubbableResource('#{issuable_json_path(issuable)}');
|
|
|
|
new gl.IssuableTimeTracking("#{escape_javascript(serialize_issuable(issuable))}");
|
2017-02-23 18:55:01 -05:00
|
|
|
new MilestoneSelect('{"full_path":"#{@project.full_path}"}');
|
2016-03-12 15:37:02 -05:00
|
|
|
new LabelsSelect();
|
2016-04-19 16:54:20 -04:00
|
|
|
new IssuableContext('#{escape_javascript(current_user.to_json(only: [:username, :id, :name]))}');
|
2016-11-17 10:48:45 -05:00
|
|
|
gl.Subscription.bindAll('.subscription');
|
2016-10-11 04:19:18 -04:00
|
|
|
new gl.DueDateSelectors();
|
2016-12-14 00:26:26 -05:00
|
|
|
window.sidebar = new Sidebar();
|