60 lines
3.4 KiB
Plaintext
60 lines
3.4 KiB
Plaintext
-content_for :sidebar do
|
|
- can_manage = can?(:update, @issue) && @issue.persisted? || @issue.new_record?
|
|
- if @issue.persisted?
|
|
.bordered.nopadding
|
|
%h3=t('activerecord.attributes.issue.status')
|
|
#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]"
|
|
.bordered.nopadding
|
|
%h3=t('layout.issues.executor')
|
|
- if @issue.persisted?
|
|
-if can_manage
|
|
=form_for :issue, :url => [@project, @issue], :method => :put, :html => { :class => 'edit_executor issue'} do |f|
|
|
=hidden_field_tag "user-default_executor", nil, :name => 'issue[user_id]'
|
|
.current_executor
|
|
- if @issue.user
|
|
#user-0.people.nopointer
|
|
.avatar=image_tag avatar_url(@issue.user), :alt => 'avatar'
|
|
.name="#{@issue.user.uname} (#{@issue.user.name})"
|
|
=hidden_field_tag "user-0", @issue.user.id, :name => 'issue[user_id]'
|
|
.both
|
|
- elsif @issue.user
|
|
.people.nopointer
|
|
.avatar=image_tag avatar_url(@issue.user), :alt => 'avatar'
|
|
.name="#{@issue.user.uname} (#{@issue.user.name})"
|
|
.both
|
|
=link_to(t('layout.issues.label_manage'), '#', :class => "button tmargin10 manage_executor") if can_manage
|
|
- if can_manage
|
|
=form_tag search_collaborators_project_issues_path(@project), :id => 'search_user', :method => :get, :style => @issue.persisted? ? 'display:none' : '' do
|
|
=tracker_search_field(:search_user, t('layout.issues.search_user'))
|
|
#manage_issue_users_list
|
|
=render 'issues/search_collaborators'
|
|
=link_to(t('layout.issues.done'), '#', :class => "button tmargin10 update_executor", :style => 'display:none') if can_manage
|
|
|
|
.block
|
|
%h3=t('layout.issues.labels')
|
|
- if can_manage
|
|
.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
|
|
- @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_manage && @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')
|