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

176 lines
10 KiB
Text
Raw Normal View History

2016-06-22 15:30:34 +05:30
- todo = issuable_todo(issuable)
2016-04-02 18:10:28 +05:30
%aside.right-sidebar{ class: sidebar_gutter_collapsed_class }
.issuable-sidebar
2016-06-02 11:05:42 +05:30
- 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
%a.gutter-toggle.pull-right.js-sidebar-toggle{ role: "button", href: "#", aria: { label: "Toggle sidebar" } }
2016-06-02 11:05:42 +05:30
= sidebar_gutter_toggle_icon
- if current_user
2016-06-22 15:30:34 +05:30
%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) } }
%span.js-issuable-todo-text
2016-06-22 15:30:34 +05:30
- if todo
Mark Done
2016-06-22 15:30:34 +05:30
- else
Add Todo
= icon('spin spinner', class: 'hidden js-issuable-todo-loading')
2015-12-23 02:04:40 +05:30
2016-06-02 11:05:42 +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|
2016-04-02 18:10:28 +05:30
.block.assignee
2016-08-24 12:49:21 +05:30
.sidebar-collapsed-icon.sidebar-collapsed-user{data: {toggle: "tooltip", placement: "left", container: "body"}, title: (issuable.assignee.name if issuable.assignee)}
2016-04-02 18:10:28 +05:30
- if issuable.assignee
2016-06-02 11:05:42 +05:30
= link_to_member(@project, issuable.assignee, size: 24)
2016-04-02 18:10:28 +05:30
- else
= icon('user')
.title.hide-collapsed
2016-06-02 11:05:42 +05:30
Assignee
= icon('spinner spin', class: 'block-loading')
- if can_edit_issuable
= link_to 'Edit', '#', class: 'edit-link pull-right'
2016-06-22 15:30:34 +05:30
.value.hide-collapsed
2016-04-02 18:10:28 +05:30
- if issuable.assignee
2016-06-22 15:30:34 +05:30
= link_to_member(@project, issuable.assignee, size: 32, extra_class: 'bold') do
2016-06-02 11:05:42 +05:30
- 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' }
= icon('exclamation-triangle')
%span.username
= issuable.assignee.to_reference
2016-04-02 18:10:28 +05:30
- else
2016-06-22 15:30:34 +05:30
%span.assign-yourself.no-value
2016-06-02 11:05:42 +05:30
No assignee
- if can_edit_issuable
2016-06-22 15:30:34 +05:30
\-
2016-06-02 11:05:42 +05:30
%a.js-assign-yourself{ href: '#' }
2016-06-22 15:30:34 +05:30
assign yourself
2015-12-23 02:04:40 +05:30
2016-04-02 18:10:28 +05:30
.selectbox.hide-collapsed
2016-06-02 11:05:42 +05:30
= f.hidden_field 'assignee_id', value: issuable.assignee_id, id: 'issue_assignee_id'
= 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-23 02:04:40 +05:30
2016-04-02 18:10:28 +05:30
.block.milestone
.sidebar-collapsed-icon
= icon('clock-o')
%span
- if issuable.milestone
%span.has-tooltip{title: milestone_remaining_days(issuable.milestone), data: {container: 'body', html: 1, placement: 'left'}}
= issuable.milestone.title
2016-04-02 18:10:28 +05:30
- else
2016-06-02 11:05:42 +05:30
None
2016-04-02 18:10:28 +05:30
.title.hide-collapsed
2016-06-02 11:05:42 +05:30
Milestone
= icon('spinner spin', class: 'block-loading')
- if can_edit_issuable
= link_to 'Edit', '#', class: 'edit-link pull-right'
2016-06-22 15:30:34 +05:30
.value.hide-collapsed
2016-04-02 18:10:28 +05:30
- if issuable.milestone
2016-06-22 15:30:34 +05:30
= 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-23 02:04:40 +05:30
- else
2016-06-22 15:30:34 +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
= 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 }})
- if issuable.has_attribute?(:due_date)
.block.due_date
.sidebar-collapsed-icon
= icon('calendar')
%span.js-due-date-sidebar-value
= issuable.due_date.try(:to_s, :medium) || 'None'
.title.hide-collapsed
Due date
= icon('spinner spin', class: 'block-loading')
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
= link_to 'Edit', '#', class: 'edit-link pull-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
2016-06-22 15:30:34 +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" }
remove due date
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.selectbox.hide-collapsed
= f.hidden_field :due_date, value: issuable.due_date
.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
= icon('chevron-down')
.dropdown-menu.dropdown-menu-due-date
= dropdown_title('Due date')
= dropdown_content do
.js-due-date-calendar
2015-12-23 02:04:40 +05:30
2016-11-03 12:29:30 +05:30
- if @labels && @labels.any?
- selected_labels = issuable.labels
2016-04-02 18:10:28 +05:30
.block.labels
2016-09-13 17:45:13 +05:30
.sidebar-collapsed-icon.js-sidebar-labels-tooltip{ title: issuable_labels_tooltip(issuable.labels_array), data: { placement: "left", container: "body" } }
2016-04-02 18:10:28 +05:30
= icon('tags')
%span
2016-11-03 12:29:30 +05:30
= selected_labels.size
2016-04-02 18:10:28 +05:30
.title.hide-collapsed
2016-06-02 11:05:42 +05:30
Labels
= icon('spinner spin', class: 'block-loading')
- if can_edit_issuable
= link_to 'Edit', '#', class: 'edit-link pull-right'
2016-11-03 12:29:30 +05:30
.value.issuable-show-labels.hide-collapsed{ class: ("has-labels" if selected_labels.any?) }
- if selected_labels.any?
- selected_labels.each do |label|
2016-04-02 18:10:28 +05:30
= link_to_label(label, type: issuable.to_ability_name)
- else
2016-06-22 15:30:34 +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
2016-11-03 12:29:30 +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(: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?)}
= multi_label_name(selected_labels, "Labels")
2016-06-02 11:05:42 +05:30
= icon('chevron-down')
.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
2016-04-02 18:10:28 +05:30
= render "shared/issuable/participants", participants: issuable.participants(current_user)
- if current_user
- subscribed = issuable.subscribed?(current_user)
2016-06-02 11:05:42 +05:30
.block.light.subscription{data: {url: toggle_subscription_path(issuable)}}
2016-04-02 18:10:28 +05:30
.sidebar-collapsed-icon
= icon('rss')
.title.hide-collapsed
2016-06-02 11:05:42 +05:30
Notifications
2016-04-02 18:10:28 +05:30
- subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed'
%button.btn.btn-block.btn-default.js-subscribe-button.issuable-subscribe-button.hide-collapsed{ type: "button" }
2016-04-02 18:10:28 +05:30
%span= subscribed ? 'Unsubscribe' : 'Subscribe'
.subscription-status.hide-collapsed{data: {status: subscribtion_status}}
.unsubscribed{class: ( 'hidden' if subscribed )}
You're not receiving notifications from this thread.
.subscribed{class: ( 'hidden' unless subscribed )}
You're receiving notifications because you're subscribed to this thread.
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
2016-04-02 18:10:28 +05:30
= clipboard_button(clipboard_text: project_ref)
.cross-project-reference.hide-collapsed
%span
Reference:
%cite{title: project_ref}
= project_ref
= clipboard_button(clipboard_text: project_ref)
2015-12-23 02:04:40 +05:30
2016-04-02 18:10:28 +05:30
:javascript
2016-06-02 11:05:42 +05:30
new MilestoneSelect('{"namespace":"#{@project.namespace.path}","path":"#{@project.path}"}');
new LabelsSelect();
new IssuableContext('#{escape_javascript(current_user.to_json(only: [:username, :id, :name]))}');
new Subscription('.subscription')
2016-11-03 12:29:30 +05:30
new gl.DueDateSelectors();
2016-06-02 11:05:42 +05:30
sidebar = new Sidebar();