rosa-build/app/views/projects/issues/_manage_sidebar.html.haml

61 lines
3.4 KiB
Plaintext
Raw Normal View History

-content_for :sidebar do
2012-03-14 18:51:22 +00:00
- can_manage = can?(:update, @issue) && @issue.persisted? || @issue.new_record?
2012-02-28 14:05:18 +00:00
- if @issue.persisted?
.bordered.nopadding
%h3=t('activerecord.attributes.issue.status')
2012-03-05 18:28:55 +00:00
#switcher.issue_status{:class => "#{@issue.closed? ? 'switcher-off' : 'switcher'} #{can_manage ? "switch_issue_status" : ''}"}
2012-02-28 14:05:18 +00:00
.swleft=t('layout.issues.status.open')
.swright=t('layout.issues.status.closed')
2012-03-05 18:28:55 +00:00
- if can_manage
2012-02-28 14:05:18 +00:00
=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
2012-04-13 20:44:04 +01:00
%h3=t('layout.issues.assignee')
2012-03-05 18:28:55 +00:00
- if @issue.persisted?
2012-03-06 16:31:07 +00:00
-if can_manage
2012-04-13 20:44:04 +01:00
=form_for :issue, :url => [@project, @issue], :method => :put, :html => { :class => 'edit_assignee issue'} do |f|
=hidden_field_tag "user-default_assignee", nil, :name => 'issue[assignee_id]'
.current_assignee
- if @issue.assignee
#user-0.people.nopointer
2012-04-13 20:44:04 +01:00
.avatar=image_tag avatar_url(@issue.assignee), :alt => 'avatar'
2012-05-28 11:08:51 +01:00
.name=@issue.assignee.fullname
2012-04-13 20:44:04 +01:00
=hidden_field_tag "user-0", @issue.assignee.id, :name => 'issue[assignee_id]'
2012-03-06 16:31:07 +00:00
.both
2012-04-13 20:44:04 +01:00
- elsif @issue.assignee
2012-02-28 14:05:18 +00:00
.people.nopointer
2012-04-13 20:44:04 +01:00
.avatar=image_tag avatar_url(@issue.assignee), :alt => 'avatar'
2012-05-28 11:08:51 +01:00
.name=@issue.assignee.fullname
2012-02-28 14:05:18 +00:00
.both
=link_to(t('layout.issues.assignee_manage'), '#', :class => "button tmargin10 manage_assignee") if can_manage
2012-03-05 18:28:55 +00:00
- if can_manage
=form_tag search_collaborators_project_issues_path(@project), :id => 'search_user', :method => :get, :style => @issue.persisted? ? 'display:none' : '' do
2012-02-28 14:05:18 +00:00
=tracker_search_field(:search_user, t('layout.issues.search_user'))
2012-03-05 18:28:55 +00:00
#manage_issue_users_list
=render 'search_collaborators'
2012-04-13 20:44:04 +01:00
=link_to(t('layout.issues.done'), '#', :class => "button tmargin10 update_assignee", :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
=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_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')