-content_for :sidebar do - if @issue.persisted? .bordered.nopadding %h3=t('activerecord.attributes.issue.status') - can_manage = can?(:update, @issue) #switcher.issue_status{class: "#{@issue.closed? ? 'switcher-off' : 'switcher'} #{can_manage ? "switch_issue_status" : ''}"} .swleft=t('layout.issues.status.open') .swright=t('layout.issues.status.closed') - if can_manage =form_tag [@project, @issue], id: 'update_issue_status', method: :put do =hidden_field_tag "issue_status", @issue.closed? ? 'closed' : 'open', name: "issue[status]" .block %h3=t('layout.issues.labels') - if can?(:write, @project) .current_labels - (@project.labels || []).each do |label| - is_issue_label = @issue.labels.include? label .label{id: "flag#{label.id}", class: @issue.persisted? ? 'nopointer' : 'add_label'} .flag{style: "background: ##{label.color}; #{is_issue_label ? 'display:none;' : ''}"} .labeltext{class: is_issue_label ? 'selected' : '', style: is_issue_label ? "background: ##{label.color}" : ''}=label.name .both=hidden_field_tag "flag#{label.id}", label.id, name: "issue[labelings_attributes][#{label.id}][label_id]" =form_for :issue, url: [@project, @issue], method: :put, html: { class: 'edit_labels issue'} do |f| .manage_labels =hidden_field_tag "update_labels", true - @issue.labels.each do |label| =hidden_field_tag "flag#{label.id}", label.id, name: "issue[labelings_attributes][#{label.id}][label_id]" - else - (@issue.labels || []).each do |label| .label.nopointer .labeltext.selected{style: "background: ##{label.color};"}=label.name .both - if can?(:write, @project) && @issue.persisted? =link_to(t('layout.issues.label_manage'), '#', class: "button tmargin10 manage_labels") =link_to(t('layout.issues.done'), '#', class: "button tmargin10 update_labels", style: 'display:none')