_sidebar.html.haml 5.63 KB
Newer Older
1
%aside.right-sidebar{ class: sidebar_gutter_collapsed_class }
2 3
  .issuable-sidebar
    .block
4
      %span.issuable-count.hide-collapsed.pull-left
5
        = issuable.iid
6
        of
7
        = issuables_count(issuable)
8 9
      %span.pull-right
        %a.gutter-toggle{href: '#'}
10
          = sidebar_gutter_toggle_icon
11
      .issuable-nav.hide-collapsed.pull-right.btn-group{role: 'group', "aria-label" => '...'}
12 13
        - if prev_issuable = prev_issuable_for(issuable)
          = link_to 'Prev', [@project.namespace.becomes(Namespace), @project, prev_issuable], class: 'btn btn-default prev-btn'
14 15 16
        - else
          %a.btn.btn-default.disabled{href: '#'}
            Prev
17 18
        - if next_issuable = next_issuable_for(issuable)
          = link_to 'Next', [@project.namespace.becomes(Namespace), @project, next_issuable], class: 'btn btn-default next-btn'
19 20 21
        - else
          %a.btn.btn-default.disabled{href: '#'}
            Next
22

23
    = form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-issuable-update'} do |f|
24
      .block.assignee
25
        .sidebar-collapsed-icon
26 27 28 29
          - if issuable.assignee
            = link_to_member_avatar(issuable.assignee, size: 24)
          - else
            = icon('user')
30
        .title.hide-collapsed
31 32 33 34 35
          %label
            Assignee
          - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
            .pull-right
              = link_to 'Edit', '#', class: 'edit-link'
36
        .value.hide-collapsed
37 38 39 40 41 42 43
          - if issuable.assignee
            %strong= link_to_member(@project, issuable.assignee, size: 24)
            - if issuable.instance_of?(MergeRequest) && !issuable.can_be_merged_by?(issuable.assignee)
              %a.pull-right.cannot-be-merged{href: '#', data: {toggle: 'tooltip'}, title: 'Not allowed to merge'}
                = icon('exclamation-triangle')
          - else
            .light None
44

45
        .selectbox.hide-collapsed
46
          = 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)
47

48
      .block.milestone
Jacob Schatz's avatar
Jacob Schatz committed
49
        .sidebar-collapsed-icon
50
          = icon('clock-o')
51 52 53 54 55
          %span
            - if issuable.milestone
              = issuable.milestone.title
            - else
              No
56
        .title.hide-collapsed
57 58
          %label
            Milestone
59 60 61
          - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
            .pull-right
              = link_to 'Edit', '#', class: 'edit-link'
62
        .value.hide-collapsed
63 64 65 66 67 68
          - if issuable.milestone
            %span.back-to-milestone
              = link_to namespace_project_milestone_path(@project.namespace, @project, issuable.milestone) do
                %strong
                  = icon('clock-o')
                  = issuable.milestone.title
69
          - else
70
            .light None
71
        .selectbox.hide-collapsed
72 73 74
          = f.select(:milestone_id, milestone_options(issuable), { include_blank: true }, { class: 'select2 select2-compact js-select2 js-milestone', data: { placeholder: 'Select milestone' }})
          = hidden_field_tag :issuable_context
          = f.submit class: 'btn hide'
75

76
      - if issuable.project.labels.any?
Jacob Schatz's avatar
Jacob Schatz committed
77
        .block.labels
78 79
          .sidebar-collapsed-icon
            = icon('tags')
80 81
            %span
              = issuable.labels.count
82
          .title.hide-collapsed
83 84 85 86
            %label Labels
            - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
              .pull-right
                = link_to 'Edit', '#', class: 'edit-link'
87
          .value.issuable-show-labels.hide-collapsed
88 89
            - if issuable.labels.any?
              - issuable.labels.each do |label|
90
                = link_to_label(label, type: issuable.to_ability_name)
91 92
            - else
              .light None
93
          .selectbox.hide-collapsed
94 95
            = 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" }
96

97
      = render "shared/issuable/participants", participants: issuable.participants(current_user)
98
      %hr
99 100 101
      - if current_user
        - subscribed = issuable.subscribed?(current_user)
        .block.light
102 103
          .sidebar-collapsed-icon
            = icon('rss')
104
          .title.hide-collapsed
105 106
            %label.light Notifications
          - subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed'
107
          %button.btn.btn-block.btn-gray.subscribe-button.hide-collapsed{:type => 'button'}
108
            %span= subscribed ? 'Unsubscribe' : 'Subscribe'
109
          .subscription-status.hide-collapsed{data: {status: subscribtion_status}}
110 111 112 113 114 115
            .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)
Jacob Schatz's avatar
Jacob Schatz committed
116
      .block.project-reference
117
        .sidebar-collapsed-icon
118
          = clipboard_button(clipboard_text: project_ref)
119
        .cross-project-reference.hide-collapsed
120 121 122 123 124
          %span
            Reference:
            %cite{title: project_ref}
              = project_ref
          = clipboard_button(clipboard_text: project_ref)
125

126 127
    :javascript
      new Subscription("#{toggle_subscription_path(issuable)}");
128
      new IssuableContext();