_context.html.haml 2.21 KB
Newer Older
1
= form_for [@project.namespace.becomes(Namespace), @project, issuable], remote: true, html: {class: 'issuable-context-form inline-update js-issuable-update'} do |f|
2 3 4 5 6 7 8 9 10
  %div.prepend-top-20
    .issuable-context-title
      %label
        Assignee:
      - if issuable.assignee
        %strong= link_to_member(@project, issuable.assignee, size: 24)
      - else
        none
    .issuable-context-selectbox
11
      - if can?(current_user, :admin_issue, @project)
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
        = 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)

  %div.prepend-top-20.clearfix
    .issuable-context-title
      %label
        Milestone:
      - 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
      - else
        none
    .issuable-context-selectbox
27
      - if can?(current_user, :admin_issue, @project)
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
        = f.select(:milestone_id, milestone_options(issuable), { include_blank: 'Select milestone' }, {class: 'select2 select2-compact js-select2 js-milestone'})
        = hidden_field_tag :issuable_context
        = f.submit class: 'btn hide'

  - if current_user
    - subscribed = issuable.subscribed?(current_user)
    %div.prepend-top-20.clearfix
      .issuable-context-title
        %label
          Subscription:
      %button.btn.btn-block.subscribe-button{:type => 'button'}
        = icon('eye')
        %span= subscribed ? 'Unsubscribe' : 'Subscribe'
      - subscribtion_status = subscribed ? 'subscribed' : 'unsubscribed'
      .subscription-status{data: {status: subscribtion_status}}
        .description-block.unsubscribed{class: ( 'hidden' if subscribed )}
          You're not receiving notifications from this thread.
        .description-block.subscribed{class: ( 'hidden' unless subscribed )}
          You're receiving notifications because you're subscribed to this thread.

:coffeescript
  new Subscription("#{toggle_subscription_path(issuable)}")
  new IssuableContext()