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

121 lines
5.9 KiB
Text
Raw Normal View History

%aside.right-sidebar{ class: sidebar_gutter_collapsed_class }
2016-01-27 17:38:19 -05:00
.issuable-sidebar
.block.issuable-sidebar-header
%span.issuable-count.hide-collapsed.pull-left
= issuable.iid
2016-01-27 22:50:18 -05:00
of
= issuables_count(issuable)
%a.gutter-toggle.pull-right.js-sidebar-toggle{href: '#'}
= sidebar_gutter_toggle_icon
.issuable-nav.hide-collapsed.pull-right.btn-group{role: 'group', "aria-label" => '...'}
- if prev_issuable = prev_issuable_for(issuable)
= link_to 'Prev', [@project.namespace.becomes(Namespace), @project, prev_issuable], class: 'btn btn-default prev-btn'
- else
%a.btn.btn-default.disabled{href: '#'}
Prev
- if next_issuable = next_issuable_for(issuable)
= link_to 'Next', [@project.namespace.becomes(Namespace), @project, next_issuable], class: 'btn btn-default next-btn'
- else
%a.btn.btn-default.disabled{href: '#'}
Next
2016-01-27 22:50:18 -05:00
= form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-issuable-update'} do |f|
2016-01-27 17:38:19 -05:00
.block.assignee
.sidebar-collapsed-icon.sidebar-collapsed-user{data: {toggle: "tooltip", placement: "left", container: "body"}, title: (issuable.assignee.to_reference if issuable.assignee)}
2016-01-28 20:36:48 -05:00
- if issuable.assignee
= link_to_member(@project, issuable.assignee, size: 24)
2016-01-28 20:36:48 -05:00
- else
= icon('user')
.title.hide-collapsed
Assignee
2016-01-27 17:38:19 -05:00
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
= link_to 'Edit', '#', class: 'edit-link pull-right'
.value.bold.hide-collapsed
2016-01-27 17:38:19 -05:00
- if issuable.assignee
= link_to_member(@project, issuable.assignee, size: 32) do
- 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-01-27 17:38:19 -05:00
- else
.light None
.selectbox.hide-collapsed
2016-01-27 17:38:19 -05:00
= users_select_tag("#{issuable.class.table_name.singularize}[assignee_id]", placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: issuable.assignee_id, project: @target_project, null_user: true, current_user: true, first_user: true)
2016-01-27 17:38:19 -05:00
.block.milestone
.sidebar-collapsed-icon
2016-02-17 09:02:34 -05:00
= icon('clock-o')
2016-01-28 20:36:48 -05:00
%span
- if issuable.milestone
= issuable.milestone.title
- else
No
.title.hide-collapsed
Milestone
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
= link_to 'Edit', '#', class: 'edit-link pull-right'
.value.bold.hide-collapsed
2016-01-27 17:38:19 -05:00
- if issuable.milestone
= link_to namespace_project_milestone_path(@project.namespace, @project, issuable.milestone) do
= issuable.milestone.title
- else
.light None
.selectbox.hide-collapsed
= dropdown_tag("Milestone", options: { title: "Assign milestone", toggle_class: 'js-milestone-select', filter: true, dropdown_class: "dropdown-menu-selectable", placeholder: "Search milestones", data: { show_no: true, field_name: "milestone_id", project_id: @project.id, issuable_id: issuable.id, milestones: namespace_project_milestones_path(@project.namespace, @project, :js), use_id: true }})
2016-01-27 17:38:19 -05:00
- if issuable.project.labels.any?
.block.labels
.sidebar-collapsed-icon
= icon('tags')
2016-01-28 20:36:48 -05:00
%span
= issuable.labels.count
.title.hide-collapsed
Labels
2016-01-27 17:38:19 -05:00
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
= link_to 'Edit', '#', class: 'edit-link pull-right'
2016-03-24 07:38:00 -04:00
.value.bold.issuable-show-labels.hide-collapsed{ class: ("has-labels" if issuable.labels.any?) }
2016-01-27 17:38:19 -05:00
- if issuable.labels.any?
- issuable.labels.each do |label|
= link_to_label(label, type: issuable.to_ability_name)
2016-01-27 17:38:19 -05:00
- else
.light None
.selectbox.hide-collapsed
2016-01-27 17:38:19 -05:00
= f.collection_select :label_ids, issuable.project.labels.all, :id, :name,
{ selected: issuable.label_ids }, multiple: true, class: 'select2 js-select2', data: { placeholder: "Select labels" }
2016-01-27 17:38:19 -05:00
= render "shared/issuable/participants", participants: issuable.participants(current_user)
- if current_user
- subscribed = issuable.subscribed?(current_user)
.block.light.subscription{data: {url: toggle_subscription_path(issuable)}}
.sidebar-collapsed-icon
= icon('rss')
.title.hide-collapsed
Notifications
2016-01-27 17:38:19 -05:00
- subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed'
%button.btn.btn-block.btn-gray.subscribe-button.hide-collapsed{:type => 'button'}
2016-01-27 17:38:19 -05:00
%span= subscribed ? 'Unsubscribe' : 'Subscribe'
.subscription-status.hide-collapsed{data: {status: subscribtion_status}}
2016-01-27 17:38:19 -05:00
.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.
- project_ref = cross_project_reference(@project, issuable)
.block.project-reference
.sidebar-collapsed-icon
= clipboard_button(clipboard_text: project_ref)
.cross-project-reference.hide-collapsed
2016-01-27 17:38:19 -05:00
%span
Reference:
%cite{title: project_ref}
= project_ref
= clipboard_button(clipboard_text: project_ref)
2016-01-27 17:38:19 -05:00
:javascript
new Subscription('.subscription');
new MilestoneSelect();
new IssuableContext();